PHP Class zgldh\QiniuStorage\QiniuAdapter

Inheritance: extends League\Flysystem\Adapter\AbstractAdapter, use trait League\Flysystem\Adapter\Polyfill\NotSupportingVisibilityTrait, use trait League\Flysystem\Adapter\Polyfill\StreamedWritingTrait, use trait League\Flysystem\Adapter\Polyfill\StreamedReadingTrait
Exibir arquivo Open project: zgldh/qiniu-laravel-storage

Public Methods

Method Description
__construct ( $access_key, $secret_key, $bucket, $domains, $notify_url = null )
calculateQetag ( $localFilePath ) : array
copy ( string $path, string $newpath ) : boolean Copy a file.
createDir ( string $dirname, League\Flysystem\Config $config ) : array | false Create a directory.
delete ( string $path ) : boolean Delete a file.
deleteDir ( string $dirname ) : boolean Delete a directory.
downloadUrl ( null $path = null, string $domainType = 'default' ) : string | QiniuUrl
fetch ( string $url, string $key = null ) : boolean Fetch a file.
getLastQetag ( ) : null
getMetadata ( string $path ) : array | false Get all the meta data of a file or directory.
getMimetype ( string $path ) : array | false Get the mimetype of a file.
getSize ( string $path ) : array | false Get all the meta data of a file or directory.
getTimestamp ( string $path ) : array | false Get the timestamp of a file.
has ( string $path ) : array | boolean | null Check whether a file exists.
imageExif ( null $path = null ) : boolean
imageInfo ( null $path = null ) : boolean
imagePreviewUrl ( null $path = null, null $ops = null ) : string | QiniuUrl
listContents ( string $directory = '', boolean $recursive = false ) : array List contents of a directory.
persistentFop ( null $path = null, null $fops = null, null $pipline = null, boolean $force = false ) : boolean
persistentStatus ( $id ) : array
privateDownloadUrl ( $path, string | array $settings = 'default' ) : string
privateImagePreviewUrl ( null $path = null, null $ops = null ) : string | QiniuUrl
read ( string $path ) : array | false Read a file.
rename ( string $path, string $newpath ) : boolean Rename a file.
setDomainPrefix ( string $prefix, $domainType ) : self Set the path prefix.
update ( string $path, string $contents, League\Flysystem\Config $config ) : array | false Update a file.
updateStream ( string $path, resource $resource, League\Flysystem\Config $config ) : mixed Update a file using a stream.
uploadToken ( null $path = null, integer $expires = 3600, null $policy = null, boolean $strictPolicy = true ) : string
verifyCallback ( $contentType, $originAuthorization, $url, $body ) : boolean
write ( string $path, string $contents, League\Flysystem\Config $config ) : array | false Write a new file.
writeStream ( string $path, resource $resource, League\Flysystem\Config $config ) : mixed Write using a stream.

Private Methods

Method Description
getAuth ( )
getBucketManager ( )
getOperation ( )
getUploadManager ( )
logQiniuError ( Qiniu\Http\Error $error, $extra = null )
qiniuPutFile ( $upToken, $key, $fileResource, null $params = null, string $mime = 'application/octet-stream', boolean $checkCrc = false ) : mixed Rewrite Qiniu\Storage\UploadManager::putFile

Method Details

__construct() public method

public __construct ( $access_key, $secret_key, $bucket, $domains, $notify_url = null )

calculateQetag() public method

public calculateQetag ( $localFilePath ) : array
$localFilePath
return array

copy() public method

Copy a file.
public copy ( string $path, string $newpath ) : boolean
$path string
$newpath string
return boolean

createDir() public method

Create a directory.
public createDir ( string $dirname, League\Flysystem\Config $config ) : array | false
$dirname string directory name
$config League\Flysystem\Config
return array | false

delete() public method

Delete a file.
public delete ( string $path ) : boolean
$path string
return boolean

