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
Copy file name to clipboardExpand all lines: FtpClient.php
+52-47Lines changed: 52 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -43,10 +43,11 @@ class FtpClient implements \Countable
43
43
* @var resource
44
44
*/
45
45
protected$conn;
46
+
46
47
/**
47
48
* PHP FTP functions wrapper
48
49
*
49
-
* @var Functions
50
+
* @var FtpWrapper
50
51
*/
51
52
private$ftp;
52
53
@@ -62,9 +63,11 @@ public function __construct($connection = null)
62
63
if (!extension_loaded('ftp')) {
63
64
thrownewFtpException('FTP extension is not loaded!');
64
65
}
66
+
65
67
if ($connection) {
66
68
$this->conn = $connection;
67
69
}
70
+
68
71
$this->setWrapper(newFtpWrapper($this->conn));
69
72
}
70
73
@@ -84,8 +87,8 @@ public function __destruct()
84
87
* Wrap the FTP PHP functions to call as method of FtpClient object.
85
88
* The connection is automaticaly passed to the FTP PHP functions.
86
89
*
87
-
* @param $method
88
-
* @param array $arguments
90
+
* @param $method
91
+
* @param array $arguments
89
92
*
90
93
* @internal param string $function
91
94
*
@@ -99,8 +102,8 @@ public function __call($method, array $arguments)
99
102
/**
100
103
* Overwrites the PHP limit
101
104
*
102
-
* @param string|null $memory The memory limit, if null is not modified
103
-
* @param int $time_limit The max execution time, unlimited by default
105
+
* @param string|null $memory The memory limit, if null is not modified
106
+
* @param int $time_limit The max execution time, unlimited by default
104
107
*
105
108
* @return FtpClient
106
109
*/
@@ -129,9 +132,9 @@ public function help()
129
132
* Open a FTP connection
130
133
*
131
134
* @param string $host
132
-
* @param bool $ssl
133
-
* @param int $port
134
-
* @param int $timeout
135
+
* @param bool $ssl
136
+
* @param int $port
137
+
* @param int $timeout
135
138
*
136
139
* @return FTPClient
137
140
*
@@ -154,9 +157,9 @@ public function connect($host, $ssl = false, $port = 21, $timeout = 90)
154
157
/**
155
158
* Download files
156
159
*
157
-
* @param string $source_directory
158
-
* @param string $target_directory
159
-
* @param int $mode
160
+
* @param string $source_directory
161
+
* @param string $target_directory
162
+
* @param int $mode
160
163
*
161
164
* @return FtpClient
162
165
*/
@@ -226,7 +229,7 @@ public function login($username = 'anonymous', $password = '')
226
229
* Return -1 on error
227
230
*
228
231
* @param string $remoteFile
229
-
* @param null $format
232
+
* @param null $format
230
233
*
231
234
* @return int
232
235
*/
@@ -260,11 +263,11 @@ public function up()
260
263
/**
261
264
* Returns a list of files in the given directory
262
265
*
263
-
* @param string $directory The directory, by default is "." the current directory
264
-
* @param bool $recursive
265
-
* @param callable|string $filter A callable to filter the result, by default is asort() PHP function.
266
-
* The result is passed in array argument, must take the argument by reference!
267
-
* The callable should proceed with the reference array because is the behavior of several PHP sorting functions (by reference ensure directly the compatibility with all PHP sorting functions)
266
+
* @param string $directory The directory, by default is "." the current directory
267
+
* @param bool $recursive
268
+
* @param callable|string $filter A callable to filter the result, by default is asort() PHP function.
269
+
* The result is passed in array argument, must take the argument by reference!
270
+
* The callable should proceed with the reference array because is the behavior of several PHP sorting functions (by reference ensure directly the compatibility with all PHP sorting functions)
268
271
*
269
272
* @throws FtpException
270
273
*
@@ -341,25 +344,28 @@ public function nlist($directory = '.', $recursive = false, $filter = 'sort')
0 commit comments