PHP code example of robgridley / flysystem-smb

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

    

robgridley / flysystem-smb example snippets


use Icewind\SMB\BasicAuth;
use Icewind\SMB\ServerFactory;
use League\Flysystem\Filesystem;
use RobGridley\Flysystem\Smb\SmbAdapter;

$factory = new ServerFactory();
$auth = new BasicAuth('username', 'domain/workgroup', 'password');
$server = $factory->createServer('host', $auth);
$share = $server->getShare('name');

$filesystem = new Filesystem(new SmbAdapter($share));