PHP code example of joschaefer / flysystem-sciebo

1. Go to this page and download the library: Download joschaefer/flysystem-sciebo 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/ */

    

joschaefer / flysystem-sciebo example snippets




use Joschaefer\Flysystem\Sciebo\ScieboAdapter;
use Joschaefer\Flysystem\Sciebo\ScieboClient;
use League\Flysystem\Filesystem;

);
$filesystem = new Filesystem($adapter);



namespace App\Providers;

use Illuminate\Support\Facades\Storage;
use Illuminate\Support\ServiceProvider;
use Joschaefer\Flysystem\Sciebo\ScieboAdapter;
use Joschaefer\Flysystem\Sciebo\ScieboClient;
use League\Flysystem\Filesystem;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        // ...
        
        Storage::extend('sciebo', function ($app, $config) {
            $adapter = new ScieboAdapter(
                new ScieboClient($config['node'], $config['username'], $config['password']),
                $config['prefix']
            );

            return new FilesystemAdapter(
                new Filesystem($adapter, $config),
                $adapter,
                $config
            );
        });
    }
}



return [

    // ...

    'disks' => [

        // ...

        'sciebo' => [
            'driver' => 'sciebo',
            'node' => env('SCIEBO_NODE', ''),
            'username' => env('SCIEBO_USERNAME', ''),
            'password' => env('SCIEBO_PASSWORD', ''),
            'prefix' => env('SCIEBO_PREFIX'),
        ],

    ],

    // ...

];