UpYun::delete PHP Method

delete() public method

删除目录和文件
public delete ( string $path ) : boolean
$path string 路径
return boolean
    public function delete($path)
    {
        /*{{{*/
        return $this->_do_request('DELETE', $path);
    }

Usage Example

Exemplo n.º 1
0
 public static function delete($file)
 {
     if (empty($file)) {
         return false;
     }
     if (function_exists('option')) {
         $bucket = option('config.attachment_up_bucket');
         $user = option('config.attachment_up_username');
         $pwd = option('config.attachment_up_password');
         $unlink = option('config.attachment_upload_unlink');
     } else {
         $bucket = C('config.attachment_up_bucket');
         $user = C('config.attachment_up_username');
         $pwd = C('config.attachment_up_password');
         $unlink = C('config.attachment_upload_unlink');
     }
     if (empty($bucket) || empty($user) || empty($pwd)) {
         return false;
     }
     if (empty($unlink)) {
         return false;
     }
     $upyun = new UpYun($bucket, $user, $pwd);
     try {
         error_log('upyunUser::delete:' . $file);
         $upyun->delete($file);
     } catch (Exception $e) {
         print_r($e);
     }
 }
All Usage Examples Of UpYun::delete