wgg / flysystem-doctrine
Flysystem adapter for Doctrine DBAL
1.0.1
2022-07-01 09:37 UTC
Requires
- php: ^8.0
- doctrine/dbal: ^3.0.0
- league/flysystem: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.6
- league/flysystem-adapter-test-utilities: ^3.0
- phpstan/phpstan: ^1.4
- phpstan/phpstan-phpunit: ^1.1
- phpunit/phpunit: ~9.5
- symfony/var-dumper: ^5.4|^6.1
This package is auto-updated.
Last update: 2024-11-12 09:31:30 UTC
README
This is a Flysystem adapter for Doctrine DBAL.
Installation
composer require wgg/flysystem-doctrine
Bootstrap
<?php use Doctrine\DBAL\DriverManager; use League\Flysystem\Filesystem; use WGG\Flysystem\Doctrine\DoctrineDBALAdapter; $connectionParams = [ 'url' => 'mysql://user:secret@localhost/mydb', ]; $connection = DriverManager::getConnection($connectionParams); $adapter = new DoctrineDBALAdapter($connection, 'flysystem_files'); $filesystem = new Filesystem($adapter);
Database
At the beginning you have to create a table that will be used to store files.
SQL table schema can be found in the schema
folder