File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
system/Commands/Utilities Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1313
1414namespace CodeIgniter \Commands \Utilities ;
1515
16+ use CodeIgniter \Cache \FactoriesCache ;
1617use CodeIgniter \CLI \BaseCommand ;
1718use CodeIgniter \CLI \CLI ;
1819use CodeIgniter \Config \BaseConfig ;
20+ use Config \Optimize ;
1921use Kint \Kint ;
2022
2123/**
@@ -87,6 +89,14 @@ public function run(array $params)
8789 /** @var class-string<BaseConfig> $class */
8890 $ class = $ params [0 ];
8991
92+ // Load Config cache if it is enabled.
93+ $ configCacheEnabled = class_exists (Optimize::class)
94+ && (new Optimize ())->configCacheEnabled ;
95+ if ($ configCacheEnabled ) {
96+ $ factoriesCache = new FactoriesCache ();
97+ $ factoriesCache ->load ('config ' );
98+ }
99+
90100 $ config = config ($ class );
91101
92102 if ($ config === null ) {
@@ -103,6 +113,10 @@ public function run(array $params)
103113 );
104114 }
105115
116+ CLI ::newLine ();
117+ $ state = CLI ::color ($ configCacheEnabled ? 'Enabled ' : 'Disabled ' , 'green ' );
118+ CLI ::write ('Config Caching: ' . $ state );
119+
106120 return EXIT_SUCCESS ;
107121 }
108122
You can’t perform that action at this time.
0 commit comments