| 1 | <?php |
||
| 17 | class CacheServiceProvider extends ServiceProvider |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Indicates if loading of the provider is deferred. |
||
| 21 | * |
||
| 22 | * @var bool |
||
| 23 | */ |
||
| 24 | protected $defer = true; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Register the service provider. |
||
| 28 | * |
||
| 29 | * @return void |
||
| 30 | */ |
||
| 31 | 11 | public function register(): void |
|
| 32 | { |
||
| 33 | $this->app->singleton('cache', function ($app) { |
||
| 34 | 11 | return new CacheManager($app); |
|
| 35 | 11 | }); |
|
| 36 | |||
| 37 | $this->app->singleton('cache.store', function ($app) { |
||
| 38 | 11 | return $app['cache']->driver(); |
|
| 39 | 11 | }); |
|
| 40 | |||
| 41 | 11 | $this->app->singleton('memcached.connector', function () { |
|
| 42 | return new MemcachedConnector(); |
||
| 43 | 11 | }); |
|
| 44 | 11 | } |
|
| 45 | |||
| 46 | /** |
||
| 47 | * Get the services provided by the provider. |
||
| 48 | * |
||
| 49 | * @return array |
||
| 50 | */ |
||
| 51 | 1 | public function provides() |
|
| 59 | } |
||
| 60 |