JBZoo\Utils\FS::isFile PHP Method

isFile() public static method

Check is current path regular file
public static isFile ( string $path ) : boolean
$path string
return boolean
    public static function isFile($path)
    {
        $path = self::clean($path);
        return file_exists($path) && is_file($path);
    }

Usage Example

Beispiel #1
0
 /**
  * Check is current cache is expired
  */
 public function isExpired()
 {
     if (!FS::isFile($this->_resultFile)) {
         return true;
     }
     $fileAge = abs(time() - filemtime($this->_resultFile));
     if ($fileAge >= $this->_cache_ttl) {
         return true;
     }
     $firstLine = trim(FS::firstLine($this->_resultFile));
     $expected = trim($this->_getHeader());
     if ($expected === $firstLine) {
         return false;
     }
     return true;
 }
All Usage Examples Of JBZoo\Utils\FS::isFile