@@ -57,6 +57,10 @@ class Mage_Core_Helper_EnvironmentConfigLoader extends Mage_Core_Helper_Abstract
57
57
*/
58
58
public function overrideEnvironment (Varien_Simplexml_Config $ xmlConfig )
59
59
{
60
+ $ data = Mage::registry ('current_env_config ' );
61
+ if ($ data ) {
62
+ return ;
63
+ }
60
64
$ env = $ this ->getEnv ();
61
65
62
66
foreach ($ env as $ configKey => $ value ) {
@@ -78,7 +82,7 @@ public function overrideEnvironment(Varien_Simplexml_Config $xmlConfig)
78
82
$ this ->setCache ($ store , $ value , $ path );
79
83
}
80
84
} catch (Throwable $ exception ) {
81
- Mage:: logException ( $ exception );
85
+ // invalid store, intentionally empty
82
86
}
83
87
break ;
84
88
@@ -98,15 +102,20 @@ public function overrideEnvironment(Varien_Simplexml_Config $xmlConfig)
98
102
}
99
103
}
100
104
} catch (Throwable $ exception ) {
101
- Mage:: logException ( $ exception );
105
+ // invalid store, intentionally empty
102
106
}
103
107
break ;
104
108
}
105
109
}
110
+ Mage::register ("current_env_config " , true , true );
106
111
}
107
112
108
113
public function hasPath (string $ wantedPath ): bool
109
114
{
115
+ $ data = Mage::registry ("config_env_has_path_ $ wantedPath " );
116
+ if ($ data !== null ) {
117
+ return $ data ;
118
+ }
110
119
$ env = $ this ->getEnv ();
111
120
$ config = [];
112
121
@@ -134,11 +143,17 @@ public function hasPath(string $wantedPath): bool
134
143
break ;
135
144
}
136
145
}
137
- return array_key_exists ($ wantedPath , $ config );
146
+ $ hasConfig = array_key_exists ($ wantedPath , $ config );
147
+ Mage::register ("config_env_has_path_ $ wantedPath " , $ hasConfig );
148
+ return $ hasConfig ;
138
149
}
139
150
140
151
public function getAsArray (string $ wantedScope ): array
141
152
{
153
+ $ data = Mage::registry ("config_env_array_ $ wantedScope " );
154
+ if ($ data !== null ) {
155
+ return $ data ;
156
+ }
142
157
$ env = $ this ->getEnv ();
143
158
$ config = [];
144
159
@@ -167,7 +182,7 @@ public function getAsArray(string $wantedScope): array
167
182
break ;
168
183
}
169
184
}
170
-
185
+ Mage:: register ( " config_env_array_ $ wantedScope " , $ config );
171
186
return $ config ;
172
187
}
173
188
0 commit comments