add check for directory textures existence

This commit is contained in:
printempw 2016-02-03 15:47:06 +08:00
parent c0e3f48f06
commit 30dd926632
2 changed files with 11 additions and 2 deletions

View File

@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-16 23:01:33
* @Last Modified by: prpr
* @Last Modified time: 2016-02-03 13:50:17
* @Last Modified time: 2016-02-03 15:45:46
*
* Create tables automatically
*/
@ -61,6 +61,11 @@ if (!file_exists("./install.lock")) {
</pre>
";
if (!is_dir("../textures/")) {
echo mkdir("../textures/") ? "Creating textures directory..." :
"Creating textures directory failed."
}
echo "Successfully installed. <a href='../index.php'>Index</a>";
if ($lock = fopen("./install.lock", 'w')) {

View File

@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-02-02 21:59:06
* @Last Modified by: prpr
* @Last Modified time: 2016-02-03 12:12:16
* @Last Modified time: 2016-02-03 15:46:01
*/
class database
@ -24,6 +24,10 @@ class database
utils::raise(-1, "Looks like that there is no `users` table in your database. ".
"Please run `/admin/install.php` first.");
}
if (!is_dir("./textures/")) {
utils::raise(-1, "No `textures` directory exists. Please run `/admin/install.php` ".
"or put one manually.");
}
return $conn;
}