diff --git a/.gitignore b/.gitignore index 30f205bac..32af8955d 100644 --- a/.gitignore +++ b/.gitignore @@ -226,3 +226,8 @@ pip-log.txt .idea/scopes/scope_settings.xml .idea/vcs.xml .idea/workspace.xml + +################# +## NetBeans +################# +nbproject/ \ No newline at end of file diff --git a/phpfastcache/3.0.0/abstract.php b/phpfastcache/3.0.0/abstract.php index bf3cbdfb6..517220898 100644 --- a/phpfastcache/3.0.0/abstract.php +++ b/phpfastcache/3.0.0/abstract.php @@ -34,9 +34,9 @@ public function set($keyword, $value = "", $time = 0, $option = array() ) { } $object = array( "value" => $value, - "write_time" => @date("U"), + "write_time" => time(), "expired_in" => $time, - "expired_time" => @date("U") + (Int)$time, + "expired_time" => time() + (Int)$time, ); return $this->driver_set($keyword,$object,$time,$option); @@ -114,7 +114,7 @@ function increment($keyword, $step = 1 , $option = array()) { return false; } else { $value = (Int)$object['value'] + (Int)$step; - $time = $object['expired_time'] - @date("U"); + $time = $object['expired_time'] - time(); $this->set($keyword,$value, $time, $option); return true; } @@ -126,7 +126,7 @@ function decrement($keyword, $step = 1 , $option = array()) { return false; } else { $value = (Int)$object['value'] - (Int)$step; - $time = $object['expired_time'] - @date("U"); + $time = $object['expired_time'] - time(); $this->set($keyword,$value, $time, $option); return true; } @@ -140,7 +140,7 @@ function touch($keyword, $time = 300, $option = array()) { return false; } else { $value = $object['value']; - $time = $object['expired_time'] - @date("U") + $time; + $time = $object['expired_time'] - time() + $time; $this->set($keyword, $value,$time, $option); return true; } diff --git a/phpfastcache/3.0.0/drivers/files.php b/phpfastcache/3.0.0/drivers/files.php index 71150f33d..08fbee824 100644 --- a/phpfastcache/3.0.0/drivers/files.php +++ b/phpfastcache/3.0.0/drivers/files.php @@ -233,7 +233,7 @@ function driver_isExisting($keyword) { function isExpired($object) { - if(isset($object['expired_time']) && @date("U") >= $object['expired_time']) { + if(isset($object['expired_time']) && time() >= $object['expired_time']) { return true; } else { return false; diff --git a/phpfastcache/3.0.0/drivers/sqlite.php b/phpfastcache/3.0.0/drivers/sqlite.php index 0991bf45f..a04b9a36d 100644 --- a/phpfastcache/3.0.0/drivers/sqlite.php +++ b/phpfastcache/3.0.0/drivers/sqlite.php @@ -201,7 +201,7 @@ function driver_set($keyword, $value = "", $time = 300, $option = array() ) { $stm->execute(array( ":keyword" => $keyword, ":object" => $this->encode($value), - ":exp" => @date("U") + (Int)$time, + ":exp" => time() + (Int)$time, )); return true; @@ -212,7 +212,7 @@ function driver_set($keyword, $value = "", $time = 300, $option = array() ) { $stm->execute(array( ":keyword" => $keyword, ":object" => $this->encode($value), - ":exp" => @date("U") + (Int)$time, + ":exp" => time() + (Int)$time, )); } catch (PDOException $e) { return false; @@ -268,7 +268,7 @@ function driver_get($keyword, $option = array()) { } function isExpired($row) { - if(isset($row['exp']) && @date("U") >= $row['exp']) { + if(isset($row['exp']) && time() >= $row['exp']) { return true; } @@ -280,7 +280,7 @@ function deleteRow($row) { $stm = $this->db($row['keyword'])->prepare("DELETE FROM `caching` WHERE (`id`=:id) OR (`exp` <= :U) "); $stm->execute(array( ":id" => $row['id'], - ":U" => @date("U"), + ":U" => time(), )); } catch (PDOException $e) { return false; @@ -292,7 +292,7 @@ function driver_delete($keyword, $option = array()) { $stm = $this->db($keyword)->prepare("DELETE FROM `caching` WHERE (`keyword`=:keyword) OR (`exp` <= :U)"); $stm->execute(array( ":keyword" => $keyword, - ":U" => @date("U"), + ":U" => time(), )); } catch (PDOException $e) { return false; @@ -324,7 +324,7 @@ function driver_stats($option = array()) { $stm = $PDO->prepare("DELETE FROM `caching` WHERE `exp` <= :U"); $stm->execute(array( - ":U" => @date("U"), + ":U" => time(), )); $PDO->exec("VACUUM;");