PHP code example of tiamo / yii2-filesystem

1. Go to this page and download the library: Download tiamo/yii2-filesystem 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/ */

    

tiamo / yii2-filesystem example snippets


	'fs' => [
		'class' => 'tiamo\yii2-filesystem\Filesystem',
		'formats' => [
			'/w([0-9]+)h([0-9]+)/is' => function($w, $h, $path, $file){
				if ($file->isImage) {
					$class = '\yii\imagine\Image';
					$class::$driver = [$class::DRIVER_GD2];
					$thumbnail = $class::thumbnail($path, $w, $h);
					return $thumbnail->get($file->extension);
				}
			},
		],
		'storage' => [
			's1' => [
				'baseUrl' => 'http://s1.site.com',
				'adapter' => 'ftp',
				'host' => '127.0.0.1',
				'root' => 'files'
			],
		],
	],


php composer.phar