diff --git a/admin/install.php b/admin/install.php index 5d5375f1..471b5c9e 100644 --- a/admin/install.php +++ b/admin/install.php @@ -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")) { "; + if (!is_dir("../textures/")) { + echo mkdir("../textures/") ? "Creating textures directory..." : + "Creating textures directory failed." + } + echo "Successfully installed. Index"; if ($lock = fopen("./install.lock", 'w')) { diff --git a/includes/database.class.php b/includes/database.class.php index a26b7c45..626bfb9e 100644 --- a/includes/database.class.php +++ b/includes/database.class.php @@ -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; }