public function rmdir($options) {
    // We need to check that the 'directory' is empty before we can unlink it.
    // As we create a new instance of a CloudStorageDirectoryClient when
    // performing a rmdir(), all we need to check is that a readdir() returns
    // any value to know that the directory is not empty.
    if ($this->dir_readdir() !== false) {
      trigger_error('The directory is not empty.', E_USER_WARNING);
      return false;
    }

    $headers = $this->getOAuthTokenHeader(parent::WRITE_SCOPE);
    if ($headers === false) {
      if ($report_errors) {
        trigger_error("Unable to acquire OAuth token.", E_USER_WARNING);
      }
      return false;
    }

    $url = $this->createObjectUrl($this->bucket_name, $this->object_name);
    $http_response = $this->makeHttpRequest($url, "DELETE", $headers);

    if (false === $http_response) {
      trigger_error("Unable to connect to Google Cloud Storage Service.",
                    E_USER_WARNING);
      return false;
    }

    if (HttpResponse::NO_CONTENT == $http_response['status_code']) {
      return true;
    } else {
      trigger_error($this->getErrorMessage($http_response['status_code'],
                                           $http_response['body']),
                    E_USER_WARNING);
      return false;
    }
  }
public function rmdir($options) {
    // We need to check that the 'directory' is empty before we can unlink it.
    // As we create a new instance of a CloudStorageDirectoryClient when
    // performing a rmdir(), all we need to check is that a readdir() returns
    // any value to know that the directory is not empty.
    if ($this->dir_readdir() !== false) {
      trigger_error('The directory is not empty.', E_USER_WARNING);
      return false;
    }

    $headers = $this->getOAuthTokenHeader(parent::WRITE_SCOPE);
    if ($headers === false) {
      if ($report_errors) {
        trigger_error("Unable to acquire OAuth token.", E_USER_WARNING);
      }
      return false;
    }

    $url = $this->createObjectUrl($this->bucket_name, $this->object_name);
    $http_response = $this->makeHttpRequest($url, "DELETE", $headers);

    if (false === $http_response) {
      trigger_error("Unable to connect to Google Cloud Storage Service.",
                    E_USER_WARNING);
      return false;
    }

    if (HttpResponse::NO_CONTENT == $http_response['status_code']) {
      return true;
    } else {
      trigger_error($this->getErrorMessage($http_response['status_code'],
                                           $http_response['body']),
                    E_USER_WARNING);
      return false;
    }
  }
public function rmdir ( $ options ) { // We need to check that the 'directory' is empty before we can unlink it. // As we create a new instance of a CloudStorageDirectoryClient when // performing a rmdir(), all we need to check is that a readdir() returns // any value to know that the directory is not empty. if ( $ this -> dir_readdir ( ) !== false ) { trigger_error ( 'The directory is not empty.' , E_USER_WARNING ) ; return false ; } $ headers = $ this -> getOAuthTokenHeader ( parent :: WRITE_SCOPE ) ; if ( $ headers === false ) { if ( $ report_errors ) { trigger_error ( "Unable to acquire OAuth token." , E_USER_WARNING ) ; } return false ; } $ url = $ this -> createObjectUrl ( $ this -> bucket_name , $ this -> object_name ) ; $ http_response = $ this -> makeHttpRequest ( $ url , "DELETE" , $ headers ) ; if ( false === $ http_response ) { trigger_error ( "Unable to connect to Google Cloud Storage Service." , E_USER_WARNING ) ; return false ; } if ( HttpResponse :: NO_CONTENT == $ http_response [ 'status_code' ] ) { return true ; } else { trigger_error ( $ this -> getErrorMessage ( $ http_response [ 'status_code' ] , $ http_response [ 'body' ] ) , E_USER_WARNING ) ; return false ; } }
Attempts to remove the directory . The directory must be empty. A
E_WARNING level error will be generated on failure.

@param mixed $options A bitwise mask of values, such as
STREAM_MKDIR_RECURSIVE.

@return bool <code>true</code> if the directory was removed,
<code>false</code> otherwise.
Attempts to remove the directory . The directory must be empty . A E_WARNING level error will be generated on failure .