Storage Abstraction
File Storage Abstraction allows a seamles experience for working with files across different platforms and locations.
Essentials has several features that involve reading and/or writing data with abstraction, allowing for interaction with many different types of filesystems regardless of their location. To accomplish this, we have implemented FlySystem as the abstraction library of choice which provides a unified interface for working with various filesystems.
Storage Usage
Even storage abstraction is only used by Layouts Addon, at the moment, it is already possible to use in your custom addons.
Local Storage Adapter
The Local Storage Adapter sets a specific folder as a storage location. This folder can either be relative to the site directory, such as layouts
, or absolute from the server root, such as /home/user/layouts
.
The designated folder must already exist and be accessible for reading and writing by the PHP user. Typically, this means that the folder should be located within the user's home directory.
Setting | Description |
---|---|
Name | A name to identify this storage. |
Root | The path that will be used as the storage root, e.g. layouts as a site relative path or /layouts as a server absolute. |
Write Permission | Wether the storage will have Write in addition to Read permission. |
Security Reminder
Folders within the site's root directory are publicly accessible and exposed to those who know the folder path and its contents naming, unless you explicitly deny access to it.
FTP Storage Adapter
The S/FTP Storage Adapter sets a remote server folder as storage through a S/FTP protocol.
Setting | Description | Required |
---|---|---|
Name | A name to identify this storage. | |
Host | The URL to the server hosting the folder. | ✓ |
Port | The port to use for establishing the connection with the server, defualts to 21 . | |
Username/Password | The credentials for establishing the connection with the server. | ✓ |
Root | The remote path that will be used as the storage root. | |
Write Permission | Wether the storage will have Write in addition to Read permission. | |
Passive Mode | Wether to use Passive Mode for the connection. | |
SSL | Wether to use SSL for the connection. | |
UTF8 | Wether to use UTF8 as the files content encoding format. | |
Ignore Passive Address | Wether to ignore Passive Address for the connection. |
S3 Storage Adapter
The S3 Storage Adapter sets an Amazon S3 Bucket as storage.
Setting | Description | Required |
---|---|---|
Name | A name to identify this storage. | |
Account | The AWS credentials for establishing the connection. | ✓ |
Bucket | The name of the Amazon S3 bucket. | ✓ |
Region | The region where the bucket is hosted. | ✓ |
Root | The path relative to the bucket that will be used as the storage root. | |
Write Permission | Wether the storage will have Write in addition to Read permission. |