static function recursiveFileSearch(string $path, $searchmask = '*') {
        $path = \rtrim($path, '/');
        
        $files = array();
        if(is_array($searchmask)) {
            $csearchmask = \count($searchmask);
            
            for($i = 0; $i < $csearchmask; $i++) {
                $files = \array_merge($files, \glob($path.'/'.$searchmask[$i]));
            }
            
            \sort($files);
        } else {
            $files = \glob($path.'/'.$searchmask);
        }
        
        
        $dirs = \glob($path.'/*', GLOB_ONLYDIR);
        foreach($dirs as $dir) {
            if(\is_dir($dir)) {
                $files = \array_merge($files, self::recursiveFileSearch($dir, $searchmask));
            }
        }
        
        \sort($files);
        return $files;
    }
static function recursiveFileSearch(string $path, $searchmask = '*') {
        $path = \rtrim($path, '/');
        
        $files = array();
        if(is_array($searchmask)) {
            $csearchmask = \count($searchmask);
            
            for($i = 0; $i < $csearchmask; $i++) {
                $files = \array_merge($files, \glob($path.'/'.$searchmask[$i]));
            }
            
            \sort($files);
        } else {
            $files = \glob($path.'/'.$searchmask);
        }
        
        
        $dirs = \glob($path.'/*', GLOB_ONLYDIR);
        foreach($dirs as $dir) {
            if(\is_dir($dir)) {
                $files = \array_merge($files, self::recursiveFileSearch($dir, $searchmask));
            }
        }
        
        \sort($files);
        return $files;
    }
static function recursiveFileSearch ( string $ path , $ searchmask = '*' ) { $ path = \ rtrim ( $ path , '/' ) ; $ files = array ( ) ; if ( is_array ( $ searchmask ) ) { $ csearchmask = \ count ( $ searchmask ) ; for ( $ i = 0 ; $ i < $ csearchmask ; $ i ++ ) { $ files = \ array_merge ( $ files , \ glob ( $ path . '/' . $ searchmask [ $ i ] ) ) ; } \ sort ( $ files ) ; } else { $ files = \ glob ( $ path . '/' . $ searchmask ) ; } $ dirs = \ glob ( $ path . '/*' , GLOB_ONLYDIR ) ; foreach ( $ dirs as $ dir ) { if ( \ is_dir ( $ dir ) ) { $ files = \ array_merge ( $ files , self :: recursiveFileSearch ( $ dir , $ searchmask ) ) ; } } \ sort ( $ files ) ; return $ files ; }
Performs a recursive file search in the specified path, using the specified search mask.
@param string        $path
@param string|array  $searchmask
@return string[]
Performs a recursive file search in the specified path using the specified search mask .