From 31df87535b5e8aaf15f0a1f200e3f9aac8d9e876 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 27 Aug 2015 21:45:02 +0930 Subject: [PATCH] Check to make sure directories are writable --- .../core/src/Install/Actions/IndexAction.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/framework/core/src/Install/Actions/IndexAction.php b/framework/core/src/Install/Actions/IndexAction.php index 0302b5076..75ae88c93 100644 --- a/framework/core/src/Install/Actions/IndexAction.php +++ b/framework/core/src/Install/Actions/IndexAction.php @@ -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 '.realpath($path).' 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;