Collections functions
General functions
Render functions
Theme permission functions
Resource functions

is_tracking_vars_active()

Description

Check if ResourceSpace is still tracking variables for debug purposes.

Parameters

ColumnTypeDefaultDescription
$user int User ID for which we check if tracking vars is active

Return

boolean

Location

include/debug_functions.php lines 149 to 158

Definition

 
function is_tracking_vars_active(int $user)
    {
    
$duration = (int) get_sysvar("track_var_{$user}_duration"0) ?? 0;
    
$start = new DateTime(get_sysvar("track_var_{$user}_start_datetime"''));
    
$now = new DateTime();

    
$diff_in_min abs($now->getTimestamp() - $start->getTimestamp()) / 60;

    return 
$duration > (int) $diff_in_min;
    }

This article was last updated 2nd October 2022 16:35 Europe/London time based on the source file dated 28th June 2022 15:27 Europe/London time.