Pushword uses League Flysystem via the flysystem-bundle for media storage. This allows you to store your media files locally (default) or on remote services like Amazon S3, FTP, SFTP, and more.
By default, Pushword stores media files locally in your media_dir (configured in pushword.yaml):
pushword:
media_dir: '%kernel.project_dir%/media'
public_media_dir: media
This works out of the box with no additional configuration.
To use a remote storage backend, you need to:
composer require league/flysystem-aws-s3-v3
config/packages/flysystem.yaml in your project:flysystem:
storages:
pushword.mediaStorage:
adapter: 'aws'
options:
client: 'aws_client_service'
bucket: 'your-bucket-name'
prefix: 'media'
composer require league/flysystem-ftp
config/packages/flysystem.yaml:flysystem:
storages:
pushword.mediaStorage:
adapter: 'ftp'
options:
host: 'ftp.example.com'
username: '%env(FTP_USERNAME)%'
password: '%env(FTP_PASSWORD)%'
root: '/path/to/media'
If you need to customize how Pushword interacts with storage, you can override the MediaStorageAdapter service:
// config/services.php
use Pushword\Core\Service\MediaStorageAdapter;
$services->set(MediaStorageAdapter::class)
->args([
'$storage' => service('pushword.mediaStorage'),
'$mediaDir' => '%pw.media_dir%',
'$isLocal' => false, // Set to false for remote storage
]);
The isLocal parameter is important for performance:
Flysystem supports many storage backends:
| Adapter | Package |
|---|---|
| Local | Built-in |
| Amazon S3 | league/flysystem-aws-s3-v3 |
| FTP | league/flysystem-ftp |
| SFTP | league/flysystem-sftp-v3 |
| Google Cloud | league/flysystem-google-cloud-storage |
| Azure Blob | league/flysystem-azure-blob-storage |
| Memory | league/flysystem-memory |
See the Flysystem documentation for complete configuration options.
public/{public_media_dir}/ for direct browser access