Properties

$factory

$factory : \Hyperf\Filesystem\FilesystemFactory

Type

\Hyperf\Filesystem\FilesystemFactory

$filesystem

$filesystem : \League\Flysystem\Filesystem

Type

\League\Flysystem\Filesystem

$evDispatcher

$evDispatcher : \Psr\EventDispatcher\EventDispatcherInterface

Type

\Psr\EventDispatcher\EventDispatcherInterface

$container

$container : \Psr\Container\ContainerInterface

Type

\Psr\Container\ContainerInterface

$config

$config : mixed

存储配置信息

Type

mixed

Methods

__construct()

__construct(\Psr\Container\ContainerInterface  $container) 

MineUpload constructor.

Parameters

\Psr\Container\ContainerInterface $container

getFileSystem()

getFileSystem() : \League\Flysystem\Filesystem

获取文件操作处理系统

Returns

\League\Flysystem\Filesystem

upload()

upload(\Hyperf\HttpMessage\Upload\UploadedFile  $uploadedFile, array  $config = array()) : array

上传文件

Parameters

\Hyperf\HttpMessage\Upload\UploadedFile $uploadedFile
array $config

Throws

\League\Flysystem\FileExistsException

Returns

array

handleSaveNetworkImage()

handleSaveNetworkImage(array  $data) : array

保存网络图片

Parameters

array $data

Throws

\Exception

Returns

array

createUploadDir()

createUploadDir(string  $name) : boolean

创建目录

Parameters

string $name

Returns

boolean

listContents()

listContents(string  $path = '') : array

获取目录内容

Parameters

string $path

Returns

array

getDirectory()

getDirectory(string  $path, boolean  $isChildren) : array

获取目录

Parameters

string $path
boolean $isChildren

Returns

array

assembleUrl()

assembleUrl(string  $path, string  $filename) : string

组装url

Parameters

string $path
string $filename

Returns

string

getStorageMode()

getStorageMode() 

获取存储方式

getNewName()

getNewName() : string

获取编码后的文件名

Throws

\Exception

Returns

string

handleUpload()

handleUpload(\Hyperf\HttpMessage\Upload\UploadedFile  $uploadedFile, array  $config) : array

处理上传

Parameters

\Hyperf\HttpMessage\Upload\UploadedFile $uploadedFile
array $config

Throws

\League\Flysystem\FileExistsException
\Exception

Returns

array

getPath()

getPath(  $config) 

Parameters

$config

getMappingMode()

getMappingMode() : integer

Returns

integer

getProtocol()

getProtocol()