Skip to content

Commit 128ab51

Browse files
committed
Added exception error when bootstrap/cache directory is not writable
1 parent 2d5514c commit 128ab51

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Illuminate/Foundation/ProviderRepository.php

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Illuminate\Foundation;
44

55
use Illuminate\Filesystem\Filesystem;
6+
use Illuminate\Contracts\Filesystem\FileNotFoundException;
67
use Illuminate\Contracts\Foundation\Application as ApplicationContract;
78

89
class ProviderRepository
@@ -180,9 +181,14 @@ protected function freshManifest(array $providers)
180181
*
181182
* @param array $manifest
182183
* @return array
184+
* @throws FileNotFoundException
183185
*/
184186
public function writeManifest($manifest)
185187
{
188+
if (! is_writable(dirname($this->manifestPath))) {
189+
throw new FileNotFoundException('The bootstrap/cache directory must be present and writable.');
190+
}
191+
186192
$this->files->put(
187193
$this->manifestPath, '<?php return '.var_export($manifest, true).';'
188194
);

0 commit comments

Comments
 (0)