Library helps to establish SFTP connection and work with files and folders via curl or ssh2.
Use composer to install
composer require bashanov/sftp-connector
There are 2 ways to create sftp connection.
- Create Factory instance with connection configuration. Example:
/** Creating new connection and getting information about files and folders in current directory */
$sftp = SftpConnectorFactory::createConnection([
'host' => 'test.website.com',
'username' => 'login',
'password' => 'password'
]);
print_r($sftp->ls('.'));
- Create
adapter
extendsAbstractAdapter
class and overridegetConfig
method. You may find the example file in repository,src/adapter/TestAdapter
.
Supports only auth_none
and auth_password
methods.