PHP code example of vollbehr / php-reader-laminas

1. Go to this page and download the library: Download vollbehr/php-reader-laminas 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-laminas example snippets


return [
    'modules' => [
        // ...
        \Vollbehr\Bridge\Laminas\Module::class,
    ],
];

return [
    'php-reader' => [
        'default_file_mode' => 'rb',
    ],
];

use Laminas\ServiceManager\ServiceManager;
use Vollbehr\Bridge\Laminas\ConfigProvider;
use Vollbehr\Support\FileReaderFactory;

$config = (new ConfigProvider())();
$config['php-reader']['default_file_mode'] = 'rb';

$container = new ServiceManager($config['service_manager']);
$container->setService('config', $config);

/** @var FileReaderFactory $factory */
$factory = $container->get(FileReaderFactory::class);
$reader  = $factory->open('/path/to/audio.mp3');