Returns file modification time.
@param  string $file Filepath to check
@return int|bool False on error. Integer when filemtime success.
160145
public function getFilemtimeCurrent($file)
    {
        if(is_readable($file) === false)
            return false;

        $time = filemtime($file);

        return $time ? $time : false;
    }
806740
static public function getFileExt($file)
    {
        $s = strrchr($file, '.');
        if ($s === false)
        {
            return false;
        }
        return strtolower(trim(substr($s, 1)));
    }
519386
public static function isFileReadable($file)
    {
        $result = false;

        if (!file_exists($file)) {
            return $result;
        }
        if (!is_file($file)) {
            return $result;
        }
        if (!is_readable($file)) {
            return $result;
        }

        $result = true;

        return $result;
    }
581022
def get_modification_datetime(filepath):
    
    import tzlocal
    timezone = tzlocal.get_localzone()
    mtime = datetime.fromtimestamp(os.path.getmtime(filepath))
    return mtime.replace(tzinfo=timezone)
80853
def modification_time(path)
      is_uri = URI.parse(path)
      if !is_uri.host.nil?
        return web_modification_time is_uri
      end
      File.new(path).mtime
    end
780324
public function getMetadataForFile(string $file): ?BenchmarkMetadata
    {
        $hierarchy = $this->reflector->reflect($file);

        if ($hierarchy->isEmpty()) {
            return null;
        }

        try {
            $top = $hierarchy->getTop();
        } catch (\InvalidArgumentException $exception) {
            return null;
        }

        if (true === $top->abstract) {
            return null;
        }

        $metadata = $this->driver->getMetadataForHierarchy($hierarchy);
        $this->validateBenchmark($hierarchy, $metadata);

        // validate the subject and load the parameter sets
        foreach ($metadata->getSubjects() as $subject) {
            $this->validateSubject($hierarchy, $subject);
            $paramProviders = $subject->getParamProviders();
            $parameterSets = $this->reflector->getParameterSets($metadata->getPath(), $paramProviders);

            foreach ($parameterSets as $parameterSet) {
                if (!is_array($parameterSet)) {
                    throw new \InvalidArgumentException(sprintf(
                        'Each parameter set must be an array, got "%s" for %s::%s',
                        gettype($parameterSet),
                        $metadata->getClass(),
                        $subject->getName()
                    ));
                }
            }
            $subject->setParameterSets($parameterSets);
        }

        return $metadata;
    }
1221537
protected function isValidCompiledFile($file)
    {
        return parent::isValidCompiledFile($file) && (int)$this->getUid() <= filemtime($file);
    }
1035914
static function fileExists($file){
        if(file_exists($file)) return $file;
        if(file_exists(static::$www.$file)) return static::$www.$file;
        if(file_exists(static::$phar.$file)) return static::$phar.$file;
        $xfile = str_replace(static::$www, static::$phar, $file);
        if(file_exists($xfile)) return $xfile;
        return false;
    }
446627
public function getRevFile($file)
    {
        $map = $this->getRevMap();
        if (isset($map[$file])) {
            $index = strrpos($file, '.');
            $file = $this->revPrefix . substr($file, 0, $index) . '-' . $map[$file] . substr($file, $index);
        }

        return $file;
    }
87618
public static function isFileEmpty($file)
    {
        if (!is_file($file)) {
            throw new RuntimeException(sprintf('Invalid file path supplied'));
        }

        return mb_strlen(file_get_contents($file, 2), 'UTF-8') > 0 ? false : true;
    }
667151
public function modified()
    {
        $path = $this->get('filepath');

        if (!file_exists($path)) {
            return null;
        }

        return filemtime($path) ?: null;
    }
1193083
public static long getLastModifiedRecursive(File file) {
		long time=file.lastModified();
		if(file.isDirectory()) {
			String[] list=file.list();
			if(list!=null) {
				int len=list.length;
				for(int c=0; c<len; c++) {
					long time2=getLastModifiedRecursive(new File(file, list[c]));
					if (time2 > time) time=time2;
				}
			}
		}
		return time;
	}
581993
public function getModificationTime() {

		if(false !== $this -> file -> getExists()) {

			$this -> refresh();
			
			return $this -> file -> getModificationTime();
		}
	}
1201132
private function modified($filename)
    {
        if ($this->isSFTP()) {
            $info = @$this->ftp->lstat($filename);
            if ($info) {
                return $info['mtime'];
            }
        } else {
            if ($time = @ftp_mdtm($this->ftp, $filename)) {
                return $time;
            }
        }
        $this->fail("couldn't get the file size for {$filename}");
    }
171462
public static boolean isModifed(File file, long lastModifyTime) {
		if (null == file || false == file.exists()) {
			return true;
		}
		return file.lastModified() != lastModifyTime;
	}
471080
protected function getCacheModificationDate($file)
    {
        $storageKey   = $this->getStorageKey() . '.lasmodified';
        $filemtime    = filemtime($file);
        $lastmodified = $this->storage->has($storageKey) ? $this->storage->get($storageKey) : $filemtime - 1;

        return array($filemtime, $lastmodified);
    }
761297
protected function _findFile($file)
    {
        foreach ($this->_settings['paths'] as $path) {
            $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
            if (file_exists($path . $file)) {
                return $path . $file;
            }
        }
        return $file;
    }