1. Go to this page and download the library: Download phlib/flysystem-pdo 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/ */
phlib / flysystem-pdo example snippets
use Phlib\Flysystem\Pdo\PdoAdapter;
use League\Flysystem\Filesystem;
$pdo = new \PDO('mysql:host=hostname;dbname=database_name', 'username', 'password');
$adapter = new PdoAdapter($pdo);
$filesystem = new Filesystem($adapter);
use League\Flysystem\Config;
$config = new Config([
'enable_compression' => false,
'visibility' => AdapterInterface::VISIBILITY_PUBLIC
]);
$adapter->writeStream('/path/to/file.zip', $handle, $config);
use League\Flysystem\Config;
$config = new Config([
'table_prefix' => 'flysystem',
'enable_compression' => true,
'chunk_size' => 1048576,
'temp_dir' => '/var/tmp',
'disable_mysql_buffering' => true
]);
$adapter = new PdoAdapter($pdo, $config);