public function unlink($path) {
    $url = $this->parseUrl($path);

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

    // I suppose we could allow deleting containers,
    // but that isn't really the purpose of the
    // stream wrapper.
    if (empty($url['path'])) {
      trigger_error('Path is required.', E_USER_WARNING);
      return FALSE;
    }

    try {
      $this->initializeObjectStorage();
      // $container = $this->store->container($url['host']);
      $name = $url['host'];
      $token = $this->store->token();
      $endpoint_url = $this->store->url() . '/' . rawurlencode($name);
      $container = new \HPCloud\Storage\ObjectStorage\Container($name, $endpoint_url, $token);
      return $container->delete($url['path']);
    }
    catch (\HPCLoud\Exception $e) {
      trigger_error('Error during unlink: ' . $e->getMessage(), E_USER_WARNING);
      return FALSE;
    }

  }
public function unlink($path) {
    $url = $this->parseUrl($path);

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

    // I suppose we could allow deleting containers,
    // but that isn't really the purpose of the
    // stream wrapper.
    if (empty($url['path'])) {
      trigger_error('Path is required.', E_USER_WARNING);
      return FALSE;
    }

    try {
      $this->initializeObjectStorage();
      // $container = $this->store->container($url['host']);
      $name = $url['host'];
      $token = $this->store->token();
      $endpoint_url = $this->store->url() . '/' . rawurlencode($name);
      $container = new \HPCloud\Storage\ObjectStorage\Container($name, $endpoint_url, $token);
      return $container->delete($url['path']);
    }
    catch (\HPCLoud\Exception $e) {
      trigger_error('Error during unlink: ' . $e->getMessage(), E_USER_WARNING);
      return FALSE;
    }

  }
public function unlink ( $ path ) { $ url = $ this -> parseUrl ( $ path ) ; // Host is required. if ( empty ( $ url [ 'host' ] ) ) { trigger_error ( 'Container name is required.' , E_USER_WARNING ) ; return FALSE ; } // I suppose we could allow deleting containers, // but that isn't really the purpose of the // stream wrapper. if ( empty ( $ url [ 'path' ] ) ) { trigger_error ( 'Path is required.' , E_USER_WARNING ) ; return FALSE ; } try { $ this -> initializeObjectStorage ( ) ; // $container = $this->store->container($url['host']); $ name = $ url [ 'host' ] ; $ token = $ this -> store -> token ( ) ; $ endpoint_url = $ this -> store -> url ( ) . '/' . rawurlencode ( $ name ) ; $ container = new \ HPCloud \ Storage \ ObjectStorage \ Container ( $ name , $ endpoint_url , $ token ) ; return $ container -> delete ( $ url [ 'path' ] ) ; } catch ( \ HPCLoud \ Exception $ e ) { trigger_error ( 'Error during unlink: ' . $ e -> getMessage ( ) , E_USER_WARNING ) ; return FALSE ; } }
Unlink a file.

This removes the remote copy of the file. Like a normal unlink operation,
it does not destroy the (local) file handle until the file is closed.
Therefore you can continue accessing the object locally.

Note that OpenStack Swift does not draw a distinction between file objects
and "directory" objects (where the latter is a 0-byte object). This will
delete either one. If you are using directory markers, not that deleting
a marker will NOT delete the contents of the "directory".

@attention
You will need to use HPCloud::Bootstrap::setConfiguration() to set the
necessary stream configuration, since \c unlink() does not take a context.

@param string $path
The URL.
@retval boolean
@return boolean
TRUE if the file was deleted, FALSE otherwise.
Unlink a file .