danhunsaker / laravel-flysystem-others
Automatically registers every third-party Flysystem adapter it recognizes as a Laravel Filesystem Driver.
Fund package maintenance!
danhunsaker
Patreon
Ko Fi
Liberapay
paypal.me/hunsakerdan
Installs: 31 565
Dependents: 0
Suggesters: 0
Security: 0
Stars: 22
Watchers: 3
Forks: 14
Open Issues: 0
Requires
- danhunsaker/laravel-flysystem-service: ^1.4
- illuminate/filesystem: >= 5.0
- illuminate/support: >= 5.0
- league/flysystem: ^1.0
Requires (Dev)
- phpunit/phpunit: ^8.5
Suggests
- aliyuncs/aliyun-oss-flysystem: One of the options to use the 'oss' adapter (^1.2)
- aobozhang/aliyun-oss-adapter: One of the options to use the 'oss' adapter (^1.0)
- apollopy/flysystem-aliyun-oss: One of the options to use the 'oss' adapter (^1.2)
- argentcrusade/flysystem-selectel: Required to use the 'selectel' adapter (^1.2)
- arhitector/yandex-disk-flysystem: Required to use the 'yandex' adapter (^1.0)
- boofw/flysystem-qiniu: One of the options to use the 'qiniu' adapter (^1.0)
- carlosocarvalho/flysystem-cloudinary: One of the options to use the 'cloudinary' adapter (^1.0)
- cedricziel/flysystem-gcs: One of the options to use the 'google' adapter (^2.0)
- danhunsaker/flysystem-redis: Required to use the 'redis' adapter (^1.0)
- emgag/flysystem-tempdir: Required to use the 'temp' adapter (^0.1)
- engineor/flysystem-runabove: Required to use the 'runabove' adapter (^1.0)
- enl/flysystem-cloudinary: One of the options to use the 'cloudinary' adapter (^1.1)
- eqingdan/flysystem-qiniu: One of the options to use the 'qiniu' adapter (^0.1)
- freyo/flysystem-qcloud-cos-v3: One of the options to use the 'qcloud' adapter (^)
- freyo/flysystem-qcloud-cos-v4: One of the options to use the 'qcloud' adapter (^)
- freyo/flysystem-qcloud-cos-v5: One of the options to use the 'qcloud' adapter (^)
- ignited/flysystem-google-drive: One of the options to use the 'gdrive' adapter (dev-master)
- ignited/flysystem-onedrive: One of the options to use the 'onedrive' adapter (dev-master)
- integral/flysystem-pdo-adapter: One of the options to use the 'pdo' adapter (^1.0)
- jacekbarecki/flysystem-onedrive: One of the options to use the 'onedrive' adapter (^1.0)
- jellybool/flysystem-upyun: Required to use the 'upyun' adapter (^1.0)
- kapersoft/flysystem-sharefile: Required to use the 'sharefile' adapter (^1.1)
- litipk/flysystem-fallback-adapter: Required to use the 'fallback' adapter, and with league/flysystem-replicate-adapter, the 'mirror' adapter (^0.1)
- mgriego/flysystem-clamav: Scans files for viruses before storing them on an actual filesystem (^1.0)
- mhetreramesh/flysystem-backblaze: Required to use the 'backblaze' adapter (^1.1)
- monster/flysystem-aliyun-oss: One of the options to use the 'oss' adapter, but not recommended, since it uses the League namespace without being a Leage package (^1.0)
- nao-pon/flysystem-google-drive: One of the options to use the 'gdrive' adapter (^1.1)
- nicolasbeauvais/flysystem-onedrive: One of the options to use the 'onedrive' adapter (^1.0)
- nimbusoft/flysystem-openstack-swift: Required to use the 'openstack' adapter (^0.2)
- orzcc/aliyun-oss: One of the options to use the 'oss' adapter (dev-master)
- overtrue/flysystem-qiniu: One of the options to use the 'qiniu' adapter (^1.0)
- phlib/flysystem-pdo: One of the options to use the 'pdo' adapter (^1.1)
- potherca/flysystem-github: Required to use the 'github' adapter (^0.2)
- private-it/flysystem-google-drive: One of the options to use the 'gdrive' adapter (dev-master)
- robgridley/flysystem-smb: Required to use the 'smb' adapter (dev-master)
- rokde/flysystem-local-database-adapter: Required to use the 'eloquent' adapter (^0.0)
- shion/aliyun-oss: One of the options to use the 'oss' adapter (dev-master)
- spatie/flysystem-dropbox: Required to use the 'dropbox' adapter in PHP 7 (^1.0)
- srmklive/flysystem-dropbox-v2: Required to use the 'dropbox' adapter in PHP 5 (^1.0)
- superbalist/flysystem-google-storage: One of the options to use the 'google' adapter (^7.0)
- t3chnik/flysystem-cloudinary-adapter: One of the options to use the 'cloudinary' adapter (dev-master)
- twistor/flysystem-guzzle: One of the options to use the (read-only) 'http' adapter (^6.0)
- twistor/flysystem-http: One of the options to use the (read-only) 'http' adapter (^0.2)
- twistor/flysystem-stream-wrapper: Allows access to Flysystem drives using 'drive://path' streams (^1.0)
- xxtime/flysystem-aliyun-oss: One of the options to use the 'oss' adapter (^1.2)
- zhuxiaoqiao/flysystem-baidu-bos: Required to use the 'bos' adapter (^1.0)
README
Registers recognized third-party Flysystem adapters with Laravel automatically.
This lets you use third-party adapters without having to write your own service providers to load them properly. It automatically detects which adapters are available, and registers only the ones actually installed. It also detects whether the Eventable version of Flysystem is available, and if so, it switches to it, letting you listen in on Flysystem events and affect them accordingly.
NOTE: While this package only recognizes adapters NOT officially supported by The PHP League, it does depend on danhunsaker/laravel-flysystem-service, so installing this package will let you use them as well.
Installation
The usual methods for using Composer apply here:
composer require danhunsaker/laravel-flysystem-others
This package uses Laravel's auto-discovery feature for the service provider, but
if you're using a Laravel version before 5.5, you do still have to register one
service – but only one, and at least you don't have to write it. Be sure to
REPLACE the Illuminate\Filesystem\FilesystemServiceProvider::class
line
with the new one:
// In config/app.php 'providers' => [ // ... Danhunsaker\Laravel\Flysystem\FlysystemOtherServiceProvider::class, // ... ],
And since FlysystemOtherServiceProvider
extends FlysystemServiceProvider
from danhunsaker/laravel-flysystem-service
, you don't need to add it as well.
In fact, doing so will probably cause some issues with your app, as both
providers will attempt to handle the PHP League drivers at the same time.
Of course, you'll want to read through its README
as well, to see what options
it supports that this package piggy-backs on, such as those for the cache
decorator.
Setup
For added flexibility, such as the ability to open ZIP files on remote storage,
you can also install twistor/flysystem-stream-wrapper, which will register
each of the drives in your config/filesystems.php
file as a stream protocol
(though only when each is accessed the first time, unless you add them to the
autowrap
parameter in the configuration). In the example of accessing remote
ZIP files, you would then simply need to prefix the ZIP file's path with the
name of the drive it's available on, as a URL scheme (something like
dropbox://path/to/file.zip
).
Finally, as with danhunsaker/laravel-flysystem-service
, you can get example
definitions for all supported filesystem drivers by publishing the replacement
filesystems
config - just run the following Artisan command:
php artisan vendor:publish --provider=Danhunsaker\\Laravel\\Flysystem\\FlysystemOtherServiceProvider --force
The --force
flag is required to overwrite the existing filesystems
config
that ships with Laravel. You can also rename the existing file, then run the
command without the --force
flag, if you'd like to preserve the existing
contents for transfer to the new file.
Supported Adapters
The best place to check for which adapters are supported by this package is the Composer suggestions, but here's a quick (not-guaranteed-up-to-date) list as well:
-
Aliyun OSS: aliyuncs/aliyun-oss-flysystem, aobozhang/aliyun-oss-adapter, apollopy/flysystem-aliyun-oss, orzcc/aliyun-oss, shion/aliyun-oss, xxtime/flysystem-aliyun-oss, monster/flysystem-aliyun-oss (only used if no other
oss
adapter is available, because it uses theLeague
namespace, but isn't a PHP League package), -
Backblaze B2: mhetreramesh/flysystem-backblaze
-
Baidu Bos: zhuxiaoqiao/flysystem-baidu-bos
-
Citrix ShareFile: kapersoft/flysystem-sharefile
-
ClamAV (Virus Scanning): mgriego/flysystem-clamav
-
Cloudinary: carlosocarvalho/flysystem-cloudinary, enl/flysystem-cloudinary, t3chnik/flysystem-cloudinary-adapter
-
Eloquent: rokde/flysystem-local-database-adapter
-
Fallback: litipk/flysystem-fallback-adapter
-
GitHub: potherca/flysystem-github
-
Google Cloud Storage: cedricziel/flysystem-gcs, superbalist/flysystem-google-storage
-
Google Drive: ignited/flysystem-google-drive, nao-pon/flysystem-google-drive, private-it/flysystem-google-drive (has precendence over
nao-pon
) -
HTTP (Read-Only): twistor/flysystem-guzzle, twistor/flysystem-http
-
Mirror: A "meta-adapter" which combines the Fallback and Replicate adapters, if both are available.
-
OneDrive: ignited/flysystem-onedrive, jacekbarecki/flysystem-onedrive, nicolasbeauvais/flysystem-onedrive
-
OpenStack Swift: nimbusoft/flysystem-openstack-swift
-
Qcloud COS: freyo/flysystem-qcloud-cos-v5, freyo/flysystem-qcloud-cos-v4, freyo/flysystem-qcloud-cos-v3 (precendence for this adapter is determined by API version, rather than alphabetical sort)
-
Qiniu: boofw/flysystem-qiniu, eqingdan/flysystem-qiniu, overtrue/flysystem-qiniu
-
Redis: danhunsaker/flysystem-redis
-
Runabove: engineor/flysystem-runabove
-
Selectel: argentcrusade/flysystem-selectel
-
SMB/CIFS: robgridley/flysystem-smb
-
Temp: emgag/flysystem-tempdir
-
Upyun: jellybool/flysystem-upyun
-
Yandex: arhitector/yandex-disk-flysystem
NOTE: If you install more than one of the adapters listed above for the same storage service, only the first one – in alphabetical order by namespace – will be used, unless otherwise noted above.
Contributions
Pull requests, bug reports, and so forth are all welcome on GitHub.
Security issues should be reported directly to danhunsaker (plus) laraflyplus (at) gmail (dot) com.
And head to GitHub for everything else.