protected static function findFile($file, array $paths)
    {
        if ($file === null) {
            return null;
        }
        foreach ($paths as $path) {
            $files = glob("$path/$file");
            if (!empty($files)) {
                return $files[0];
            }
        }
    }
protected static function findFile($file, array $paths)
    {
        if ($file === null) {
            return null;
        }
        foreach ($paths as $path) {
            $files = glob("$path/$file");
            if (!empty($files)) {
                return $files[0];
            }
        }
    }
protected static function findFile ( $ file , array $ paths ) { if ( $ file === null ) { return null ; } foreach ( $ paths as $ path ) { $ files = glob ( "$path/$file" ) ; if ( ! empty ( $ files ) ) { return $ files [ 0 ] ; } } }
Finds a file in a list of paths

@param string $file  glob pattern to search inside each path
@param array  $paths List of paths to search

@return string If file was found
@return null   If file was not found
Finds a file in a list of paths