Welcome to the PHP FTP and SFTP Client Connector Library! This library simplifies FTP and SFTP protocol operations, making it easy to manage remote files and establish distant server connections. Whether you need basic file transfers or more advanced functionality, this library has you covered.
-
User-Friendly Assistance: This library offers easy-to-use helper functions for handling remote files and establishing distant server connections.
-
Emphasis on Simplicity and Efficiency: We've designed this package to be lightweight. It acts as a convenient layer on top of PHP's native FTP and SFTP protocol capabilities, enriched with helpful utilities.
-
Customization Options: Advanced users can personalize functionality by inheriting from one of the two classes SftpClientConnector and FtpClientConnector included in the package.
To get started with our library, you can install it via Composer:
composer require ajenguianis/ftp-sftp-connector
Connect to ftp or SFTP server:
$connector= new \AA\ServerConector\Connector();
//set protocol ftp or sftp
$connector->setProtocol('ftp');
$connector->setUp($host, $login, $password, $port);
$connector->connect();
/**
* @param $localFile
* @param $remoteFile
* @param $mode
* @return bool|string
*/
$connector->downloadFile($localFile,$remoteFil, $mode);
$connector->nlist($directory,$recursive);
$connector->getByExtension($directory,$recursive,$extension);
$connector->archive($fileFrom, $fileTo);