From b463015df86a3245cb262e4e28985f77999c41c2 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 2 Jul 2018 09:34:17 +0200 Subject: [PATCH 1/2] Check if configuration cache is valid after saving --- .../Foundation/Console/ConfigCacheCommand.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Console/ConfigCacheCommand.php b/src/Illuminate/Foundation/Console/ConfigCacheCommand.php index edd85ee533f6..3c73129a0f89 100644 --- a/src/Illuminate/Foundation/Console/ConfigCacheCommand.php +++ b/src/Illuminate/Foundation/Console/ConfigCacheCommand.php @@ -2,6 +2,7 @@ namespace Illuminate\Foundation\Console; +use LogicException; use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem; use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract; @@ -52,11 +53,19 @@ public function handle() $this->call('config:clear'); $config = $this->getFreshConfiguration(); + $configPath = $this->laravel->getCachedConfigPath(); $this->files->put( - $this->laravel->getCachedConfigPath(), 'files->delete($configPath); + throw new LogicException('Unable to cache Laravel configuration.', 0, $e); + } + $this->info('Configuration cached successfully!'); } From f3056cd23e7046b2f507ab3c97795bafddff0bbf Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 2 Jul 2018 10:11:22 +0200 Subject: [PATCH 2/2] Update ConfigCacheCommand.php --- src/Illuminate/Foundation/Console/ConfigCacheCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Console/ConfigCacheCommand.php b/src/Illuminate/Foundation/Console/ConfigCacheCommand.php index 3c73129a0f89..20cc0a7e4794 100644 --- a/src/Illuminate/Foundation/Console/ConfigCacheCommand.php +++ b/src/Illuminate/Foundation/Console/ConfigCacheCommand.php @@ -65,7 +65,7 @@ public function handle() $this->files->delete($configPath); throw new LogicException('Unable to cache Laravel configuration.', 0, $e); } - + $this->info('Configuration cached successfully!'); }