The OneupFlysystemBundle was developed and tested for Symfony version 4.4+.
Perform the following steps to install and use the basic functionality of the OneupFlysystemBundle:
- Download OneupFlysystemBundle using Composer
- Enable the bundle
- Configure your filesystems
Download the bundle via composer:
$> php composer.phar require oneup/flysystem-bundle
Composer will now fetch and install this bundle in the vendor directory vendor/oneup
Note: There are some additional dependencies you will need to install for some features:
- The AwsS3v3 adapter requires
"league/flysystem-aws-s3-v3"
- The FTP adapter requires
"league/flysystem-ftp"
- The SFTP (V3) adapter requires
"league/flysystem-sftp-v3"
- The Google Cloud Storage adapter requires
"league/flysystem-google-cloud-storage"
- The InMemory adapter requires
"league/flysystem-memory"
- The AsyncAwsS3 adapter requires
"league/flysystem-async-aws-s3"
- The Gitlab adapter requires
"royvoetman/flysystem-gitlab-storage"
- The Azure Blob Storage adapter requires
"league/flysystem-azure-blob-storage"
Enable the bundle in the kernel:
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Oneup\FlysystemBundle\OneupFlysystemBundle(),
);
}
In order to create a filesystem, you first need to create an adapter. An easy example is to define a local adapter and afterwards create a filesystem based on it.
# app/config/config.yml
oneup_flysystem:
adapters:
my_adapter:
local:
location: "%kernel.root_dir%/cache"
filesystems:
my_filesystem:
adapter: my_adapter
# optional - defines the default visibility of files: `public` or `private` (default)
visibility: private
# optional - defines the default visibility of directories: `public` or `private` (default)
directory_visibility: private
There are a bunch of adapters for you to use:
- GoogleCloudStorage
- AsyncAwsS3
- AwsS3
- Ftp
- Local filesystem
- InMemoryAdapter
- Sftp
- Gitlab
- AzureBlobStorage
- Custom
After installing and setting up the basic functionality of this bundle you can move on and integrate some more advanced features.