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

    $http_response = $this->makeHttpRequest($this->url,
                                            "DELETE",
                                            $token_header);

    if ($http_response === false) {
      return false;
    }

    // Unlinking the file also removes it from the stat cache.
    // See: http://php.net/manual/en/function.clearstatcache.php
    clearstatcache(true, $this->filename);

    if ($http_response['status_code'] === HttpResponse::NO_CONTENT) {
      return true;
    } else {
      trigger_error($this->getErrorMessage($http_response['status_code'],
                                           $http_response['body']),
                    E_USER_WARNING);
    }

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

    $http_response = $this->makeHttpRequest($this->url,
                                            "DELETE",
                                            $token_header);

    if ($http_response === false) {
      return false;
    }

    // Unlinking the file also removes it from the stat cache.
    // See: http://php.net/manual/en/function.clearstatcache.php
    clearstatcache(true, $this->filename);

    if ($http_response['status_code'] === HttpResponse::NO_CONTENT) {
      return true;
    } else {
      trigger_error($this->getErrorMessage($http_response['status_code'],
                                           $http_response['body']),
                    E_USER_WARNING);
    }

    return false;
  }
public function delete ( ) { $ token_header = $ this -> getOAuthTokenHeader ( parent :: WRITE_SCOPE ) ; if ( $ token_header === false ) { trigger_error ( "Unable to acquire OAuth token." , E_USER_WARNING ) ; return false ; } $ http_response = $ this -> makeHttpRequest ( $ this -> url , "DELETE" , $ token_header ) ; if ( $ http_response === false ) { return false ; } // Unlinking the file also removes it from the stat cache. // See: http://php.net/manual/en/function.clearstatcache.php clearstatcache ( true , $ this -> filename ) ; if ( $ http_response [ 'status_code' ] === HttpResponse :: NO_CONTENT ) { return true ; } else { trigger_error ( $ this -> getErrorMessage ( $ http_response [ 'status_code' ] , $ http_response [ 'body' ] ) , E_USER_WARNING ) ; } return false ; }
Delete the object from the Cloud Storage Bucket.
Delete the object from the Cloud Storage Bucket .