public function ls($resource, $mode = self::LS_MODE_FILE, $recursive = false, $filter = null)
    {
        $files = [];
        list (, $paths, $path) = $this->_parse($resource);

        foreach ((array) $paths as $_path) {
            if (file_exists($_path . '/' . $path)) {
                foreach ($this->_list(FS::clean($_path . '/' . $path), '', $mode, $recursive, $filter) as $file) {
                    if (!Arr::in($file, $files)) {
                        $files[] = $file;
                    }
                }
            }
        }

        return $files;
    }
public function ls($resource, $mode = self::LS_MODE_FILE, $recursive = false, $filter = null)
    {
        $files = [];
        list (, $paths, $path) = $this->_parse($resource);

        foreach ((array) $paths as $_path) {
            if (file_exists($_path . '/' . $path)) {
                foreach ($this->_list(FS::clean($_path . '/' . $path), '', $mode, $recursive, $filter) as $file) {
                    if (!Arr::in($file, $files)) {
                        $files[] = $file;
                    }
                }
            }
        }

        return $files;
    }
public function ls ( $ resource , $ mode = self :: LS_MODE_FILE , $ recursive = false , $ filter = null ) { $ files = [ ] ; list ( , $ paths , $ path ) = $ this -> _parse ( $ resource ) ; foreach ( ( array ) $ paths as $ _path ) { if ( file_exists ( $ _path . '/' . $ path ) ) { foreach ( $ this -> _list ( FS :: clean ( $ _path . '/' . $ path ) , '' , $ mode , $ recursive , $ filter ) as $ file ) { if ( ! Arr :: in ( $ file , $ files ) ) { $ files [ ] = $ file ; } } } } return $ files ; }
Get a list of files or diretories from a resource.

@param string $resource
@param string $mode
@param bool $recursive
@param null $filter
@return array
@SuppressWarnings(PHPMD.ShortMethodName)
Get a list of files or diretories from a resource .