AppserverIo\Appserver\Core\Scanner\AbstractScanner::getLastFileTouch PHP Method

getLastFileTouch() protected method

If the file doesn't exists, the method returns 0 to signal that the no successfull depolyment has been processed so far, e. g. the server has been installed and not been started yet.
protected getLastFileTouch ( string $file ) : integer
$file string The deployment directory
return integer The UNIX timestamp with the last successfully deployment date or 0 if no successful deployment has been processed
    protected function getLastFileTouch($file)
    {
        // initialize the file's mtime to 0
        $mtime = 0;
        // clear the stat cache to get real mtime if changed
        clearstatcache();
        // return the change date (last successful deployment date)
        if (is_file($file)) {
            $mtime = filemtime($file);
        }
        // return the file's mtime
        return $mtime;
    }