PHP code example of laasti / flysystem-provider
1. Go to this page and download the library: Download laasti/flysystem-provider 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/ */
laasti / flysystem-provider example snippets
$container = new League\Container\Container;
$container->addServiceProvider('Laasti\FlysystemProvider\FlysystemProvider');
//The first defined adapter is used as the default for League\Flysystem\FilesystemInterface
$container->add('config.flysystem', [
//the first item in array is the adapter class, the second is the adapter's constructor parameters
'upload' => ['League\Flysystem\Adapter\Local', ['your-uploads-directory']],
'temp' => ['League\Flysystem\Adapter\Local', ['your-temp-directory']],
//see League/Flysystem's documentation for more adapters
]);
$manager = $container->get('League\Flysystem\MountManager');
$manager->read('upload://path-to-file.txt);
//or get the default filesystem
$filesystem = $container->get('League\Flysystem\FilesystemInterface');
//or get a filesystem by its name from the container
$tempFiles = $container->get('flysystem.filesystem.temp');
//or an adapter
$tempAdapter = $container->get('flysystem.adapter.temp');