Skip to content

Commit cdae0e9

Browse files
authored
Merge pull request #74 from michalsn/refactor-config-cache-support
refactor: manage config cache just like in the original codeigniter source code
2 parents f3a37ac + 128c65e commit cdae0e9

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/Config/Services.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use CodeIgniter\HTTP\ResponseInterface;
88
use CodeIgniter\HTTP\UserAgent;
99
use Config\App;
10-
use Config\Optimize;
1110
use Config\Paths;
1211
use Config\Services as AppServices;
1312
use Config\Toolbar as ToolbarConfig;
@@ -33,9 +32,7 @@ public static function renderer(?string $viewPath = null, ?ViewConfig $config =
3332
return static::getSharedInstance('renderer', $viewPath, $config);
3433
}
3534

36-
$viewPath = $viewPath ?: ((new Optimize())->configCacheEnabled ?
37-
(new Paths())->viewDirectory :
38-
config('Paths')->viewDirectory);
35+
$viewPath = $viewPath ?: (new Paths())->viewDirectory;
3936

4037
$config ??= config('View');
4138

tests/CommonTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ protected function setUp(): void
1313
{
1414
parent::setUp();
1515

16-
config('Paths')->viewDirectory = SUPPORTPATH . 'Views';
16+
service('renderer', SUPPORTPATH . 'Views');
1717
}
1818

1919
public function testViewFragmentNone(): void

0 commit comments

Comments
 (0)