BaiduBCS::delete_object PHP Method

delete_object() public method

删除object
public delete_object ( string $bucket, string $object, array $opt = [] ) : BCS_ResponseCore
$bucket string (Required)
$object string (Required)
$opt array (Optional)
return BCS_ResponseCore
    public function delete_object($bucket, $object, $opt = array())
    {
        $this->assertParameterArray($opt);
        $opt[self::BUCKET] = $bucket;
        $opt[self::METHOD] = 'DELETE';
        $opt[self::OBJECT] = $object;
        $response = $this->authenticate($opt);
        //$this->log ( $response->isOK () ? "Delete object success!" : "Delete object failed! Response: [" . $response->body . "]", $opt );
        return $response;
    }

Usage Example

Esempio n. 1
0
function file_deleteBAE($file) {
	global $_W;
	$baiduBCS = new BaiduBCS($_W['config']['bae']['ak'], $_W['config']['bae']['sk']);
	if ($file[0] == '/' && $baiduBCS->is_object_exist($_W['config']['bae']['bucket'], $file)) {
		$response = $baiduBCS->delete_object($_W['config']['bae']['bucket'], $file);
	}
	return TRUE;
}
All Usage Examples Of BaiduBCS::delete_object