diff --git a/phpfastcache/3.0.0/abstract.php b/phpfastcache/3.0.0/abstract.php index 14b40e645..2df840e7d 100644 --- a/phpfastcache/3.0.0/abstract.php +++ b/phpfastcache/3.0.0/abstract.php @@ -272,7 +272,7 @@ protected function required_extension($name) { protected function readfile($file) { if(function_exists("file_get_contents")) { - return file_get_contents($file); + return @file_get_contents($file); } else { $string = ""; @@ -328,7 +328,7 @@ protected function decode($value) { protected function htaccessGen($path = "") { if($this->option("htaccess") == true) { - if(!file_exists($path."/.htaccess")) { + if(!@file_exists($path."/.htaccess")) { // echo "write me"; $html = "order deny, allow \r\n deny from all \r\n @@ -408,7 +408,7 @@ public function systemInfo() { protected function isExistingDriver($class) { - if(file_exists(dirname(__FILE__)."/drivers/".$class.".php")) { + if(@file_exists(dirname(__FILE__)."/drivers/".$class.".php")) { require_once(dirname(__FILE__)."/drivers/".$class.".php"); if(class_exists("phpfastcache_".$class)) { return true; diff --git a/phpfastcache/3.0.0/drivers/files.php b/phpfastcache/3.0.0/drivers/files.php index 6773bc052..0b61889ae 100644 --- a/phpfastcache/3.0.0/drivers/files.php +++ b/phpfastcache/3.0.0/drivers/files.php @@ -52,7 +52,7 @@ private function getFilePath($keyword, $skip = false) { * Skip Create Sub Folders; */ if($skip == false) { - if(!file_exists($path)) { + if(!@file_exists($path)) { if(!@mkdir($path,$this->__setChmodAuto())) { throw new Exception("PLEASE CHMOD ".$this->getPath()." - 0777 OR ANY WRITABLE PERMISSION!",92); } @@ -78,7 +78,7 @@ function driver_set($keyword, $value = "", $time = 300, $option = array() ) { /* * Skip if Existing Caching in Options */ - if(isset($option['skipExisting']) && $option['skipExisting'] == true && file_exists($file_path)) { + if(isset($option['skipExisting']) && $option['skipExisting'] == true && @file_exists($file_path)) { $content = $this->readfile($file_path); $old = $this->decode($content); $toWrite = false; @@ -89,7 +89,7 @@ function driver_set($keyword, $value = "", $time = 300, $option = array() ) { if($toWrite == true) { try { - $f = fopen($file_path, "w+"); + $f = @fopen($file_path, "w+"); fwrite($f, $data); fclose($f); } catch (Exception $e) { @@ -105,7 +105,7 @@ function driver_set($keyword, $value = "", $time = 300, $option = array() ) { function driver_get($keyword, $option = array()) { $file_path = $this->getFilePath($keyword); - if(!file_exists($file_path)) { + if(!@file_exists($file_path)) { return null; } @@ -147,7 +147,7 @@ function driver_stats($option = array()) { $total = 0; $removed = 0; - while($file=readdir($dir)) { + while($file=@readdir($dir)) { if($file!="." && $file!=".." && is_dir($path."/".$file)) { // read sub dir $subdir = @opendir($path."/".$file); @@ -155,10 +155,10 @@ function driver_stats($option = array()) { throw new Exception("Can't read path:".$path."/".$file,93); } - while($f = readdir($subdir)) { + while($f = @readdir($subdir)) { if($f!="." && $f!="..") { $file_path = $path."/".$file."/".$f; - $size = filesize($file_path); + $size = @filesize($file_path); $object = $this->decode($this->readfile($file_path)); if($this->isExpired($object)) { @unlink($file_path); @@ -195,7 +195,7 @@ function driver_clean($option = array()) { throw new Exception("Can't read PATH:".$path,94); } - while($file=readdir($dir)) { + while($file=@readdir($dir)) { if($file!="." && $file!=".." && is_dir($path."/".$file)) { // read sub dir $subdir = @opendir($path."/".$file); @@ -203,7 +203,7 @@ function driver_clean($option = array()) { throw new Exception("Can't read path:".$path."/".$file,93); } - while($f = readdir($subdir)) { + while($f = @readdir($subdir)) { if($f!="." && $f!="..") { $file_path = $path."/".$file."/".$f; @unlink($file_path); @@ -218,7 +218,7 @@ function driver_clean($option = array()) { function driver_isExisting($keyword) { $file_path = $this->getFilePath($keyword,true); - if(!file_exists($file_path)) { + if(!@file_exists($file_path)) { return false; } else { // check expired or not diff --git a/phpfastcache/3.0.0/drivers/sqlite.php b/phpfastcache/3.0.0/drivers/sqlite.php index 6e04a2358..0991bf45f 100644 --- a/phpfastcache/3.0.0/drivers/sqlite.php +++ b/phpfastcache/3.0.0/drivers/sqlite.php @@ -33,8 +33,8 @@ function initDB(PDO $db) { function initIndexing(PDO $db) { // delete everything before reset indexing - $dir = opendir($this->path); - while($file = readdir($dir)) { + $dir = @opendir($this->path); + while($file = @readdir($dir)) { if($file != "." && $file!=".." && $file != "indexing" && $file!="dbfastcache") { @unlink($this->path."/".$file); } @@ -54,7 +54,7 @@ function initIndexing(PDO $db) { function indexing($keyword) { if($this->indexing == NULL) { $createTable = false; - if(!file_exists($this->path."/indexing")) { + if(!@file_exists($this->path."/indexing")) { $createTable = true; } @@ -81,7 +81,7 @@ function indexing($keyword) { // check file size - $size = file_exists($this->path."/db".$db) ? filesize($this->path."/db".$db) : 1; + $size = @file_exists($this->path."/db".$db) ? @filesize($this->path."/db".$db) : 1; $size = round($size / 1024 / 1024,1); @@ -129,7 +129,7 @@ function db($keyword, $reset = false) { if(!isset($this->instant[$instant])) { // check DB Files ready or not $createTable = false; - if(!file_exists($this->path."/db".$instant) || $reset == true) { + if(!@file_exists($this->path."/db".$instant) || $reset == true) { $createTable = true; } $PDO = new PDO("sqlite:".$this->path."/db".$instant); @@ -171,7 +171,7 @@ function __construct($config = array()) { $this->fallback = true; } - if(!file_exists($this->getPath()."/sqlite")) { + if(!@file_exists($this->getPath()."/sqlite")) { if(!@mkdir($this->getPath()."/sqlite",$this->__setChmodAuto())) { $this->fallback = true; } @@ -310,11 +310,11 @@ function driver_stats($option = array()) { $total = 0; $optimized = 0; - $dir = opendir($this->path); - while($file = readdir($dir)) { + $dir = @opendir($this->path); + while($file = @readdir($dir)) { if($file!="." && $file!="..") { $file_path = $this->path."/".$file; - $size = filesize($file_path); + $size = @filesize($file_path); $total = $total + $size; try { @@ -328,7 +328,7 @@ function driver_stats($option = array()) { )); $PDO->exec("VACUUM;"); - $size = filesize($file_path); + $size = @filesize($file_path); $optimized = $optimized + $size; } catch (PDOException $e) { $size = 0; @@ -355,8 +355,8 @@ function driver_clean($option = array()) { $this->indexing = NULL; // delete everything before reset indexing - $dir = opendir($this->path); - while($file = readdir($dir)) { + $dir = @opendir($this->path); + while($file = @readdir($dir)) { if($file != "." && $file!="..") { @unlink($this->path."/".$file); } diff --git a/phpfastcache/3.0.0/phpfastcache.php b/phpfastcache/3.0.0/phpfastcache.php index dfbcad5a9..8bb396979 100644 --- a/phpfastcache/3.0.0/phpfastcache.php +++ b/phpfastcache/3.0.0/phpfastcache.php @@ -234,7 +234,7 @@ protected static function htaccessGen($path, $create = true) { die(" NEED WRITEABLE ".$path); } } - if(!file_exists($path."/.htaccess")) { + if(!@file_exists($path."/.htaccess")) { // echo "write me"; $html = "order deny, allow \r\n deny from all \r\n