PHP code example of vollbehr / php-reader-symfony

1. Go to this page and download the library: Download vollbehr/php-reader-symfony library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vollbehr / php-reader-symfony example snippets


return [
    // ...
    Vollbehr\Bridge\Symfony\PhpReaderBundle::class => ['all' => true],
];

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');
yaml
php_reader:
  default_file_mode: 'rb'