Skip to content

Commit b61baa7

Browse files
committed
docs: update "How to Enable Config Caching"
1 parent 97de8bb commit b61baa7

File tree

1 file changed

+31
-24
lines changed

1 file changed

+31
-24
lines changed

user_guide_src/source/concepts/factories.rst

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -316,27 +316,34 @@ Or simply delete the **writable/cache/FactoriesCache_config** file.
316316
How to Enable Config Caching
317317
============================
318318

319-
Uncomment the following code in **public/index.php**::
320-
321-
--- a/public/index.php
322-
+++ b/public/index.php
323-
@@ -49,8 +49,8 @@ if (! defined('ENVIRONMENT')) {
324-
}
325-
326-
// Load Config Cache
327-
-// $factoriesCache = new \CodeIgniter\Cache\FactoriesCache();
328-
-// $factoriesCache->load('config');
329-
+$factoriesCache = new \CodeIgniter\Cache\FactoriesCache();
330-
+$factoriesCache->load('config');
331-
// ^^^ Uncomment these lines if you want to use Config Caching.
332-
333-
/*
334-
@@ -79,7 +79,7 @@ $app->setContext($context);
335-
$app->run();
336-
337-
// Save Config Cache
338-
-// $factoriesCache->save('config');
339-
+$factoriesCache->save('config');
340-
// ^^^ Uncomment this line if you want to use Config Caching.
341-
342-
// Exits the application, setting the exit code for CLI-based applications
319+
.. versionadded:: 4.5.0
320+
321+
Set the following property to ``true`` in **app/Config/Cache.php**::
322+
323+
public bool $configCacheEnabled = true;
324+
325+
.. note::
326+
Prior to v4.5.0, uncomment the following code in **public/index.php**::
327+
328+
--- a/public/index.php
329+
+++ b/public/index.php
330+
@@ -49,8 +49,8 @@ if (! defined('ENVIRONMENT')) {
331+
}
332+
333+
// Load Config Cache
334+
-// $factoriesCache = new \CodeIgniter\Cache\FactoriesCache();
335+
-// $factoriesCache->load('config');
336+
+$factoriesCache = new \CodeIgniter\Cache\FactoriesCache();
337+
+$factoriesCache->load('config');
338+
// ^^^ Uncomment these lines if you want to use Config Caching.
339+
340+
/*
341+
@@ -79,7 +79,7 @@ $app->setContext($context);
342+
$app->run();
343+
344+
// Save Config Cache
345+
-// $factoriesCache->save('config');
346+
+$factoriesCache->save('config');
347+
// ^^^ Uncomment this line if you want to use Config Caching.
348+
349+
// Exits the application, setting the exit code for CLI-based applications

0 commit comments

Comments
 (0)