File tree Expand file tree Collapse file tree 4 files changed +27
-12
lines changed
user_guide_src/source/concepts Expand file tree Collapse file tree 4 files changed +27
-12
lines changed Original file line number Diff line number Diff line change @@ -168,13 +168,4 @@ class Cache extends BaseConfig
168
168
* @var bool|list<string>
169
169
*/
170
170
public $ cacheQueryString = false ;
171
-
172
- /**
173
- * --------------------------------------------------------------------------
174
- * Config Caching
175
- * --------------------------------------------------------------------------
176
- *
177
- * @see https://codeigniter.com/user_guide/concepts/factories.html#config-caching
178
- */
179
- public bool $ configCacheEnabled = false ;
180
171
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Config ;
4
+
5
+ /**
6
+ * Optimization Configuration.
7
+ *
8
+ * NOTE: This class does not extend BaseConfig for performance reasons.
9
+ * So you cannot replace the property values with Environment Variables.
10
+ *
11
+ * @immutable
12
+ */
13
+ class Optimize
14
+ {
15
+ /**
16
+ * --------------------------------------------------------------------------
17
+ * Config Caching
18
+ * --------------------------------------------------------------------------
19
+ *
20
+ * @see https://codeigniter.com/user_guide/concepts/factories.html#config-caching
21
+ */
22
+ public bool $ configCacheEnabled = false ;
23
+ }
Original file line number Diff line number Diff line change 17
17
use CodeIgniter \CLI \Console ;
18
18
use CodeIgniter \Config \DotEnv ;
19
19
use Config \Autoload ;
20
- use Config \Cache ;
21
20
use Config \Modules ;
21
+ use Config \Optimize ;
22
22
use Config \Paths ;
23
23
use Config \Services ;
24
24
@@ -55,7 +55,8 @@ public static function bootWeb(Paths $paths): int
55
55
static ::setExceptionHandler ();
56
56
static ::initializeKint ();
57
57
58
- $ configCacheEnabled = (new Cache ())->configCacheEnabled ?? false ;
58
+ $ configCacheEnabled = class_exists (Optimize::class)
59
+ && (new Optimize ())->configCacheEnabled ;
59
60
if ($ configCacheEnabled ) {
60
61
$ factoriesCache = static ::loadConfigCache ();
61
62
}
Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ How to Enable Config Caching
318
318
319
319
.. versionadded :: 4.5.0
320
320
321
- Set the following property to ``true `` in **app/Config/Cache .php **::
321
+ Set the following property to ``true `` in **app/Config/Optimize .php **::
322
322
323
323
public bool $configCacheEnabled = true;
324
324
You can’t perform that action at this time.
0 commit comments