diff --git a/application/cache/.gitignore b/application/storage/cache/.gitignore similarity index 100% rename from application/cache/.gitignore rename to application/storage/cache/.gitignore diff --git a/application/db/.gitignore b/application/storage/db/.gitignore similarity index 100% rename from application/db/.gitignore rename to application/storage/db/.gitignore diff --git a/application/logs/.gitignore b/application/storage/logs/.gitignore similarity index 100% rename from application/logs/.gitignore rename to application/storage/logs/.gitignore diff --git a/application/sessions/.gitignore b/application/storage/sessions/.gitignore similarity index 100% rename from application/sessions/.gitignore rename to application/storage/sessions/.gitignore diff --git a/system/cache/driver/file.php b/system/cache/driver/file.php index 852bdb15..0994f75d 100644 --- a/system/cache/driver/file.php +++ b/system/cache/driver/file.php @@ -34,12 +34,12 @@ public function get($key, $default = null) return $this->items[$key]; } - if ( ! file_exists(APP_PATH.'cache/'.$key)) + if ( ! file_exists(APP_PATH.'storage/cache/'.$key)) { return $default; } - $cache = file_get_contents(APP_PATH.'cache/'.$key); + $cache = file_get_contents(APP_PATH.'storage/cache/'.$key); // -------------------------------------------------- // Has the cache expired? The UNIX expiration time @@ -65,7 +65,7 @@ public function get($key, $default = null) */ public function put($key, $value, $minutes) { - file_put_contents(APP_PATH.'cache/'.$key, (time() + ($minutes * 60)).serialize($value), LOCK_EX); + file_put_contents(APP_PATH.'storage/cache/'.$key, (time() + ($minutes * 60)).serialize($value), LOCK_EX); } /** @@ -76,7 +76,7 @@ public function put($key, $value, $minutes) */ public function forget($key) { - @unlink(APP_PATH.'cache/'.$key); + @unlink(APP_PATH.'storage/cache/'.$key); } } \ No newline at end of file diff --git a/system/db/connector.php b/system/db/connector.php index 39998060..f494b4ed 100644 --- a/system/db/connector.php +++ b/system/db/connector.php @@ -33,7 +33,7 @@ public static function connect($config) // If the database doesn't exist there, maybe the full // path was specified as the database name? // ----------------------------------------------------- - if (file_exists($path = APP_PATH.'db/'.$config->database.'.sqlite')) + if (file_exists($path = APP_PATH.'storage/db/'.$config->database.'.sqlite')) { return new \PDO('sqlite:'.$path, null, null, static::$options); } diff --git a/system/log.php b/system/log.php index 9c330a89..eba9d5d0 100644 --- a/system/log.php +++ b/system/log.php @@ -47,7 +47,7 @@ public static function write($type, $message) // ----------------------------------------------------- // Create the yearly and monthly directories if needed. // ----------------------------------------------------- - static::make_directory($directory = APP_PATH.'logs/'.date('Y')); + static::make_directory($directory = APP_PATH.'storage/logs/'.date('Y')); static::make_directory($directory .= '/'.date('m')); // ----------------------------------------------------- diff --git a/system/session/driver/file.php b/system/session/driver/file.php index d59f4258..47c70f10 100644 --- a/system/session/driver/file.php +++ b/system/session/driver/file.php @@ -10,7 +10,7 @@ class File implements \System\Session\Driver { */ public function load($id) { - if (file_exists($path = APP_PATH.'sessions/'.$id)) + if (file_exists($path = APP_PATH.'storage/sessions/'.$id)) { return unserialize(file_get_contents($path)); } @@ -24,7 +24,7 @@ public function load($id) */ public function save($session) { - file_put_contents(APP_PATH.'sessions/'.$session['id'], serialize($session), LOCK_EX); + file_put_contents(APP_PATH.'storage/sessions/'.$session['id'], serialize($session), LOCK_EX); } /** @@ -35,7 +35,7 @@ public function save($session) */ public function delete($id) { - @unlink(APP_PATH.'sessions/'.$id); + @unlink(APP_PATH.'storage/sessions/'.$id); } /** @@ -46,7 +46,7 @@ public function delete($id) */ public function sweep($expiration) { - foreach (glob(APP_PATH.'sessions/*') as $file) + foreach (glob(APP_PATH.'storage/sessions/*') as $file) { if (filetype($file) == 'file' and filemtime($file) < $expiration) {