public function register()
{
$app = $this->app;
$configPath = __DIR__ . '/../config/httpcache.php';
$this->mergeConfigFrom($configPath, 'httpcache');
if (function_exists('config_path')) {
$this->publishes([$configPath => config_path('httpcache.php')], 'config');
}
$app['http_cache.options'] = array_replace(array('debug' => $app['config']->get('app.debug')), $app['config']->get('httpcache.options'));
$app['http_cache.cache_dir'] = $app['config']->get('httpcache.cache_dir');
$app->singleton(Store::class, function ($app) {
return new Store($app['http_cache.cache_dir']);
});
$app->alias(Store::class, StoreInterface::class);
$app->singleton(Esi::class, function ($app) {
if ($app['config']->get('httpcache.esi')) {
return new Esi();
}
});
$app->alias(Esi::class, SurrogateInterface::class);
$this->app->bind('command.httpcache.clear', function ($app) {
return new Console\ClearCommand($app['files']);
});
$this->commands('command.httpcache.clear');
}