add permission check for storage path

This commit is contained in:
printempw 2016-12-27 22:31:52 +08:00
parent c37091d0f1
commit 5e567c48a5
3 changed files with 17 additions and 0 deletions

View File

@ -28,6 +28,11 @@ class BootServiceProvider extends ServiceProvider
throw new PrettyPageException(trans('setup.file.no-dot-env'), -1);
}
// check permissions of storage path
if (!is_writable(storage_path())) {
throw new PrettyPageException(trans('setup.permissions.storage'), -1);
}
try {
// check database config
Database::prepareConnection();

View File

@ -0,0 +1,9 @@
database:
connection-error: Unable to connect to MySQL server, please check your configuration. :msg
file:
permission-error: Unable to create textures folder, please check the directory permissions or place one manually.
no-dot-env: Unable to find the .env configuration file.
permissions:
storage: Unable to write to storage directory, please check the permissions.

View File

@ -4,3 +4,6 @@ database:
file:
permission-error: textures 文件夹创建失败,请确认目录权限是否正确,或者手动放置一个。
no-dot-env: 找不到 .env 配置文件
permissions:
storage: 无法写入 storage 目录,请检查目录权限是否正确