PHP code example of phuxtil / flysystem-ssh-shell

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

    

phuxtil / flysystem-ssh-shell example snippets


$configurator = (new \Phuxtil\Flysystem\SshShell\SshShellConfigurator())
    ->setRoot('/remote_server/path')
    ->setUser('remote_user')
    ->setHost('remote-ssh-host')
    ->setPrivateKey('path/to/id_rsa.private_key')
    ->setPort(22);

$configurator = (new \Phuxtil\Flysystem\SshShell\SshShellConfigurator())
    ->setUser('user')
    ->setHost('host');

$configurator = (new \Phuxtil\Flysystem\SshShell\SshShellConfigurator())
    ->setUser('user')
    ->setHost('host')
    ->setPrivateKey('path/to/id_rsa.private_key');
 php


use League\Flysystem\Filesystem;
use Phuxtil\Flysystem\SshShell\SshShellConfigurator;
use Phuxtil\Flysystem\SshShell\SshShellFactory;

\error_reporting(\E_ALL);

r($configurator);

$filesystem = new Filesystem($adapter);