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
168168 * @var bool|list<string>
169169 */
170170 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 ;
180171}
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 1717use CodeIgniter \CLI \Console ;
1818use CodeIgniter \Config \DotEnv ;
1919use Config \Autoload ;
20- use Config \Cache ;
2120use Config \Modules ;
21+ use Config \Optimize ;
2222use Config \Paths ;
2323use Config \Services ;
2424
@@ -55,7 +55,8 @@ public static function bootWeb(Paths $paths): int
5555 static ::setExceptionHandler ();
5656 static ::initializeKint ();
5757
58- $ configCacheEnabled = (new Cache ())->configCacheEnabled ?? false ;
58+ $ configCacheEnabled = class_exists (Optimize::class)
59+ && (new Optimize ())->configCacheEnabled ;
5960 if ($ configCacheEnabled ) {
6061 $ factoriesCache = static ::loadConfigCache ();
6162 }
Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ How to Enable Config Caching
318318
319319.. versionadded :: 4.5.0
320320
321- Set the following property to ``true `` in **app/Config/Cache .php **::
321+ Set the following property to ``true `` in **app/Config/Optimize .php **::
322322
323323 public bool $configCacheEnabled = true;
324324
You can’t perform that action at this time.
0 commit comments