Esempio n. 1
0
 /**
  * Return the time at which the file or directory denoted by the given
  * abstract pathname was last modified, or zero if it does not exist or
  * some other I/O error occurs.
  */
 public function getLastModifiedTime(File $f)
 {
     if (!$f->exists()) {
         return 0;
     }
     @clearstatcache();
     $strPath = $f->getPath()->toNative();
     $mtime = @filemtime($strPath);
     if (false === $mtime) {
         // FAILED. Log and return err.
         $msg = "FileSystem::Filemtime() FAILED. Cannot can not get modified time of {$strPath}. {$php_errormsg}";
         throw new Exception($msg);
     } else {
         return (int) $mtime;
     }
 }