Skip to content

Commit

Permalink
Merge pull request #74 from michalsn/refactor-config-cache-support
Browse files Browse the repository at this point in the history
refactor: manage config cache just like in the original codeigniter source code
  • Loading branch information
michalsn authored Sep 10, 2024
2 parents f3a37ac + 128c65e commit cdae0e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\HTTP\UserAgent;
use Config\App;
use Config\Optimize;
use Config\Paths;
use Config\Services as AppServices;
use Config\Toolbar as ToolbarConfig;
Expand All @@ -33,9 +32,7 @@ public static function renderer(?string $viewPath = null, ?ViewConfig $config =
return static::getSharedInstance('renderer', $viewPath, $config);
}

$viewPath = $viewPath ?: ((new Optimize())->configCacheEnabled ?
(new Paths())->viewDirectory :
config('Paths')->viewDirectory);
$viewPath = $viewPath ?: (new Paths())->viewDirectory;

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

Expand Down
2 changes: 1 addition & 1 deletion tests/CommonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protected function setUp(): void
{
parent::setUp();

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

public function testViewFragmentNone(): void
Expand Down

0 comments on commit cdae0e9

Please sign in to comment.