public function dir_opendir($path, $options) {
    $url = $this->parseUrl($path);

    if (empty($url['host'])) {
      trigger_error('Container name is required.' , E_USER_WARNING);
      return FALSE;
    }

    try {
      $this->initializeObjectStorage();
      $container = $this->store->container($url['host']);

      if (empty($url['path'])) {
        $this->dirPrefix = '';
      }
      else {
        $this->dirPrefix = $url['path'];
      }

      $sep = '/';


      $this->dirListing = $container->objectsWithPrefix($this->dirPrefix, $sep);
    }
    catch (\HPCloud\Exception $e) {
      trigger_error('Directory could not be opened: ' . $e->getMessage(), E_USER_WARNING);
      return FALSE;
    }

    return TRUE;
  }
public function dir_opendir($path, $options) {
    $url = $this->parseUrl($path);

    if (empty($url['host'])) {
      trigger_error('Container name is required.' , E_USER_WARNING);
      return FALSE;
    }

    try {
      $this->initializeObjectStorage();
      $container = $this->store->container($url['host']);

      if (empty($url['path'])) {
        $this->dirPrefix = '';
      }
      else {
        $this->dirPrefix = $url['path'];
      }

      $sep = '/';


      $this->dirListing = $container->objectsWithPrefix($this->dirPrefix, $sep);
    }
    catch (\HPCloud\Exception $e) {
      trigger_error('Directory could not be opened: ' . $e->getMessage(), E_USER_WARNING);
      return FALSE;
    }

    return TRUE;
  }
public function dir_opendir ( $ path , $ options ) { $ url = $ this -> parseUrl ( $ path ) ; if ( empty ( $ url [ 'host' ] ) ) { trigger_error ( 'Container name is required.' , E_USER_WARNING ) ; return FALSE ; } try { $ this -> initializeObjectStorage ( ) ; $ container = $ this -> store -> container ( $ url [ 'host' ] ) ; if ( empty ( $ url [ 'path' ] ) ) { $ this -> dirPrefix = '' ; } else { $ this -> dirPrefix = $ url [ 'path' ] ; } $ sep = '/' ; $ this -> dirListing = $ container -> objectsWithPrefix ( $ this -> dirPrefix , $ sep ) ; } catch ( \ HPCloud \ Exception $ e ) { trigger_error ( 'Directory could not be opened: ' . $ e -> getMessage ( ) , E_USER_WARNING ) ; return FALSE ; } return TRUE ; }
Open a directory for reading.

@code
<?php

// Assuming a valid context in $cxt...

// Get the container as if it were a directory.
$dir = opendir('swift://mycontainer', $cxt);

// Do something with $dir

closedir($dir);
?>
@endcode

See opendir() and scandir().

@param string $path
The URL to open.
@param int $options
Unused.
@retval boolean
@return boolean
TRUE if the directory is opened, FALSE otherwise.
Open a directory for reading .