diff --git a/bootstrap/app.php b/bootstrap/app.php index af81b10..f00857d 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -127,6 +127,10 @@ // broadcast $app->register(App\Providers\BroadcastServiceProvider::class); +// filesystem +$app->register(Illuminate\Filesystem\FilesystemServiceProvider::class); +$app->register(Freyo\Flysystem\QcloudCOSv5\ServiceProvider::class); + /* |-------------------------------------------------------------------------- diff --git a/composer.json b/composer.json index 1cbf589..e909999 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "illuminate/redis": "^9.28", "jenssegers/mongodb": "^3.9", "laravel/lumen-framework": "^9.0", - "league/flysystem": "^3.2", + "league/flysystem": " ~1.0", "mmghv/lumen-route-binding": "^1.0", "mongodb/mongodb": "^1.13", "predis/predis": "^2.0", diff --git a/composer.lock b/composer.lock index a97212c..b58e9f4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "889c1e06b66be846997c922f308c8537", + "content-hash": "fd66c4ee8569c7d6da2b461551711a01", "packages": [ { "name": "adbario/php-dot-notation", @@ -3807,16 +3807,16 @@ }, { "name": "league/flysystem", - "version": "3.5.1", + "version": "1.1.9", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "f14993c6e394450ac4649da35264df0544d0234e" + "reference": "094defdb4a7001845300334e7c1ee2335925ef99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f14993c6e394450ac4649da35264df0544d0234e", - "reference": "f14993c6e394450ac4649da35264df0544d0234e", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/094defdb4a7001845300334e7c1ee2335925ef99", + "reference": "094defdb4a7001845300334e7c1ee2335925ef99", "shasum": "", "mirrors": [ { @@ -3826,36 +3826,41 @@ ] }, "require": { - "league/mime-type-detection": "^1.0.0", - "php": "^8.0.2" + "ext-fileinfo": "*", + "league/mime-type-detection": "^1.3", + "php": "^7.2.5 || ^8.0" }, "conflict": { - "aws/aws-sdk-php": "3.209.31 || 3.210.0", - "guzzlehttp/guzzle": "<7.0", - "guzzlehttp/ringphp": "<1.1.1", - "phpseclib/phpseclib": "3.0.15", - "symfony/http-client": "<5.2" + "league/flysystem-sftp": "<1.0.6" }, "require-dev": { - "async-aws/s3": "^1.5", - "async-aws/simple-s3": "^1.0", - "aws/aws-sdk-php": "^3.198.1", - "composer/semver": "^3.0", - "ext-fileinfo": "*", - "ext-ftp": "*", - "ext-zip": "*", - "friendsofphp/php-cs-fixer": "^3.5", - "google/cloud-storage": "^1.23", - "microsoft/azure-storage-blob": "^1.1", - "phpseclib/phpseclib": "^3.0.14", - "phpstan/phpstan": "^0.12.26", - "phpunit/phpunit": "^9.5.11", - "sabre/dav": "^4.3.1" + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" + }, + "suggest": { + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "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", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, "autoload": { "psr-4": { - "League\\Flysystem\\": "src" + "League\\Flysystem\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3865,42 +3870,40 @@ "authors": [ { "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": [ + "Cloud Files", "WebDAV", + "abstraction", "aws", "cloud", - "file", + "copy.com", + "dropbox", + "file systems", "files", "filesystem", "filesystems", "ftp", + "rackspace", + "remote", "s3", "sftp", "storage" ], "support": { "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": [ { - "url": "https://ecologi.com/frankdejonge", - "type": "custom" - }, - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" + "url": "https://offset.earth/frankdejonge", + "type": "other" } ], - "time": "2022-09-18T18:23:19+00:00" + "time": "2021-12-09T09:40:50+00:00" }, { "name": "league/mime-type-detection", diff --git a/config/filesystems.php b/config/filesystems.php new file mode 100644 index 0000000..f062345 --- /dev/null +++ b/config/filesystems.php @@ -0,0 +1,70 @@ + 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'), + ], + + ], + +];