Installation & Configuration
This chapter describes how to install and configure the bundle.
Most of the information under rekalogika/file-bundle
is applicable only to
Symfony applications. If you are not using Symfony, please refer to the
rekalogika/file
documentation instead.
Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
- With Symfony Flex
- Without Symfony Flex
Open a command console, enter your project directory, and execute:
composer require rekalogika/file-bundle
Step 1: Download the Bundle
Open a command console, enter your project directory, and execute the following command to download the latest stable version of this bundle:
composer require rekalogika/file-bundle
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
return [
// ...
Rekalogika\File\Bundle\RekalogikaFileBundle::class => ['all' => true],
];
Configuration
The bundle should work out of the box without configuration. By default, it will
create a filesystem identified by 'default' that stores files in the directory
%kernel.project_dir%/var/storage/default
.
The following is the default configuration:
rekalogika_file:
filesystems:
# our default filesystem service
default: rekalogika.file.default_filesystem
default_filesystem_directory: '%kernel.project_dir%/var/storage/default'
Integration With Flysystem Bundle
If you are using the Flysystem bundle, you can use the filesystems defined in the Flysystem bundle:
rekalogika_file:
filesystems:
# 'default.storage' is the filesystem key under 'flysystem.storages'
# in config/packages/flysystem.yaml
default: 'default.storage'