Skip to content

Commit

Permalink
[5.x] Avoid extending already-extended file cache store (#10526)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga authored Jul 30, 2024
1 parent f9777b8 commit e4d6e45
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Providers/CacheServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ private function extendFileStore()
), $this->app['config']['cache.stores.file']);
});

// Don't extend the file store if it's already being extended.
$creators = (fn () => $this->customCreators)->call(Cache::getFacadeRoot());
if (isset($creators['file'])) {
return;
}

Cache::extend('file', function ($app, $config) {
return Cache::repository(
(new FileStore($app['files'], $config['path'], $config['permission'] ?? null))
Expand Down

0 comments on commit e4d6e45

Please sign in to comment.