src/Vectorface/SnappyRouter/Di/ServiceProvider.php
private function findFileInFolderRecursively($file, $folder)
    {
        $dir = dir($folder);
        while (false !== ($item = $dir->read())) {
            if ('.' === $item || '..' === $item) {
                continue;
            }
            $fullPath = $folder.DIRECTORY_SEPARATOR.$item;
            if (0 === strcasecmp($item, $file)) {
                return $fullPath;
            } elseif (is_dir($fullPath)) {
                $fullPath = $this->findFileInFolderRecursively($file, $fullPath);
                if (false !== $fullPath) {
                    return $fullPath;
                }
            }
        }
        return false;
    }
private function findFileInFolderRecursively($file, $folder)
    {
        $dir = dir($folder);
        while (false !== ($item = $dir->read())) {
            if ('.' === $item || '..' === $item) {
                continue;
            }
            $fullPath = $folder.DIRECTORY_SEPARATOR.$item;
            if (0 === strcasecmp($item, $file)) {
                return $fullPath;
            } elseif (is_dir($fullPath)) {
                $fullPath = $this->findFileInFolderRecursively($file, $fullPath);
                if (false !== $fullPath) {
                    return $fullPath;
                }
            }
        }
        return false;
    }
private function findFileInFolderRecursively ( $ file , $ folder ) { $ dir = dir ( $ folder ) ; while ( false !== ( $ item = $ dir -> read ( ) ) ) { if ( '.' === $ item || '..' === $ item ) { continue ; } $ fullPath = $ folder . DIRECTORY_SEPARATOR . $ item ; if ( 0 === strcasecmp ( $ item , $ file ) ) { return $ fullPath ; } elseif ( is_dir ( $ fullPath ) ) { $ fullPath = $ this -> findFileInFolderRecursively ( $ file , $ fullPath ) ; if ( false !== $ fullPath ) { return $ fullPath ; } } } return false ; }
Scan for the specific file recursively.
@param string $file The file to search for.
@param string $folder The folder to search inside.
@return mixed Returns either the full path string to the file or false
if the file was not found.
Scan for the specific file recursively .