Skip to content

Commit

Permalink
docs: update "How to Enable Config Caching"
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Feb 19, 2024
1 parent 20c827f commit 8827884
Showing 1 changed file with 31 additions and 24 deletions.
55 changes: 31 additions & 24 deletions user_guide_src/source/concepts/factories.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,27 +316,34 @@ Or simply delete the **writable/cache/FactoriesCache_config** file.
How to Enable Config Caching
============================

Uncomment the following code in **public/index.php**::

--- a/public/index.php
+++ b/public/index.php
@@ -49,8 +49,8 @@ if (! defined('ENVIRONMENT')) {
}

// Load Config Cache
-// $factoriesCache = new \CodeIgniter\Cache\FactoriesCache();
-// $factoriesCache->load('config');
+$factoriesCache = new \CodeIgniter\Cache\FactoriesCache();
+$factoriesCache->load('config');
// ^^^ Uncomment these lines if you want to use Config Caching.

/*
@@ -79,7 +79,7 @@ $app->setContext($context);
$app->run();

// Save Config Cache
-// $factoriesCache->save('config');
+$factoriesCache->save('config');
// ^^^ Uncomment this line if you want to use Config Caching.

// Exits the application, setting the exit code for CLI-based applications
.. versionadded:: 4.5.0

Set the following property to ``true`` in **app/Config/App.php**::

public bool $configCacheEnabled = true;

.. note::
Prior to v4.5.0, uncomment the following code in **public/index.php**::

--- a/public/index.php
+++ b/public/index.php
@@ -49,8 +49,8 @@ if (! defined('ENVIRONMENT')) {
}

// Load Config Cache
-// $factoriesCache = new \CodeIgniter\Cache\FactoriesCache();
-// $factoriesCache->load('config');
+$factoriesCache = new \CodeIgniter\Cache\FactoriesCache();
+$factoriesCache->load('config');
// ^^^ Uncomment these lines if you want to use Config Caching.

/*
@@ -79,7 +79,7 @@ $app->setContext($context);
$app->run();

// Save Config Cache
-// $factoriesCache->save('config');
+$factoriesCache->save('config');
// ^^^ Uncomment this line if you want to use Config Caching.

// Exits the application, setting the exit code for CLI-based applications

0 comments on commit 8827884

Please sign in to comment.