@@ -50,6 +50,10 @@ class Mage_Core_Helper_EnvironmentConfigLoader extends Mage_Core_Helper_Abstract
50
50
*/
51
51
public function overrideEnvironment (Varien_Simplexml_Config $ xmlConfig )
52
52
{
53
+ $ data = Mage::registry ('current_env_config ' );
54
+ if ($ data ) {
55
+ return ;
56
+ }
53
57
$ env = $ this ->getEnv ();
54
58
55
59
foreach ($ env as $ configKey => $ value ) {
@@ -71,7 +75,7 @@ public function overrideEnvironment(Varien_Simplexml_Config $xmlConfig)
71
75
$ this ->setCache ($ store , $ value , $ path );
72
76
}
73
77
} catch (Throwable $ exception ) {
74
- Mage:: logException ( $ exception );
78
+ // invalid store, intentionally empty
75
79
}
76
80
break ;
77
81
@@ -91,15 +95,20 @@ public function overrideEnvironment(Varien_Simplexml_Config $xmlConfig)
91
95
}
92
96
}
93
97
} catch (Throwable $ exception ) {
94
- Mage:: logException ( $ exception );
98
+ // invalid store, intentionally empty
95
99
}
96
100
break ;
97
101
}
98
102
}
103
+ Mage::register ("current_env_config " , true , true );
99
104
}
100
105
101
106
public function hasPath (string $ wantedPath ): bool
102
107
{
108
+ $ data = Mage::registry ("config_env_has_path_ $ wantedPath " );
109
+ if ($ data !== null ) {
110
+ return $ data ;
111
+ }
103
112
$ env = $ this ->getEnv ();
104
113
$ config = [];
105
114
@@ -127,11 +136,17 @@ public function hasPath(string $wantedPath): bool
127
136
break ;
128
137
}
129
138
}
130
- return array_key_exists ($ wantedPath , $ config );
139
+ $ hasConfig = array_key_exists ($ wantedPath , $ config );
140
+ Mage::register ("config_env_has_path_ $ wantedPath " , $ hasConfig );
141
+ return $ hasConfig ;
131
142
}
132
143
133
144
public function getAsArray (string $ wantedScope ): array
134
145
{
146
+ $ data = Mage::registry ("config_env_array_ $ wantedScope " );
147
+ if ($ data !== null ) {
148
+ return $ data ;
149
+ }
135
150
$ env = $ this ->getEnv ();
136
151
$ config = [];
137
152
@@ -160,7 +175,7 @@ public function getAsArray(string $wantedScope): array
160
175
break ;
161
176
}
162
177
}
163
-
178
+ Mage:: register ( " config_env_array_ $ wantedScope " , $ config );
164
179
return $ config ;
165
180
}
166
181
0 commit comments