vollbehr / php-reader-symfony
Symfony bundle for vollbehr/php-reader.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Type:symfony-bundle
Requires
- php: ^8.2
- symfony/config: ^6.4|^7.0
- symfony/dependency-injection: ^6.4|^7.0
- symfony/http-kernel: ^6.4|^7.0
- vollbehr/php-reader: ^1.9
README
This bundle wires the vollbehr/php-reader
file reader factory into the Symfony service container, giving you framework-native configuration and autoconfiguration support.
Installation
composer require vollbehr/php-reader-symfony-bundle
If you're using Symfony Flex the bundle will be enabled automatically. Otherwise, register it in your config/bundles.php
:
return [ // ... Vollbehr\Bridge\Symfony\PhpReaderBundle::class => ['all' => true], ];
Configuration
Override the default configuration by creating config/packages/php_reader.yaml
:
php_reader: default_file_mode: 'rb'
You can access the factory directly from the container; this snippet mirrors the automated test harness:
use Symfony\Component\DependencyInjection\ContainerBuilder; use Vollbehr\Support\FileReaderFactory; $container = new ContainerBuilder(); $container->loadFromExtension('php_reader', ['default_file_mode' => 'rb']); $container->compile(); /** @var FileReaderFactory $factory */ $factory = $container->get(FileReaderFactory::class); $reader = $factory->open('/path/to/audio.mp3');
Versioning
Tag bundle releases in lockstep with vollbehr/php-reader
so consumers can rely on compatible APIs across the ecosystem.