Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

get_tracked_vars()

Description

Get all tracked variables (for debug) for user. If user invalid, it will get all the variables currently being tracked
by all users.

Parameters

ColumnTypeDefaultDescription
$user int User ID

Return

array List of variable names

Location

include/debug_functions.php lines 168 to 191

Definition

 
function get_tracked_vars(int $user)
    {
    if(
$user 0)
        {
        
$vars_csv get_sysvar("track_var_{$user}"'');
        
$vars_list explode(','$vars_csv);
        
$vars_trimmed array_map('trim'$vars_list);
        
$vars_not_empty array_filter($vars_trimmed);
        return 
array_values(array_unique($vars_not_empty));
        }

    
$all_tracked_vars = [];
    
$all_users_tracked_vars sql_array("SELECT `value` FROM sysvars WHERE `name` REGEXP '^track_var_[[:digit:]]+$'");
    foreach(
$all_users_tracked_vars as $vars_csv)
        {
        
$vars_list explode(','$vars_csv);
        
$vars_trimmed array_map('trim'$vars_list);
        
$vars_not_empty array_filter($vars_trimmed);

        
$all_tracked_vars array_merge($all_tracked_vars$vars_not_empty);
        }

    return 
array_values(array_unique($all_tracked_vars));
    }

This article was last updated 15th June 2021 15:05 Europe/London time based on the source file dated 10th May 2021 17:30 Europe/London time.