Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
open (array $args=[]) | |
close () | |
mkdir ($dir, $mode=0777, $recursive=true) | |
rmdir ($dir, $recursive=false) | |
pwd () | |
cd ($dir) | |
read ($filename, $destination=null) | |
write ($filename, $source, $mode=null) | |
rm ($filename) | |
mv ($source, $destination) | |
chmod ($filename, $mode) | |
ls ($grep=null) | |
rawls () | |
![]() | |
setAllowCreateFolders ($flag) | |
open (array $args=[]) | |
dirsep () | |
getCleanPath ($path) | |
allowedPath ($haystackPath, $needlePath) | |
Data Fields | |
const | REMOTE_TIMEOUT = 10 |
const | SSH2_PORT = 22 |
Protected Attributes | |
$_connection = null | |
![]() | |
$_allowCreateFolders = false | |
Sftp client interface
cd | ( | $dir | ) |
Change current working directory
string | $dir |
Implements IoInterface.
chmod | ( | $filename, | |
$mode | |||
) |
Change mode of a directory or a file
string | $filename | |
int | $mode |
Implements IoInterface.
Definition at line 222 of file Sftp.php.
close | ( | ) |
ls | ( | $grep = null | ) |
Get list of cwd subdirectories and files
null | $grep | ignored parameter |
Implements IoInterface.
Definition at line 235 of file Sftp.php.
mkdir | ( | $dir, | |
$mode = 0777 , |
|||
$recursive = true |
|||
) |
Create a directory
string | $dir | |
int | $mode | ignored here; uses logged-in user's umask |
bool | $recursive | analogous to mkdir -p |
Note: if $recursive is true and an error occurs mid-execution, false is returned and some part of the hierarchy might be created. No rollback is performed.
Implements IoInterface.
Definition at line 78 of file Sftp.php.
mv | ( | $source, | |
$destination | |||
) |
Rename or move a directory or a file
string | $source | |
string | $destination |
Implements IoInterface.
Definition at line 210 of file Sftp.php.
open | ( | array | $args = [] | ) |
Open a SFTP connection to a remote site.
array | $args | Connection arguments string $args[host] Remote hostname string $args[username] Remote username string $args[password] Connection password int $args[timeout] Connection timeout [=10] |
Implements IoInterface.
Definition at line 35 of file Sftp.php.
pwd | ( | ) |
rawls | ( | ) |
read | ( | $filename, | |
$destination = null |
|||
) |
Read a file
string | $filename | remote file name |
string | null | $destination | local file name (optional) |
Implements IoInterface.
rm | ( | $filename | ) |
Delete a file
string | $filename |
Implements IoInterface.
rmdir | ( | $dir, | |
$recursive = false |
|||
) |
Delete a directory
string | $dir | |
bool | $recursive |
Implements IoInterface.
Definition at line 104 of file Sftp.php.
write | ( | $filename, | |
$source, | |||
$mode = null |
|||
) |
Write a file
string | $filename | |
string | $source | string data or local file name |
int | $mode | ignored parameter |
Implements IoInterface.
Definition at line 184 of file Sftp.php.