You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wrapper class for PHP's [SSH2 extension](http://php.net/manual/en/book.ssh2.php). The base class was created by [Jamie Munro](https://www.sitepoint.com/author/jmunro/) taken from [this article](https://www.sitepoint.com/using-ssh-and-sftp-with-php/).
5
+
6
+
## Installation
7
+
```term
8
+
$ composer require lodev09/php-ssh2
9
+
```
10
+
11
+
## Usage
12
+
```php
13
+
14
+
// connect
15
+
$auth = new \SSH2\Password(SFTP_USER, SFTP_PASSWORD);
16
+
$sftp = new \SSH2\SFTP(SFTP_HOST, $auth);
17
+
18
+
if ($sftp->is_connected() && $sftp->is_authenticated()) {
Other native methods can be called as well for example:
36
+
```php
37
+
// ssh2_sftp_mkdir
38
+
$sftp->mkdir(...);
39
+
```
40
+
41
+
### SCP
42
+
Just a pure wrapper of the native `ssh2_scp_xxx` functions.
43
+
```php
44
+
// ssh2_scp_recv
45
+
$scp->recv(...);
46
+
```
47
+
48
+
## Feedback
49
+
All bugs, feature requests, pull requests, feedback, etc., are welcome. Visit my site at [www.lodev09.com](http://www.lodev09.com"www.lodev09.com") or email me at [lodev09@gmail.com](mailto:lodev09@gmail.com)
0 commit comments