Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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 169 to 202

Definition

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

    
$all_tracked_vars = [];
    
$all_users_tracked_vars ps_array("SELECT `value` FROM sysvars WHERE `name` REGEXP '^track_var_[[:digit:]]+$'",array());
    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));
    
$tracked_var_cache[$user] = $return;
    return 
$return;
    }

This article was last updated 24th May 2023 09:05 Europe/London time based on the source file dated 28th June 2022 15:27 Europe/London time.