Check if one file in fileList is newer than the referenceFile.
@param $fileList An array of files
@param $referenceFile The file to check against
@return True, if one of the files is newer, false else
766072
protected function checkFileDate($fileList, $referenceFile) {
    foreach ($fileList as $file) {
      if (@filemtime($file) > @filemtime($referenceFile)) {
        return true;
      }
    }
    return false;
  }
1246968
public static function isValid(string $filePath): bool
    {
        return self::myFilePathParse(
            DIRECTORY_SEPARATOR,
            $filePath,
            function ($p, $d, &$e) {
                return self::myPartValidator($p, $d, $e);
            });
    }
947388
protected function shouldRefreshFileThumbnails($fileOperation)
    {
        $app = Application::getFacadeApplication();
        $em = $app->make(EntityManagerInterface::class);
        $qb = $em->createQueryBuilder();
        $qb
            ->select('ft.ftTypeID')
            ->from(ThumbnailType::class, 'ft')
            ->innerJoin('ft.ftAssociatedFileSets', 'ftfs')
            ->andWhere($qb->expr()->eq('ftfs.ftfsFileSetID', ':fsID'))
            ->setParameter('fsID', $this->getFileSetID())
            ->andWhere($qb->expr()->eq('ft.ftLimitedToFileSets', ':limitedTo'))
            ->setParameter('limitedTo', $fileOperation === 'add')
            ->setMaxResults(1)
        ;
        $query = $qb->getQuery();

        return $query->getOneOrNullResult($query::HYDRATE_SINGLE_SCALAR) !== null;
    }
992408
public function classFileExists($classFile)
    {
        if (file_exists($classFile)) {
            return true;
        }
        foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) {
            if (file_exists($path) && file_exists($path.DIRECTORY_SEPARATOR.$classFile)) {
                return true;
            }
        }
        return false;
    }
1073212
private function didAnyFileChange(array $changedFiles) : bool
    {
        foreach ($this->filesToWatch as $file) {
            if (in_array($file, $changedFiles)) {
                return true;
            }
        }
        return false;
    }
796619
void categorizeCurrentFile(final Reference ref) {
        final URI currentFile = ref.filename;
        if (listFilter.hasConaction()) {
            conrefpushSet.add(currentFile);
        }

        if (listFilter.hasConRef()) {
            conrefSet.add(currentFile);
        }

        if (listFilter.hasKeyRef()) {
            keyrefSet.add(currentFile);
        }

        if (listFilter.hasCodeRef()) {
            coderefSet.add(currentFile);
        }

        if (listFilter.isDitaTopic()) {
            if (ref.format != null && !ref.format.equals(ATTR_FORMAT_VALUE_DITA)) {
                assert currentFile.getFragment() == null;
                final URI f = currentFile.normalize();
                if (!fileinfos.containsKey(f)) {
                    final FileInfo i = new FileInfo.Builder()
                            .uri(tempFileNameScheme.generateTempFileName(currentFile))
                            .src(currentFile)
                            .format(ref.format)
                            .build();
                    fileinfos.put(i.src, i);
                }
            }
            fullTopicSet.add(currentFile);
            hrefTargetSet.add(currentFile);
            if (listFilter.hasHref()) {
                hrefTopicSet.add(currentFile);
            }
        } else if (listFilter.isDitaMap()) {
            fullMapSet.add(currentFile);
        }
    }
851919
public function isFileAllowed($filePath)
    {
        $filePath = realpath($filePath);
        foreach ($this->allowedImageFolders as $key => $nextFolder) {
            if (0 === strpos($filePath, $nextFolder)) {
                return $key;
            }
        }

        return false;
    }
53475
protected function inBlacklist($filename, array $blacklist)
    {
        foreach ($blacklist as $pattern) {
            if (fnmatch($pattern, $filename, FNM_PATHNAME | FNM_CASEFOLD)) {
                return true;
            }
        }

        return false;
    }
1043518
private function parseConfigurationFiles($fileList)
    {
        foreach ($fileList as $file) {
            if (!is_file($file) || !is_readable($file)) {
                if ($this->configuration->getLog())
                {
                    $this->configuration->getLog()->error("Failed to load configuration file " . $file);
                }
                continue;
            }

            global $config;
            $config = array();

            include_once($file);

            foreach ($config as $name => $value) {
                $this->mergeConfigurationOption($this->_config, $name, $value);
            }

            unset($config);
            if (!empty($GLOBALS['config'])) {
                unset($GLOBALS['config']);
            }
        }

        //Do a little global cleanup
        unset($config);
        if (!empty($GLOBALS['config'])) {
            unset($GLOBALS['config']);
        }
    }
1233398
protected function isBlacklistedFile(File $phpcsFile) {
		$file = $phpcsFile->getFilename();
		return strpos($file, DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR) !== false;
	}
576745
public static function exists(string ...$filepath)
    {
        if (count($filepath) == 1) {
            return (file_exists($filepath[0]));
        } else {
            $exists = [];
            foreach ($filepath as $one) {
                array_push($exists, [$one => file_exists($one)]);
            }
            return ($exists);
        }
    }
989938
public function arrangePermissionList($fileList)
    {
        $betterList = array();
        foreach ($fileList as $fileName) {

            $pathInfo = pathinfo($fileName);
            $dirname = $pathInfo['dirname'];

            $currentPath = $fileName;
            if ($this->getSearchCount($dirname, $fileList) > 1) {
                $currentPath = $dirname;
            }

            if (!$this->isItemIncludes($currentPath, $betterList)) {
                $betterList[] = $currentPath;
            }
        }

        return $betterList;
    }
960725
public function update($fileList)
    {
        $csums = array();

        foreach ($fileList as $file) {
            if (file_exists($file)) {
                $hash = $this->calculateHash($file);
                $csums[$this->_makeRelative($file)] = $hash;
            }
        }

        $this->data = $csums;

        $this->write();

        return $csums;
    }
5595
public function equals(FilePathInterface $filePath): bool
    {
        return $this->getDrive() === $filePath->getDrive() && $this->isAbsolute() === $filePath->isAbsolute() && $this->getDirectoryParts() === $filePath->getDirectoryParts() && $this->getFilename() === $filePath->getFilename();
    }
128831
public boolean containsFile(SftpFile f) {
		return unchangedFiles.contains(f) || newFiles.contains(f)
				|| updatedFiles.contains(f) || deletedFiles.contains(f)
				|| recursedDirectories.contains(f.getAbsolutePath())
				|| failedTransfers.containsKey(f);
	}
1199859
public function cache_file_by_reference($reference, $storedfile) {
        try {
            $this->import_external_file_contents($storedfile, $this->max_cache_bytes());
        } catch (Exception $e) {
            // Cache failure should not cause a fatal error. This is only a nice-to-have feature.
        }
    }
1056336
public function equals( $fileName )
	{
		$toCompare	= FS_File_Reader::load( $fileName );
		$thisFile	= FS_File_Reader::load( $this->fileName );
		return( $thisFile == $toCompare );
	}