Download the PHP package wshafer/psr11-flysystem without Composer
On this page you can find all versions of the php package wshafer/psr11-flysystem. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package psr11-flysystem
PSR-11 FlySystem
FlySystem Version 1 Factories for PSR-11
Deprecated
This library has been depricated and moved. Please see the new module blazon/psr11-flysystem for the latest release.
Table of Contents
- Installation
- Usage
- Containers
- Pimple
- Zend Service Manager
- Frameworks
- Zend Expressive
- Zend Framework 3
- Symfony
- Slim
- Configuration
- Minimal Configuration
- Example
- Full Configuration
- Example
- File System
- Adaptors
- Null / Test
- Local
- FTP
- SFTP
- Memory
- Zip Archive
- Azure
- AWS S3
- DropBox
- Caches
- Memory / Test
- Adaptor
- PSR-6
- Predis
- Memcached
- Stash
- Minimal Configuration
- Upgrades
- Version 1 to version 2
Installation
Usage
Additional info can be found in the documentation
Containers
Any PSR-11 container wil work. In order to do that you will need to add configuration
and register a new service that points to WShafer\PSR11FlySystem\FlySystemFactory
Below are some specific container examples to get you started
Pimple Example
Zend Service Manager
Frameworks
Any framework that use a PSR-11 should work fine. Below are some specific framework examples to get you started
Zend Expressive
You'll need to add configuration and register the services you'd like to use. There are number of ways to do that
but the recommended way is to create a new config file config/autoload/flySystem.global.php
Configuration
config/autoload/flySystem.global.php
Zend Framework 3
You'll need to add configuration and register the services you'd like to use. There are number of ways to do that
but the recommended way is to create a new config file config/autoload/flySystem.global.php
Configuration
config/autoload/flySystem.global.php
Module Config
If you're not using the Zend Component Installer you will also need to register the Module.
config/modules.config.php (ZF 3 skeleton)
config/application.config.php (ZF 2 skeleton)
Symfony
While there are other Symfony bundles out there, as of Symfony 3.3 the service container is now a PSR-11 compatible container. The following config below will get these factories registered and working in Symfony.
Configuration
app/config/config.yml (or equivalent)
Container Service Config
app/config/services.yml
Example Usage
src/AppBundle/Controller/DefaultController.php
Slim
public/index.php
Configuration
Fly System uses three types of services that will each need to be configured for your application.
In addition you will need to create a named service that maps to the \WShafer\PSR11FlySystem\FlySystemFactory
based on the container you are using.
-
Named Services : These are services names wired up to a factory. The configuration will differ based on the type of container / framework in use.
-
Adaptors : These are the adaptors to to the actual file system. This could be an Azure container, S3, Local, Memory, etc.
-
Caches : (Optional) Cache layer to optimize performance. While this is optional, this package will use a memory cache by default if none is provide.
- File System : This will configure the final FlySystem File System that you will actually use to do the work. This uses the previous two configurations to get you a fully functioning File System to work with. In addition you can also configure a Mount Manager to wire up multiple file systems that need to interact with one another.
Minimal Configuration
A minimal configuration would consist of at least defining one service and the "default" adaptor.
Minimal Example (using Zend Expressive for the example)
Using this setup you will be using the "default" file system with the "default" adaptor. In this example we will be using the local file adaptor as the default.
Full Configuration
Note: An "default" adaptor is required.
Full Example
File System
Adaptors
Example configs for supported adaptors
Null/Test
FlySystem Docs: Null Adaptor
Local
FlySystem Docs: Local Adaptor
FTP
FlySystem Docs: FTP
SFTP
Install
Config
FlySystem Docs: SFTP
Memory
Install
Config
FlySystem Docs: Memory
Zip Archive
Install
Config
FlySystem Docs: Zip Archive
Azure
Install
Config
FlySystem Docs: Azure Adaptor
AWS S3
Note: AWS V2 is not supported in this package
Install
Config
FlySystem Docs: Aws S3 Adapter - SDK V3
DropBox
Install
Config
FlySystem Docs: DropBox
Caches
Example configs for supported caches
Memory/Test
FlySystem Docs: Caching
Adaptor
This cache adaptor will use another adaptor to store the cache to file to. It will pull this file system from the existing manager.
FlySystem Docs: Caching
PSR-6
FlySystem Docs: Unknown
Predis
FlySystem Docs: Caching
Memcached
FlySystem Docs: Caching
Stash
See: PSR6
Note: While "The League" provides a native cache client, Stash itself already implements a PSR 6 interface. It is recommended to use that instead.
Upgrades
Version 1 to Version 2
When upgrading from version 1 to version 2, there shouldn't be any changes needed. Please note that using the FlySystemManager directly is no longer recommended. Named services should be used instead. See above for more info.
Changes
-
A "default" filesystem entry is added automatically to the config. This default file system requires you to either specify a configured adaptor for the filesystem OR there must be a default adaptor configured in order to use it. Most Version 1 users should not have an issue with this change and the factories should still function normally.
- The default cache can now be overwritten and reconfigured. Previously a "memory" cache was always used when the file system didn't state the cache to use.