Navigation Menu

Skip to content

Commit

Permalink
Enhance performance of function config_get_global
Browse files Browse the repository at this point in the history
Issue #24553
  • Loading branch information
atrol committed Jun 25, 2018
1 parent 7a6b83c commit 5e9e126
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/config_api.php
Expand Up @@ -173,12 +173,14 @@ function config_get( $p_option, $p_default = null, $p_user = null, $p_project =
*/
function config_get_global( $p_option, $p_default = null ) {
global $g_cache_config_eval;
if( isset( $GLOBALS['g_' . $p_option] ) ) {
if( !isset( $g_cache_config_eval['g_' . $p_option] ) ) {
$t_value = config_eval( $GLOBALS['g_' . $p_option], true );
$g_cache_config_eval['g_' . $p_option] = $t_value;

$t_var_name = 'g_' . $p_option;
if( isset( $GLOBALS[$t_var_name] ) ) {
if( !isset( $g_cache_config_eval[$t_var_name] ) ) {
$t_value = config_eval( $GLOBALS[$t_var_name], true );
$g_cache_config_eval[$t_var_name] = $t_value;
} else {
$t_value = $g_cache_config_eval['g_' . $p_option];
$t_value = $g_cache_config_eval[$t_var_name];
}
return $t_value;
} else {
Expand Down

0 comments on commit 5e9e126

Please sign in to comment.