src/GameOfLife/Utils/FileSystem/FileSystemReader.php
/**
     * Searches a folder for a file.
     *
     * @param String $_baseFolder The folder path
     * @param String $_fileName The file name
     *
     * @return String|bool The file path or false
     *
     * @throws \Exception The exception when the target directory does not exist
     */
Searches a folder for a file.
@param String $_baseFolder The folder path
@param String $_fileName The file name

@return String|bool The file path or false

@throws \Exception The exception when the target directory does not exist
Searches a folder for a file . @param String $_baseFolder The folder path @param String $_fileName The file name @return String|bool The file path or false @throws \ Exception The exception when the target directory does not exist
public function findFileRecursive(String $_baseFolder, String $_fileName)
    {
        $baseFolder = $this->convertSlashes($_baseFolder);
        if (! is_dir(dirname($baseFolder))) throw new \Exception("The directory \"" . $baseFolder . "\" does not exist.");
        $directoryIterator = new \RecursiveDirectoryIterator($baseFolder);
        foreach (new \RecursiveIteratorIterator($directoryIterator) as $file)
        {
            if (strtolower(basename($file)) == strtolower($_fileName))
            {
                return $this->convertSlashes($file);
            }
        }
        return false;
    }
public function findFileRecursive ( String $ _baseFolder , String $ _fileName ) { $ baseFolder = $ this -> convertSlashes ( $ _baseFolder ) ; if ( ! is_dir ( dirname ( $ baseFolder ) ) ) throw new \ Exception ( " The directory  \" " . $ baseFolder . " \"  does not exist. " ) ; $ directoryIterator = new \ RecursiveDirectoryIterator ( $ baseFolder ) ; foreach ( new \ RecursiveIteratorIterator ( $ directoryIterator ) as $ file ) { if ( strtolower ( basename ( $ file ) ) == strtolower ( $ _fileName ) ) { return $ this -> convertSlashes ( $ file ) ; } } return false ; }
Searches a folder for a file.
Searches a folder for a file .