Download the PHP package hardphp/thinkphp-filesystem without Composer
On this page you can find all versions of the php package hardphp/thinkphp-filesystem. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download hardphp/thinkphp-filesystem
More information about hardphp/thinkphp-filesystem
Files in hardphp/thinkphp-filesystem
Download hardphp/thinkphp-filesystem
More information about hardphp/thinkphp-filesystem
Files in hardphp/thinkphp-filesystem
Vendor hardphp
Package thinkphp-filesystem
Short Description thinkphp6.0 filesystem,include Local Aliyun Qiniu Qcloud
License MIT
Package thinkphp-filesystem
Short Description thinkphp6.0 filesystem,include Local Aliyun Qiniu Qcloud
License MIT
Please rate this library. Is it a good library?
Informations about the package thinkphp-filesystem
thinkphp-filesystem
thinkphp6.0 filesystem,include Local Aliyun Qiniu Qcloud
安装
composer require hardphp/thinkphp-filesystem
使用实例:
1# .ENV 文件设置默认驱动aliyun
[FILESYSTEM] DRIVER=aliyun
2# filesystem.php 文件配置修改
return [
'default' => Env::get('filesystem.driver', 'local'),
'disks' => [
'local' => [
'type' => 'local',
'root' => app()->getRuntimePath() . 'storage',
],
'public' => [
'type' => 'local',
'root' => app()->getRootPath() . 'public/storage',
'url' => '/storage',
'visibility' => 'public',
],
// 更多的磁盘配置信息
'aliyun' => [
'type' => 'aliyun',
'accessId' => '',
'accessSecret' => '',
'bucket' => '',
'endpoint' => 'oss-cn-beijing.aliyuncs.com',
'url' => '',//不要斜杠结尾,此处为URL地址域名。
]
],
];
3#Thinkphp6中使用示例
$file = request()->file();
if (empty($file) || !isset($file['img']) || empty($file['img'])) {
return json_error('请上传图片');
}
try {
validate(['img' => 'fileSize:10485670|fileExt:jpg,gif,jpeg,png|fileMime:image/jpeg,image/gif,image/png'])
->check($file);
$path = \think\facade\Filesystem::putFile('images', $file['img']);
$path = \think\facade\Filesystem::geturl($path);
return $path;
} catch (\think\exception\ValidateException $e) {
return $e->getMessage();
}
All versions of thinkphp-filesystem with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.1.0
topthink/framework Version ^6.0.0
league/flysystem Version ^1.0.49
aliyuncs/oss-sdk-php Version ^2.3
topthink/framework Version ^6.0.0
league/flysystem Version ^1.0.49
aliyuncs/oss-sdk-php Version ^2.3
The package hardphp/thinkphp-filesystem contains the following files
Loading the files please wait ....