18 lines
841 B
PHP
18 lines
841 B
PHP
<?php
|
|
|
|
// Runtime directories are not distributed with application data. Prepare them
|
|
// before Laravel loads view configuration (which resolves the compiled path).
|
|
return static function (string $basePath, string $storagePath): void {
|
|
foreach (['app/private', 'app/public', 'framework/cache/data', 'framework/sessions', 'framework/views', 'logs'] as $directory) {
|
|
$path = $storagePath.'/'.$directory;
|
|
if (! is_dir($path) && ! @mkdir($path, 0775, true) && ! is_dir($path)) {
|
|
throw new RuntimeException('Cannot create Laravel runtime directory: '.$path);
|
|
}
|
|
}
|
|
|
|
$cachePath = $basePath.'/bootstrap/cache';
|
|
if (! is_dir($cachePath) && ! @mkdir($cachePath, 0775, true) && ! is_dir($cachePath)) {
|
|
throw new RuntimeException('Cannot create Laravel bootstrap cache: '.$cachePath);
|
|
}
|
|
};
|