From: Vincent Vanwaelscappel Date: Thu, 16 Jun 2022 08:18:26 +0000 (+0200) Subject: wip #4210 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f0f31fd1121e3cecad99824e538cd9015385add3;p=cubist_cms-back.git wip #4210 @0.5 --- diff --git a/src/app/Cache.php b/src/app/Cache.php deleted file mode 100644 index fc1a485..0000000 --- a/src/app/Cache.php +++ /dev/null @@ -1,17 +0,0 @@ -put($key, $data, $ttl); + return $data; + } + return $this->remember($key, $ttl, $callback); + } +} diff --git a/src/app/CubistBackpackServiceProvider.php b/src/app/CubistBackpackServiceProvider.php index 8a81bd4..f7e0d78 100644 --- a/src/app/CubistBackpackServiceProvider.php +++ b/src/app/CubistBackpackServiceProvider.php @@ -2,12 +2,12 @@ namespace Cubist\Backpack; +use Cubist\Backpack\Cache\CacheManager; use Cubist\Backpack\Console\Commands\MigrateCommand; use Cubist\Backpack\Console\Commands\GenerateCommand; use Cubist\Backpack\Console\Commands\InstallCommand; use Cubist\Backpack\Console\Commands\LocaleCopy; use Cubist\Backpack\Console\Commands\LocaleSlugReset; -use Cubist\Backpack\Console\Commands\PrecacheCommand; use Cubist\Backpack\Console\Commands\RefreshComposedAttributesCommand; use Cubist\Backpack\Console\Commands\SearchIndexCommand; use Cubist\Backpack\Console\Commands\UpdateCommand; @@ -69,6 +69,10 @@ class CubistBackpackServiceProvider extends ServiceProvider $configs = ['app', 'cubist']; + $this->app->singleton('cache', function ($app) { + return new CacheManager($app); + }); + foreach ($configs as $config) { $this->mergeConfigFrom($resourcesDir . '/config/' . $config . '.php', $config); } @@ -81,8 +85,12 @@ class CubistBackpackServiceProvider extends ServiceProvider RefreshComposedAttributesCommand::class, SearchIndexCommand::class, LocaleCopy::class, - LocaleSlugReset::class, - PrecacheCommand::class + LocaleSlugReset::class ]); } + + public function provides() + { + return ['cache']; + } }