Constants

EXPIRED_SECONDS

EXPIRED_SECONDS = 180

SLICE_SIZE_1M

SLICE_SIZE_1M = 1048576

MAX_UNSLICE_FILE_SIZE

MAX_UNSLICE_FILE_SIZE = 20971520

MAX_RETRY_TIMES

MAX_RETRY_TIMES = 3

Properties

$timeout

$timeout : 

Type

$region

$region : 

Type

Methods

setTimeout()

setTimeout(integer  $timeout = 60) 

设置HTTP请求超时时间

Parameters

integer $timeout

超时时长

setRegion()

setRegion(  $region) 

Parameters

$region

upload()

upload(string  $bucket, string  $srcPath, string  $dstPath, string  $bizAttr = null,   $sliceSize = null, string  $insertOnly = null) : \qcloudcos\[type]

上传文件,自动判断文件大小,如果小于20M则使用普通文件上传,大于20M则使用分片上传

Parameters

string $bucket

bucket名称

string $srcPath

本地文件路径

string $dstPath

上传的文件路径

string $bizAttr

文件属性

$sliceSize
string $insertOnly

同名文件是否覆盖

Returns

\qcloudcos\[type] —

[description]

createFolder()

createFolder(  $bucket,   $folder,   $bizAttr = null) 

Parameters

$bucket
$folder
$bizAttr

listFolder()

listFolder(  $bucket,   $folder,   $num = 20,   $pattern = 'eListBoth',   $order,   $context = null) 

Parameters

$bucket
$folder
$num
$pattern
$order
$context

prefixSearch()

prefixSearch(  $bucket,   $prefix,   $num = 20,   $pattern = 'eListBoth',   $order,   $context = null) 

Parameters

$bucket
$prefix
$num
$pattern
$order
$context

updateFolder()

updateFolder(  $bucket,   $folder,   $bizAttr = null) 

Parameters

$bucket
$folder
$bizAttr

statFolder()

statFolder(  $bucket,   $folder) 

Parameters

$bucket
$folder

delFolder()

delFolder(  $bucket,   $folder) 

Parameters

$bucket
$folder

update()

update(  $bucket,   $path,   $bizAttr = null,   $authority = null,   $customer_headers_array = null) 

Parameters

$bucket
$path
$bizAttr
$authority
$customer_headers_array

stat()

stat(  $bucket,   $path) 

Parameters

$bucket
$path

delFile()

delFile(  $bucket,   $path) 

Parameters

$bucket
$path

copyFile()

copyFile(  $bucket,   $srcFpath,   $dstFpath,   $overwrite = false) : array|\qcloudcos\mixed.

Copy a file.

Parameters

$bucket

bucket name.

$srcFpath

source file path.

$dstFpath

destination file path.

$overwrite

if the destination location is occupied, overwrite it or not?

Returns

array|\qcloudcos\mixed.

moveFile()

moveFile(  $bucket,   $srcFpath,   $dstFpath,   $overwrite = false) : array|\qcloudcos\mixed.

Move a file.

Parameters

$bucket

bucket name.

$srcFpath

source file path.

$dstFpath

destination file path.

$overwrite

if the destination location is occupied, overwrite it or not?

Returns

array|\qcloudcos\mixed.

uploadFile()

uploadFile(string  $bucket, string  $srcPath, string  $dstPath, string  $bizAttr = null, integer  $insertOnly = null) : \qcloudcos\[type]

内部方法, 上传文件

Parameters

string $bucket

bucket名称

string $srcPath

本地文件路径

string $dstPath

上传的文件路径

string $bizAttr

文件属性

integer $insertOnly

是否覆盖同名文件:0 覆盖,1:不覆盖

Returns

\qcloudcos\[type] —

[description]

uploadBySlicing()

uploadBySlicing(string  $bucket,   $srcFpath,   $dstFpath, string  $bizAttr = null, string  $sliceSize = null, integer  $insertOnly = null) : \qcloudcos\[type]

内部方法,上传文件

Parameters

string $bucket

bucket名称

$srcFpath
$dstFpath
string $bizAttr

文件属性

string $sliceSize

分片大小

integer $insertOnly

是否覆盖同名文件:0 覆盖,1:不覆盖

Returns

\qcloudcos\[type] —

[description]

listBase()

listBase(  $bucket,   $path,   $num = 20,   $pattern = 'eListBoth',   $order,   $context = null) 

Parameters

$bucket
$path
$num
$pattern
$order
$context

updateBase()

updateBase(  $bucket,   $path,   $bizAttr = null,   $authority = null,   $custom_headers_array = null) 

Parameters

$bucket
$path
$bizAttr
$authority
$custom_headers_array

statBase()

statBase(  $bucket,   $path) 

Parameters

$bucket
$path

delBase()

delBase(  $bucket,   $path) 

Parameters

$bucket
$path

cosUrlEncode()

cosUrlEncode(  $path) 

Parameters

$path

generateResUrl()

generateResUrl(  $bucket,   $dstPath) 

Parameters

$bucket
$dstPath

sendRequest()

sendRequest(  $req) 

Parameters

$req

getSliceSize()

getSliceSize(  $sliceSize) 

Get slice size.

Parameters

$sliceSize

normalizerPath()

normalizerPath(  $path,   $isfolder = False) 

Parameters

$path
$isfolder

isAuthorityValid()

isAuthorityValid(string  $authority) : \qcloudcos\[type]

判断authority值是否正确

Parameters

string $authority

Returns

\qcloudcos\[type] —

bool

isPatternValid()

isPatternValid(  $pattern) : \qcloudcos\[type]

判断pattern值是否正确

Parameters

$pattern

Returns

\qcloudcos\[type] —

bool

isCustomer_header()

isCustomer_header(string  $key) : \qcloudcos\[type]

判断是否符合自定义属性

Parameters

string $key

Returns

\qcloudcos\[type] —

bool

add_customer_header()

add_customer_header(array  $data, array  $customer_headers_array) : \qcloudcos\[type]

增加自定义属性到data中

Parameters

array $data
array $customer_headers_array

Returns

\qcloudcos\[type] —

void

isValidPath()

isValidPath(  $path) 

Parameters

$path