1. Go to this page and download the library: Download stupiddev/flysystem 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/ */
stupiddev / flysystem example snippets
/**
* Minio Connector Class
* User: hocvt
* Date: 11/9/18
* Time: 16:27
*/
namespace App\Colombo\Minio;
use GrahamCampbell\Flysystem\Adapters\AwsS3Connector;
class MinioConnector extends AwsS3Connector {
protected function getAuth( array $config ) {
$auth = parent::getAuth( $config );
if (array_key_exists('use_path_style_endpoint', $config)) {
$auth['use_path_style_endpoint'] = $config['use_path_style_endpoint'];
}
return $auth;
}
}
use GrahamCampbell\Flysystem\Facades\Flysystem;
// you can alias this in config/app.php if you like
Flysystem::put('hi.txt', 'foo');
// we're done here - how easy was that, it just works!
Flysystem::read('hi.txt'); // this will return foo
use GrahamCampbell\Flysystem\Facades\Flysystem;
// note the foo connection does not ship with this package, it's hypothetical
Flysystem::connection('foo')->put('test.txt', 'bar');
// now we can read that file
Flysystem::connection('foo')->read('test.txt'); // this will return bar
use GrahamCampbell\Flysystem\Facades\Flysystem;
// writing this:
Flysystem::connection('local')->read('test.txt');
// is identical to writing this:
Flysystem::read('test.txt');
// and is also identical to writing this:
Flysystem::connection()->read('test.txt');
// this is because the local connection is configured to be the default
Flysystem::getDefaultConnection(); // this will return local
// we can change the default connection
Flysystem::setDefaultConnection('foo'); // the default is now foo
use GrahamCampbell\Flysystem\FlysystemManager;
use Illuminate\Support\Facades\App; // you probably have this aliased already
class Foo
{
protected $flysystem;
public function __construct(FlysystemManager $flysystem)
{
$this->flysystem = $flysystem;
}
public function bar()
{
$this->flysystem->read('test.txt');
}
}
App::make('Foo')->bar();
bash
$ php artisan vendor:publish
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.