public function dir_opendir($uri, $options)
    {
        $this->uri = $uri;

        $path = Util::normalizePath($this->getTarget());

        $this->listing = $this->invoke($this->getFilesystem(), 'listContents', [$path], 'opendir');

        if ($this->listing === false) {
            return false;
        }

        if ( ! $dirlen = strlen($path)) {
            return true;
        }

        // Remove the separator /.
        $dirlen++;

        // Remove directory prefix.
        foreach ($this->listing as $delta => $item) {
            $this->listing[$delta]['path'] = substr($item['path'], $dirlen);
        }

        reset($this->listing);

        return true;
    }
public function dir_opendir($uri, $options)
    {
        $this->uri = $uri;

        $path = Util::normalizePath($this->getTarget());

        $this->listing = $this->invoke($this->getFilesystem(), 'listContents', [$path], 'opendir');

        if ($this->listing === false) {
            return false;
        }

        if ( ! $dirlen = strlen($path)) {
            return true;
        }

        // Remove the separator /.
        $dirlen++;

        // Remove directory prefix.
        foreach ($this->listing as $delta => $item) {
            $this->listing[$delta]['path'] = substr($item['path'], $dirlen);
        }

        reset($this->listing);

        return true;
    }
public function dir_opendir ( $ uri , $ options ) { $ this -> uri = $ uri ; $ path = Util :: normalizePath ( $ this -> getTarget ( ) ) ; $ this -> listing = $ this -> invoke ( $ this -> getFilesystem ( ) , 'listContents' , [ $ path ] , 'opendir' ) ; if ( $ this -> listing === false ) { return false ; } if ( ! $ dirlen = strlen ( $ path ) ) { return true ; } // Remove the separator /. $ dirlen ++ ; // Remove directory prefix. foreach ( $ this -> listing as $ delta => $ item ) { $ this -> listing [ $ delta ] [ 'path' ] = substr ( $ item [ 'path' ] , $ dirlen ) ; } reset ( $ this -> listing ) ; return true ; }
Opens a directory handle.

@param string $uri     The URL that was passed to opendir().
@param int    $options Whether or not to enforce safe_mode (0x04).

@return bool True on success, false on failure.
Opens a directory handle .