@@ -94,7 +94,7 @@ class CI_Loader {
94
94
protected $ _ci_cached_vars = array ();
95
95
96
96
/**
97
- * Stack of variable arrays to provide nested _ci_load calls all variables from parent calls
97
+ * Stack of variable arrays to provide nested _ci_load calls with all variables from parent calls
98
98
*
99
99
* @var array
100
100
*/
@@ -956,17 +956,10 @@ protected function _ci_load($_ci_data)
956
956
* configuration.
957
957
*/
958
958
959
- // Init current _ci_vars as current variable configuration
960
- if ( ! is_array ($ _ci_vars ))
961
- {
962
- $ _ci_vars = [];
963
- }
959
+ is_array ($ _ci_vars ) && $ _ci_vars = array ();
964
960
965
961
// Include the global cached vars into the current _ci_vars if needed
966
- if ( ! empty ($ this ->_ci_cached_vars ))
967
- {
968
- $ _ci_vars = array_merge ($ this ->_ci_cached_vars , $ _ci_vars );
969
- }
962
+ empty ($ this ->_ci_cached_vars ) OR $ _ci_vars = array_merge ($ this ->_ci_cached_vars , $ _ci_vars );
970
963
971
964
// Merge the last variable configuration from a parent _ci_load()
972
965
// call into the current _ci_vars
@@ -976,10 +969,7 @@ protected function _ci_load($_ci_data)
976
969
$ _ci_vars = array_merge ($ previous_variable_configuration , $ _ci_vars );
977
970
}
978
971
979
- // Push the current _ci_vars to the stack
980
972
array_push ($ this ->_ci_load_vars_stack , $ _ci_vars );
981
-
982
- // Extract the current _ci_vars
983
973
extract ($ _ci_vars );
984
974
985
975
/**
@@ -998,7 +988,7 @@ protected function _ci_load($_ci_data)
998
988
include ($ _ci_path ); // include() vs include_once() allows for multiple views with the same name
999
989
log_message ('info ' , 'File loaded: ' .$ _ci_path );
1000
990
1001
- // Remove current _ci_vars from stack again
991
+ // Remove current _ci_vars from stack
1002
992
array_pop ($ this ->_ci_load_vars_stack );
1003
993
1004
994
// Return the file data if requested
0 commit comments