rene-roscher/flysystem-sftp

Flysystem adapter for SFTP | Laravel 8.X

2.1 2023-06-04 13:11 UTC

README

Author Build Status Coverage Status Quality Score Software License Packagist Version Total Downloads Documentation

This adapter uses phpseclib to provide a SFTP adapter for Flysystem.

Installation

composer require rene-roscher/flysystem-sftp

Documentation

Full documentation of this adapter can be found here: https://flysystem.thephpleague.com/adapter/sftp/

Usage

use League\Flysystem\Sftp\SftpAdapter;
use League\Flysystem\Filesystem;

$adapter = new SftpAdapter([
    'host' => 'example.com',
    'port' => 22,
    'username' => 'username',
    'password' => 'password',
    'privateKey' => 'path/to/or/contents/of/privatekey',
    'passphrase' => 'passphrase-for-privateKey',
    'root' => '/path/to/root',
    'timeout' => 10,
    'directoryPerm' => 0755
]);

$filesystem = new Filesystem($adapter);