Skip to content

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.

Local Storage Adapter

SettingDescription
NameA name to identify this storage.
RootThe path that will be used as the storage root, e.g. layouts as a site relative path or /layouts as a server absolute.
Write PermissionWether 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.

S/FTP Storage Adapter

SettingDescriptionRequired
NameA name to identify this storage.
HostThe URL to the server hosting the folder.
PortThe port to use for establishing the connection with the server, defualts to 21.
Username/PasswordThe credentials for establishing the connection with the server.
RootThe remote path that will be used as the storage root.
Write PermissionWether the storage will have Write in addition to Read permission.
Passive ModeWether to use Passive Mode for the connection.
SSLWether to use SSL for the connection.
UTF8Wether to use UTF8 as the files content encoding format.
Ignore Passive AddressWether to ignore Passive Address for the connection.

S3 Storage Adapter

The S3 Storage Adapter sets an Amazon S3 Bucket as storage.

S3 Storage Adapter

SettingDescriptionRequired
NameA name to identify this storage.
AccountThe AWS credentials for establishing the connection.
BucketThe name of the Amazon S3 bucket.
RegionThe region where the bucket is hosted.
RootThe path relative to the bucket that will be used as the storage root.
Write PermissionWether the storage will have Write in addition to Read permission.