File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,13 @@ class Configure {
48
48
*/
49
49
protected static $ _engines = [];
50
50
51
+ /**
52
+ * Flag to track whether or not ini_set exists.
53
+ *
54
+ * @return void
55
+ */
56
+ protected static $ _hasIniSet = null ;
57
+
51
58
/**
52
59
* Used to store a dynamic variable in Configure.
53
60
*
@@ -81,11 +88,12 @@ public static function write($config, $value = null) {
81
88
static ::$ _values = Hash::insert (static ::$ _values , $ name , $ value );
82
89
}
83
90
84
- if (isset ($ config ['debug ' ]) && function_exists ('ini_set ' )) {
85
- if (static ::$ _values ['debug ' ]) {
86
- ini_set ('display_errors ' , 1 );
87
- } else {
88
- ini_set ('display_errors ' , 0 );
91
+ if (isset ($ config ['debug ' ])) {
92
+ if (static ::$ _hasIniSet === null ) {
93
+ static ::$ _hasIniSet = function_exists ('ini_set ' );
94
+ }
95
+ if (static ::$ _hasIniSet ) {
96
+ ini_set ('display_errors ' , $ config ['debug ' ] ? 1 : 0 );
89
97
}
90
98
}
91
99
return true ;
You can’t perform that action at this time.
0 commit comments