mirror of
https://github.com/flarum/framework.git
synced 2024-12-01 14:20:47 +08:00
Check to make sure directories are writable
This commit is contained in:
parent
a289884f7c
commit
7d9527e5a0
|
@ -57,6 +57,21 @@ class IndexAction extends HtmlAction
|
|||
}
|
||||
}
|
||||
|
||||
$paths = [
|
||||
public_path(),
|
||||
public_path().'/assets',
|
||||
storage_path()
|
||||
];
|
||||
|
||||
foreach ($paths as $path) {
|
||||
if (! is_writable($path)) {
|
||||
$errors[] = [
|
||||
'message' => 'The <strong>'.realpath($path).'</strong> directory is not writable.',
|
||||
'detail' => 'Please chmod this directory '.($path !== public_path() ? ' and its contents' : '').' to 0755.'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if (count($errors)) {
|
||||
$view->content = $this->view->make('flarum.install::errors');
|
||||
$view->content->errors = $errors;
|
||||
|
|
Loading…
Reference in New Issue
Block a user