deleteDir() public method

Delete a directory.
public deleteDir ( string $dirname ) : boolean
$dirname string
return boolean

downloadUrl() public method

public downloadUrl ( null $path = null, string $domainType = 'default' ) : string | QiniuUrl
$path null
$domainType string
return string | QiniuUrl

fetch() public method

Fetch a file.
public fetch ( string $url, string $key = null ) : boolean
$url string
$key string
return boolean

getLastQetag() public method

public getLastQetag ( ) : null
return null

getMetadata() public method

Get all the meta data of a file or directory.
public getMetadata ( string $path ) : array | false
$path string
return array | false

getMimetype() public method

Get the mimetype of a file.
public getMimetype ( string $path ) : array | false
$path string
return array | false

getSize() public method

Get all the meta data of a file or directory.
public getSize ( string $path ) : array | false
$path string
return array | false

getTimestamp() public method

Get the timestamp of a file.
public getTimestamp ( string $path ) : array | false
$path string
return array | false

has() public method

Check whether a file exists.
public has ( string $path ) : array | boolean | null
$path string
return array | boolean | null

imageExif() public method

public imageExif ( null $path = null ) : boolean
$path null
return boolean

imageInfo() public method

public imageInfo ( null $path = null ) : boolean
$path null
return boolean

imagePreviewUrl() public method

public imagePreviewUrl ( null $path = null, null $ops = null ) : string | QiniuUrl
$path null
$ops null
return string | QiniuUrl

listContents() public method

List contents of a directory.
public listContents ( string $directory = '', boolean $recursive = false ) : array
$directory string
$recursive boolean
return array

persistentFop() public method

public persistentFop ( null $path = null, null $fops = null, null $pipline = null, boolean $force = false ) : boolean
$path null
$fops null
$pipline null
$force boolean
return boolean

persistentStatus() public method

public persistentStatus ( $id ) : array
$id
return array

privateDownloadUrl() public method

public privateDownloadUrl ( $path, string | array $settings = 'default' ) : string
$path
$settings string | array ['domain'=>'default', 'expires'=>3600]
return string

privateImagePreviewUrl() public method

public privateImagePreviewUrl ( null $path = null, null $ops = null ) : string | QiniuUrl
$path null
$ops null
return string | QiniuUrl

read() public method

Read a file.
public read ( string $path ) : array | false
$path string
return array | false

rename() public method

Rename a file.
public rename ( string $path, string $newpath ) : boolean
$path string
$newpath string
return boolean

setDomainPrefix() public method

Set the path prefix.
public setDomainPrefix ( string $prefix, $domainType ) : self
$prefix string
return self

update() public method

Update a file.
public update ( string $path, string $contents, League\Flysystem\Config $config ) : array | false
$path string
$contents string
$config League\Flysystem\Config Config object
return array | false false on failure file meta data on success

updateStream() public method

Update a file using a stream.
public updateStream ( string $path, resource $resource, League\Flysystem\Config $config ) : mixed
$path string
$resource resource
$config League\Flysystem\Config Config object or visibility setting
return mixed false of file metadata

uploadToken() public method

public uploadToken ( null $path = null, integer $expires = 3600, null $policy = null, boolean $strictPolicy = true ) : string
$path null
$expires integer
$policy null
$strictPolicy boolean
return string

verifyCallback() public method

public verifyCallback ( $contentType, $originAuthorization, $url, $body ) : boolean
$contentType
$originAuthorization
$url
$body
return boolean

write() public method

Write a new file.
public write ( string $path, string $contents, League\Flysystem\Config $config ) : array | false
$path string
$contents string
$config League\Flysystem\Config Config object
return array | false false on failure file meta data on success

writeStream() public method

Write using a stream.
public writeStream ( string $path, resource $resource, League\Flysystem\Config $config ) : mixed
$path string
$resource resource
$config League\Flysystem\Config
return mixed false or file metadata