commit a5b047296543fb58565a31ec536d8fa7dc08d13a
parent 2098a41e57242e8fbf50c72a7983d271b289b18d
Author: Felicitus <felicitus@felicitus.org>
Date: Sat, 10 Oct 2015 12:10:52 +0200
check write permission for app/ and web/ as well
Diffstat:
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/app/PartKeeprRequirements.php b/app/PartKeeprRequirements.php
@@ -26,17 +26,25 @@ class PartKeeprRequirements extends SymfonyRequirements
sprintf("The php.ini memory_limit directive must be set to 64MB or higher. Your limit is set to %s",
ini_get("memory_limit")));
+ $this->checkWritable(realpath(dirname(__FILE__)."/../data/"));
+ $this->checkWritable(realpath(dirname(__FILE__)."/../app/"));
+ $this->checkWritable(realpath(dirname(__FILE__)."/../web/"));
+ }
+
+ /**
+ * Checks if a path is writable. If not, generates a requirement
+ * @param $path string The path to check
+ */
+ protected function checkWritable ($path) {
try {
- $this->isWritableRecursive(realpath(dirname(__FILE__)."/../data/"));
+ $this->isWritableRecursive($path);
} catch (\Exception $e) {
$this->addRequirement(
false,
- sprintf('Directory or file not writable'),
+ sprintf('Directory %s and all subfolders/files must be writable', $path),
$e->getMessage());
}
-
}
-
/**
* Returns a php.ini setting with parsed byte values.
*