added a few more path constants.
This commit is contained in:
8
system/cache/driver/file.php
vendored
8
system/cache/driver/file.php
vendored
@@ -22,12 +22,12 @@ class File implements \System\Cache\Driver {
|
||||
*/
|
||||
public function get($key)
|
||||
{
|
||||
if ( ! file_exists(APP_PATH.'storage/cache/'.$key))
|
||||
if ( ! file_exists(CACHE_PATH.$key))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$cache = file_get_contents(APP_PATH.'storage/cache/'.$key);
|
||||
$cache = file_get_contents(CACHE_PATH.$key);
|
||||
|
||||
if (time() >= substr($cache, 0, 10))
|
||||
{
|
||||
@@ -49,7 +49,7 @@ class File implements \System\Cache\Driver {
|
||||
*/
|
||||
public function put($key, $value, $minutes)
|
||||
{
|
||||
file_put_contents(APP_PATH.'storage/cache/'.$key, (time() + ($minutes * 60)).serialize($value), LOCK_EX);
|
||||
file_put_contents(CACHE_PATH.$key, (time() + ($minutes * 60)).serialize($value), LOCK_EX);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,7 +60,7 @@ class File implements \System\Cache\Driver {
|
||||
*/
|
||||
public function forget($key)
|
||||
{
|
||||
@unlink(APP_PATH.'storage/cache/'.$key);
|
||||
@unlink(CACHE_PATH.$key);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,7 +54,7 @@ class Connector {
|
||||
*/
|
||||
private static function connect_to_sqlite($config)
|
||||
{
|
||||
if (file_exists($path = APP_PATH.'storage/db/'.$config->database.'.sqlite'))
|
||||
if (file_exists($path = DATABASE_PATH.$config->database.'.sqlite'))
|
||||
{
|
||||
return new \PDO('sqlite:'.$path, null, null, static::$options);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class File implements \System\Session\Driver {
|
||||
*/
|
||||
public function load($id)
|
||||
{
|
||||
if (file_exists($path = APP_PATH.'storage/sessions/'.$id))
|
||||
if (file_exists($path = SESSION_PATH.$id))
|
||||
{
|
||||
return unserialize(file_get_contents($path));
|
||||
}
|
||||
@@ -24,7 +24,7 @@ class File implements \System\Session\Driver {
|
||||
*/
|
||||
public function save($session)
|
||||
{
|
||||
file_put_contents(APP_PATH.'storage/sessions/'.$session['id'], serialize($session), LOCK_EX);
|
||||
file_put_contents(SESSION_PATH.$session['id'], serialize($session), LOCK_EX);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ class File implements \System\Session\Driver {
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
@unlink(APP_PATH.'storage/sessions/'.$id);
|
||||
@unlink(SESSION_PATH.$id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,7 @@ class File implements \System\Session\Driver {
|
||||
*/
|
||||
public function sweep($expiration)
|
||||
{
|
||||
foreach (glob(APP_PATH.'storage/sessions/*') as $file)
|
||||
foreach (glob(SESSION_PATH.'*') as $file)
|
||||
{
|
||||
if (filetype($file) == 'file' and filemtime($file) < $expiration)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user