add filesystem

This commit is contained in:
iVampireSP.com 2022-10-29 15:18:20 +08:00
parent 9e7824d402
commit 2d1ac843a6
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
4 changed files with 120 additions and 43 deletions

View File

@ -127,6 +127,10 @@
// broadcast // broadcast
$app->register(App\Providers\BroadcastServiceProvider::class); $app->register(App\Providers\BroadcastServiceProvider::class);
// filesystem
$app->register(Illuminate\Filesystem\FilesystemServiceProvider::class);
$app->register(Freyo\Flysystem\QcloudCOSv5\ServiceProvider::class);
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -19,7 +19,7 @@
"illuminate/redis": "^9.28", "illuminate/redis": "^9.28",
"jenssegers/mongodb": "^3.9", "jenssegers/mongodb": "^3.9",
"laravel/lumen-framework": "^9.0", "laravel/lumen-framework": "^9.0",
"league/flysystem": "^3.2", "league/flysystem": " ~1.0",
"mmghv/lumen-route-binding": "^1.0", "mmghv/lumen-route-binding": "^1.0",
"mongodb/mongodb": "^1.13", "mongodb/mongodb": "^1.13",
"predis/predis": "^2.0", "predis/predis": "^2.0",

87
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "889c1e06b66be846997c922f308c8537", "content-hash": "fd66c4ee8569c7d6da2b461551711a01",
"packages": [ "packages": [
{ {
"name": "adbario/php-dot-notation", "name": "adbario/php-dot-notation",
@ -3807,16 +3807,16 @@
}, },
{ {
"name": "league/flysystem", "name": "league/flysystem",
"version": "3.5.1", "version": "1.1.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/flysystem.git", "url": "https://github.com/thephpleague/flysystem.git",
"reference": "f14993c6e394450ac4649da35264df0544d0234e" "reference": "094defdb4a7001845300334e7c1ee2335925ef99"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f14993c6e394450ac4649da35264df0544d0234e", "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/094defdb4a7001845300334e7c1ee2335925ef99",
"reference": "f14993c6e394450ac4649da35264df0544d0234e", "reference": "094defdb4a7001845300334e7c1ee2335925ef99",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -3826,36 +3826,41 @@
] ]
}, },
"require": { "require": {
"league/mime-type-detection": "^1.0.0", "ext-fileinfo": "*",
"php": "^8.0.2" "league/mime-type-detection": "^1.3",
"php": "^7.2.5 || ^8.0"
}, },
"conflict": { "conflict": {
"aws/aws-sdk-php": "3.209.31 || 3.210.0", "league/flysystem-sftp": "<1.0.6"
"guzzlehttp/guzzle": "<7.0",
"guzzlehttp/ringphp": "<1.1.1",
"phpseclib/phpseclib": "3.0.15",
"symfony/http-client": "<5.2"
}, },
"require-dev": { "require-dev": {
"async-aws/s3": "^1.5", "phpspec/prophecy": "^1.11.1",
"async-aws/simple-s3": "^1.0", "phpunit/phpunit": "^8.5.8"
"aws/aws-sdk-php": "^3.198.1", },
"composer/semver": "^3.0", "suggest": {
"ext-fileinfo": "*", "ext-ftp": "Allows you to use FTP server storage",
"ext-ftp": "*", "ext-openssl": "Allows you to use FTPS server storage",
"ext-zip": "*", "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
"friendsofphp/php-cs-fixer": "^3.5", "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
"google/cloud-storage": "^1.23", "league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
"microsoft/azure-storage-blob": "^1.1", "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
"phpseclib/phpseclib": "^3.0.14", "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
"phpstan/phpstan": "^0.12.26", "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
"phpunit/phpunit": "^9.5.11", "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
"sabre/dav": "^4.3.1" "league/flysystem-webdav": "Allows you to use WebDAV storage",
"league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
"spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
"srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"League\\Flysystem\\": "src" "League\\Flysystem\\": "src/"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -3865,42 +3870,40 @@
"authors": [ "authors": [
{ {
"name": "Frank de Jonge", "name": "Frank de Jonge",
"email": "info@frankdejonge.nl" "email": "info@frenky.net"
} }
], ],
"description": "File storage abstraction for PHP", "description": "Filesystem abstraction: Many filesystems, one API.",
"keywords": [ "keywords": [
"Cloud Files",
"WebDAV", "WebDAV",
"abstraction",
"aws", "aws",
"cloud", "cloud",
"file", "copy.com",
"dropbox",
"file systems",
"files", "files",
"filesystem", "filesystem",
"filesystems", "filesystems",
"ftp", "ftp",
"rackspace",
"remote",
"s3", "s3",
"sftp", "sftp",
"storage" "storage"
], ],
"support": { "support": {
"issues": "https://github.com/thephpleague/flysystem/issues", "issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/3.5.1" "source": "https://github.com/thephpleague/flysystem/tree/1.1.9"
}, },
"funding": [ "funding": [
{ {
"url": "https://ecologi.com/frankdejonge", "url": "https://offset.earth/frankdejonge",
"type": "custom" "type": "other"
},
{
"url": "https://github.com/frankdejonge",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/league/flysystem",
"type": "tidelift"
} }
], ],
"time": "2022-09-18T18:23:19+00:00" "time": "2021-12-09T09:40:50+00:00"
}, },
{ {
"name": "league/mime-type-detection", "name": "league/mime-type-detection",

70
config/filesystems.php Normal file
View File

@ -0,0 +1,70 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],
],
];