Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

override_rs_variables_by_eval()

Description

Run PHP code on array of variables. Used for modifying $GLOBALS.

Parameters

ColumnTypeDefaultDescription
$variables array Array of variables to apply override on.
$code string Signed string containing the PHP code to run.

Return

void

Location

include/config_functions.php lines 1403 to 1428

Definition

 
function override_rs_variables_by_eval(array $variablesstring $code)
    {
    global 
$configs_overwritten;
    
// Remove all previous overwrides that have been set
    
if(is_array($configs_overwritten) && count($configs_overwritten) != 0)
        {
        foreach(
$configs_overwritten as $option => $value)
            {
            
$variables[$option] = $value;
            }
        }

    
$temp_variables $variables;
    
extract($temp_variablesEXTR_REFS EXTR_SKIP);
    eval(
eval_check_signed($code));
    
$temp_array = [];
    foreach(
$temp_variables as $temp_variable_name => $temp_variable_val)
        {
        if(
$variables[$temp_variable_name] !== $temp_variable_val)
            {
            
$temp_array[$temp_variable_name] = $GLOBALS[$temp_variable_name];
            }
        
$GLOBALS[$temp_variable_name] = $temp_variable_val;
        }
    
$configs_overwritten $temp_array;
    }

This article was last updated 27th April 2024 11:35 Europe/London time based on the source file dated 18th April 2024 17:15 Europe/London time.