SFTP library for CodeIgniter
This is a Library for CodeIgniter that uses sFTP. I've tried to keep the usage the exact same as the FTP library that is included with CodeIgniter.
- PHP 5.2
- PECL SSH2 Extension
- CodeIgniter 2.1.4+
Drop this file into the ./application/libraries/ folder in your CodeIgniter installation.
This lib has the same methods as the CodeIgniter FTP Class.
$this->load->library('sftp');
$config['hostname'] = 'ssh.example.com';
$config['username'] = 'your-username';
$config['password'] = 'your-password';
$this->sftp->connect($config);
$this->sftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775);
$this->sftp->close();