Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Champs de données | |
const | CHANNEL = 0x100 |
const | SOURCE_LOCAL_FILE = 1 |
const | SOURCE_STRING = 2 |
const | SOURCE_CALLBACK = 16 |
const | RESUME = 4 |
const | RESUME_START = 8 |
Champs de données hérités de SSH2 | |
const | NET_SSH2_COMPRESSION_NONE = 1 |
const | NET_SSH2_COMPRESSION_ZLIB = 2 |
const | NET_SSH2_COMPRESSION_ZLIB_AT_OPENSSH = 3 |
const | MASK_CONSTRUCTOR = 0x00000001 |
const | MASK_CONNECTED = 0x00000002 |
const | MASK_LOGIN_REQ = 0x00000004 |
const | MASK_LOGIN = 0x00000008 |
const | MASK_SHELL = 0x00000010 |
const | MASK_WINDOW_ADJUST = 0x00000020 |
const | CHANNEL_EXEC = 1 |
const | CHANNEL_SHELL = 2 |
const | CHANNEL_SUBSYSTEM = 3 |
const | CHANNEL_AGENT_FORWARD = 4 |
const | CHANNEL_KEEP_ALIVE = 5 |
const | LOG_SIMPLE = 1 |
const | LOG_COMPLEX = 2 |
const | LOG_REALTIME = 3 |
const | LOG_REALTIME_FILE = 4 |
const | LOG_MAX_SIZE = 1048576 |
const | READ_SIMPLE = 1 |
const | READ_REGEX = 2 |
const | READ_NEXT = 3 |
$fsock | |
Fonctions membres protégées | |
parseAttributes (&$response) | |
reset_connection ($reason) | |
disconnect_helper ($reason) | |
Fonctions membres protégées hérités de SSH2 | |
sublogin ($username,... $args) | |
reset_connection ($reason) | |
get_channel_packet ($client_channel, $skip_extended=false) | |
send_binary_packet ($data, $logged=null) | |
send_channel_packet ($client_channel, $data) | |
disconnect_helper ($reason) | |
define_array (... $args) | |
format_log ($message_log, $message_number_log) | |
Attributs protégés | |
$sortOptions = [] | |
Attributs protégés hérités de SSH2 | |
$bitmap = 0 | |
$server_identifier = false | |
$server_channels = [] | |
$channel_status = [] | |
$window_size = 0x7FFFFFFF | |
$window_size_server_to_client = [] | |
$timeout | |
$curTimeout | |
$preferred_signature_format = false | |
$auth = [] | |
Fonctions membres privées | |
precheck () | |
partial_init_sftp_connection () | |
init_sftp_connection () | |
logError ($response, $status=-1) | |
nlist_helper ($dir, $recursive, $relativeDir) | |
readlist ($dir, $raw=true) | |
comparator ($a, $b) | |
update_stat_cache ($path, $value) | |
remove_from_stat_cache ($path) | |
query_stat_cache ($path) | |
stat_helper ($filename, $type) | |
setstat ($filename, $attr, $recursive) | |
setstat_recursive ($path, $attr, &$i) | |
mkdir_helper ($dir, $mode) | |
read_put_responses ($i) | |
close_handle ($handle) | |
delete_recursive ($path, &$i) | |
get_stat_cache_prop ($path, $prop) | |
get_lstat_cache_prop ($path, $prop) | |
get_xstat_cache_prop ($path, $prop, $type) | |
parseTime ($key, $flags, &$response) | |
parseMode ($mode) | |
parseLongname ($longname) | |
send_sftp_packet ($type, $data, $request_id=1) | |
Attributs privés | |
$packet_types = [] | |
$status_codes = [] | |
$attributes | |
$open_flags | |
$open_flags5 | |
$file_types | |
$use_request_id = false | |
$packet_type = -1 | |
$packet_buffer = '' | |
$extensions = [] | |
$version | |
$defaultVersion | |
$preferredVersion = 3 | |
$pwd = false | |
$packet_type_log = [] | |
$packet_log = [] | |
$sftp_errors = [] | |
$stat_cache = [] | |
$max_sftp_packet | |
$use_stat_cache = true | |
$canonicalize_paths = true | |
$requestBuffer = [] | |
$preserveTime = false | |
$allow_arbitrary_length_packets = false | |
$channel_close = false | |
$partial_init = false | |
Membres hérités additionnels | |
Fonctions membres publiques statiques hérités de SSH2 | |
static | setCryptoEngine ($engine) |
static | getSupportedKEXAlgorithms () |
static | getSupportedHostKeyAlgorithms () |
static | getSupportedEncryptionAlgorithms () |
static | getSupportedMACAlgorithms () |
static | getSupportedCompressionAlgorithms () |
static | getConnectionByResourceId ($id) |
__construct | ( | $host, | |
$port = 22 , |
|||
$timeout = 10 |
|||
) |
Default Constructor.
Connects to an SFTP server
string | $host | |
int | $port | |
int | $timeout | public |
Références SSH2\$host, SSH2\$port, SSH2\$timeout, Symfony\Contracts\Service\__construct(), et SSH2\define_array().
chdir | ( | $dir | ) |
Changes the current directory
string | $dir |
Références $dir, SFTP\close_handle(), elseif, SFTP\logError(), Strings\packSSH2(), SFTP\precheck(), SFTP\pwd(), SFTP\query_stat_cache(), SFTP\realpath(), SFTP\send_sftp_packet(), et SFTP\update_stat_cache().
Référencé par SFTP\lstat(), et SFTP\stat().
chgrp | ( | $filename, | |
$gid, | |||
$recursive = false |
|||
) |
Changes file or directory group
$gid should be an int for SFTPv3 and a string for SFTPv4+. Ideally the string would be of the form "user@dns_domain" but it does not need to be. ‘$sftp->getSupportedVersions()['version’]` will return the specific version that's being used.
Returns true on success or false on error.
string | $filename | |
int | string | $gid | |
bool | $recursive |
Références $attr, Strings\packSSH2(), et SFTP\setstat().
chmod | ( | $mode, | |
$filename, | |||
$recursive = false |
|||
) |
Set permissions on a file.
Returns the new file permissions on success or false on error. If $recursive is true than this just returns true or false.
int | $mode | |
string | $filename | |
bool | $recursive |
Références $attr, $mode, $temp, SFTP\logError(), SFTP\parseAttributes(), SFTP\realpath(), SFTP\send_sftp_packet(), et SFTP\setstat().
Référencé par SFTP\mkdir_helper().
chown | ( | $filename, | |
$uid, | |||
$recursive = false |
|||
) |
Changes file or directory owner
$uid should be an int for SFTPv3 and a string for SFTPv4+. Ideally the string would be of the form "user@dns_domain" but it does not need to be. ‘$sftp->getSupportedVersions()['version’]` will return the specific version that's being used.
Returns true on success or false on error.
string | $filename | |
int | string | $uid | |
bool | $recursive |
Références $attr, Strings\packSSH2(), et SFTP\setstat().
clearStatCache | ( | ) |
Clear the stat cache
public
|
private |
Close handle
string | $handle |
Références SFTP\logError(), SFTP\send_sftp_packet(), et Strings\unpackSSH2().
Référencé par SFTP\chdir(), SFTP\get(), SFTP\put(), SFTP\readlist(), et SFTP\touch().
|
private |
Compares two rawlist entries using parameters set by setListOrder()
Intended for use with uasort()
array | $a | |
array | $b |
delete | ( | $path, | |
$recursive = true |
|||
) |
Deletes a file on the SFTP server.
string | $path | |
bool | $recursive |
Références $i, $path, $result, SFTP\delete_recursive(), SFTP\logError(), SFTP\precheck(), SFTP\read_put_responses(), SFTP\realpath(), SFTP\remove_from_stat_cache(), SFTP\send_sftp_packet(), et Strings\unpackSSH2().
|
private |
Recursively deletes directories on the SFTP server
Minimizes directory lookups and SSH_FXP_STATUS requests for speed.
string | $path | |
int | $i |
Références $i, $path, $temp, Strings\packSSH2(), SFTP\read_put_responses(), SFTP\readlist(), SFTP\remove_from_stat_cache(), et SFTP\send_sftp_packet().
Référencé par SFTP\delete().
disableArbitraryLengthPackets | ( | ) |
Disable arbitrary length packets
public
disableDatePreservation | ( | ) |
Disable Date Preservation
public
disablePathCanonicalization | ( | ) |
Enable path canonicalization
public
disableStatCache | ( | ) |
Disable the stat cache
public
|
protected |
Disconnect
int | $reason |
enableArbitraryLengthPackets | ( | ) |
Enable arbitrary length packets
public
enableDatePreservation | ( | ) |
Enable Date Preservation
public
enablePathCanonicalization | ( | ) |
Enable path canonicalization
public
enableStatCache | ( | ) |
Enable the stat cache
public
file_exists | ( | $path | ) |
Checks whether a file or directory exists
string | $path |
Références $path, $result, SFTP\precheck(), SFTP\query_stat_cache(), SFTP\realpath(), et SFTP\stat().
fileatime | ( | $path | ) |
Gets last access time of file
string | $path |
Références $path, et SFTP\get_stat_cache_prop().
filegroup | ( | $path | ) |
Gets file group
string | $path |
Références $path, et SFTP\get_stat_cache_prop().
filemtime | ( | $path | ) |
Gets file modification time
string | $path |
Références $path, et SFTP\get_stat_cache_prop().
fileowner | ( | $path | ) |
Gets file owner
string | $path |
Références $path, et SFTP\get_stat_cache_prop().
fileperms | ( | $path | ) |
Gets file permissions
string | $path |
Références $path, et SFTP\get_stat_cache_prop().
filesize | ( | $path | ) |
Gets file size
string | $path |
Références $path, et SFTP\get_stat_cache_prop().
filetype | ( | $path | ) |
Gets file type
string | $path |
Références $path, $type, et SFTP\get_stat_cache_prop().
Downloads a file from the SFTP server.
Returns a string containing the contents of $remote_file if $local_file is left undefined or a boolean false if the operation was unsuccessful. If $local_file is defined, returns true or false depending on the success of the operation.
$offset and $length can be used to download files in chunks.
string | $remote_file | |
string | bool | resource | callable | $local_file | |
int | $offset | |
int | $length | |
callable | null | $progressCallback |
Références $content, $i, SFTP\$max_sftp_packet, Joomla\Database\Query\$offset, $start, $temp, SFTP\close_handle(), elseif, SFTP\init_sftp_connection(), SFTP\logError(), null, Strings\packSSH2(), SFTP\precheck(), SFTP\realpath(), SFTP\send_sftp_packet(), SFTP\stat(), et SFTP\touch().
|
private |
Return an lstat properity
Uses cache if appropriate.
string | $path | |
string | $prop |
Références $path, et SFTP\get_xstat_cache_prop().
Référencé par SFTP\is_link().
|
private |
Return a stat properity
Uses cache if appropriate.
string | $path | |
string | $prop |
Références $path, et SFTP\get_xstat_cache_prop().
Référencé par SFTP\fileatime(), SFTP\filegroup(), SFTP\filemtime(), SFTP\fileowner(), SFTP\fileperms(), SFTP\filesize(), SFTP\filetype(), SFTP\is_dir(), et SFTP\is_file().
|
private |
Return a stat or lstat properity
Uses cache if appropriate.
string | $path | |
string | $prop | |
string | $type |
Références $path, $result, $type, SFTP\precheck(), SFTP\query_stat_cache(), et SFTP\realpath().
Référencé par SFTP\get_lstat_cache_prop(), et SFTP\get_stat_cache_prop().
getLastSFTPError | ( | ) |
Returns the last error
getSFTPErrors | ( | ) |
Returns all errors
getSFTPLog | ( | ) |
Returns a log of the packets that have been sent and received.
Returns a string if NET_SFTP_LOGGING == self::LOG_COMPLEX, an array if NET_SFTP_LOGGING == self::LOG_SIMPLE and false if !defined('NET_SFTP_LOGGING')
public
getSupportedVersions | ( | ) |
|
private |
(Re)initializes the SFTP channel
Références SFTP\$defaultVersion, SFTP\logError(), Strings\packSSH2(), SFTP\partial_init_sftp_connection(), SFTP\pwd(), SFTP\realpath(), SFTP\send_sftp_packet(), Strings\unpackSSH2(), et SFTP\update_stat_cache().
Référencé par SFTP\get(), et SFTP\precheck().
is_dir | ( | $path | ) |
Tells whether the filename is a directory
string | $path |
Références $path, $result, et SFTP\get_stat_cache_prop().
is_file | ( | $path | ) |
Tells whether the filename is a regular file
string | $path |
Références $path, $result, et SFTP\get_stat_cache_prop().
Référencé par SFTP\put().
is_link | ( | $path | ) |
Tells whether the filename is a symbolic link
string | $path |
Références $path, $result, et SFTP\get_lstat_cache_prop().
is_readable | ( | $path | ) |
Tells whether a file exists and is readable
string | $path |
Références $path, Strings\packSSH2(), SFTP\precheck(), SFTP\realpath(), et SFTP\send_sftp_packet().
is_writable | ( | $path | ) |
Tells whether the filename is writable
string | $path |
Références $path, Strings\packSSH2(), SFTP\precheck(), SFTP\realpath(), et SFTP\send_sftp_packet().
Référencé par SFTP\is_writeable().
is_writeable | ( | $path | ) |
Tells whether the filename is writeable
Alias of is_writable
string | $path |
Références $path, et SFTP\is_writable().
|
private |
Logs errors
string | $response | |
int | $status | private |
Références $message, et Strings\unpackSSH2().
Référencé par SFTP\chdir(), SFTP\chmod(), SFTP\close_handle(), SFTP\delete(), SFTP\get(), SFTP\init_sftp_connection(), SFTP\mkdir_helper(), SFTP\put(), SFTP\read_put_responses(), SFTP\readlink(), SFTP\readlist(), SFTP\realpath(), SFTP\rmdir(), SFTP\setstat(), SFTP\stat_helper(), SFTP\symlink(), et SFTP\touch().
lstat | ( | $filename | ) |
Returns general information about a file or symbolic link.
Returns an array on success and false otherwise.
string | $filename |
Références SFTP\$pwd, $result, SFTP\chdir(), SFTP\precheck(), SFTP\pwd(), SFTP\query_stat_cache(), SFTP\realpath(), SFTP\remove_from_stat_cache(), SFTP\stat_helper(), et SFTP\update_stat_cache().
Référencé par SFTP\rawlist(), et SFTP\update_stat_cache().
mkdir | ( | $dir, | |
$mode = -1 , |
|||
$recursive = false |
|||
) |
Creates a directory.
string | $dir | |
int | $mode | |
bool | $recursive |
Références $dir, $i, $mode, $result, $temp, SFTP\mkdir_helper(), SFTP\precheck(), et SFTP\realpath().
|
private |
Helper function for directory creation
string | $dir | |
int | $mode |
Références $dir, $mode, SFTP\chmod(), SFTP\logError(), Strings\packSSH2(), SFTP\send_sftp_packet(), et Strings\unpackSSH2().
Référencé par SFTP\mkdir().
nlist | ( | $dir = '.' , |
|
$recursive = false |
|||
) |
Returns a list of files in the given directory
string | $dir | |
bool | $recursive |
Références $dir, et SFTP\nlist_helper().
|
private |
Helper method for nlist
string | $dir | |
bool | $recursive | |
string | $relativeDir |
Références $dir, $result, $temp, $value, SFTP\query_stat_cache(), SFTP\readlist(), et SFTP\realpath().
Référencé par SFTP\nlist().
|
protected |
Parse Attributes
See '7. File Attributes' of draft-ietf-secsh-filexfer-13 for more info.
string | $response |
Références $attr, $count, $i, $key, $result, $type, $value, et Strings\unpackSSH2().
Référencé par SFTP\chmod(), SFTP\readlist(), et SFTP\stat_helper().
|
private |
Parse Longname
SFTPv3 doesn't provide any easy way of identifying a file type. You could try to open a file as a directory and see if an error is returned or you could try to parse the SFTPv3-specific longname field of the SSH_FXP_NAME packet. That's what this function does. The result is returned using the SFTPv4 type constants.
If the longname is in an unrecognized format bool(false) is returned.
string | $longname |
Référencé par SFTP\readlist().
|
private |
|
private |
Parse Time
See '7.7. Times' of draft-ietf-secsh-filexfer-13 for more info.
string | $key | |
int | $flags | |
string | $response |
Références $attr, $key, et Strings\unpackSSH2().
|
private |
Partially initialize an SFTP connection
Références $key, $value, SSH2\$window_size, elseif, SSH2\get_channel_packet(), SSH2\isTimeout(), Strings\packSSH2(), SSH2\send_binary_packet(), SFTP\send_sftp_packet(), et Strings\unpackSSH2().
Référencé par SFTP\init_sftp_connection().
|
private |
Check a few things before SFTP functions are called
Références SFTP\init_sftp_connection(), SSH2\MASK_LOGIN, et SFTP\pwd().
Référencé par SFTP\chdir(), SFTP\delete(), SFTP\file_exists(), SFTP\get(), SFTP\get_xstat_cache_prop(), SFTP\is_readable(), SFTP\is_writable(), SFTP\lstat(), SFTP\mkdir(), SFTP\put(), SFTP\pwd(), SFTP\readlink(), SFTP\readlist(), SFTP\realpath(), SFTP\rmdir(), SFTP\setstat(), SFTP\stat(), SFTP\symlink(), et SFTP\touch().
put | ( | $remote_file, | |
$data, | |||
$mode = self::SOURCE_STRING , |
|||
$start = -1 , |
|||
$local_start = -1 , |
|||
$progressCallback = null |
|||
) |
Uploads a file to the SFTP server.
By default, ::put() does not read from the local filesystem. $data is dumped directly into $remote_file. So, for example, if you set $data to 'filename.ext' and then do get(), you will get a file, twelve bytes long, containing 'filename.ext' as its contents.
Setting $mode to self::SOURCE_LOCAL_FILE will change the above behavior. With self::SOURCE_LOCAL_FILE, $remote_file will contain as many bytes as filename.ext does on your local filesystem. If your filename.ext is 1MB then that is how large $remote_file will be, as well.
Setting $mode to self::SOURCE_CALLBACK will use $data as callback function, which gets only one parameter – number of bytes to return, and returns a string if there is some data or null if there is no more data
If $data is a resource then it'll be used as a resource instead.
Currently, only binary mode is supported. As such, if the line endings need to be adjusted, you will need to take care of that, yourself.
$mode can take an additional two parameters - self::RESUME and self::RESUME_START. These are bitwise AND'd with $mode. So if you want to resume upload of a 300mb file on the local file system you'd set $mode to the following:
self::SOURCE_LOCAL_FILE | self::RESUME
If you wanted to simply append the full contents of a local file to the full contents of a remote file you'd replace self::RESUME with self::RESUME_START.
If $mode & (self::RESUME | self::RESUME_START) then self::RESUME_START will be assumed.
$start and $local_start give you more fine grained control over this process and take precident over self::RESUME when they're non-negative. ie. $start could let you write at the end of a file (like self::RESUME) or in the middle of one. $local_start could let you start your reading from the end of a file (like self::RESUME_START) or in the middle of one.
Setting $local_start to > 0 or $mode | self::RESUME_START doesn't do anything unless $mode | self::SOURCE_LOCAL_FILE.
{
Références $attr, $data, $i, $info, SFTP\$max_sftp_packet, $mode, Joomla\Database\Query\$offset, $result, $size, $start, $temp, SFTP\close_handle(), elseif, SFTP\is_file(), SFTP\logError(), Strings\packSSH2(), SFTP\precheck(), SFTP\read_put_responses(), SFTP\realpath(), SFTP\remove_from_stat_cache(), SFTP\send_sftp_packet(), SFTP\setstat(), SFTP\SOURCE_LOCAL_FILE, et SFTP\stat().
pwd | ( | ) |
Returns the current directory name
Références SFTP\$pwd, et SFTP\precheck().
Référencé par SFTP\chdir(), SFTP\init_sftp_connection(), SFTP\lstat(), SFTP\precheck(), SFTP\realpath(), et SFTP\stat().
|
private |
Checks cache for path
Mainly used by file_exists
string | $path |
Références $dir, $path, SFTP\$stat_cache, $temp, et null.
Référencé par SFTP\chdir(), SFTP\file_exists(), SFTP\get_xstat_cache_prop(), SFTP\lstat(), SFTP\nlist_helper(), SFTP\rawlist(), et SFTP\stat().
rawlist | ( | $dir = '.' , |
|
$recursive = false |
|||
) |
Returns a detailed list of files in the given directory
string | $dir | |
bool | $recursive |
Références $dir, $key, $value, SFTP\lstat(), SFTP\query_stat_cache(), SFTP\readlist(), et SFTP\realpath().
|
private |
Reads multiple successive SSH_FXP_WRITE responses
Sending an SSH_FXP_WRITE packet and immediately reading its response isn't as efficient as blindly sending out $i SSH_FXP_WRITEs, in succession, and then reading $i responses.
int | $i |
Références $i, SFTP\logError(), et Strings\unpackSSH2().
Référencé par SFTP\delete(), SFTP\delete_recursive(), SFTP\put(), SFTP\setstat(), et SFTP\setstat_recursive().
readlink | ( | $link | ) |
Return the target of a symbolic link
string | $link |
Références $count, $link, SFTP\logError(), Strings\packSSH2(), SFTP\precheck(), SFTP\realpath(), SFTP\send_sftp_packet(), et Strings\unpackSSH2().
|
private |
Reads a list, be it detailed or not, of files in the given directory
string | $dir | |
bool | $raw |
Références SFTP\$attributes, $count, $dir, $i, $temp, $this, SFTP\close_handle(), SFTP\logError(), Strings\packSSH2(), SFTP\parseAttributes(), SFTP\parseLongname(), SFTP\precheck(), SFTP\realpath(), SFTP\send_sftp_packet(), Strings\unpackSSH2(), et SFTP\update_stat_cache().
Référencé par SFTP\delete_recursive(), SFTP\nlist_helper(), SFTP\rawlist(), et SFTP\setstat_recursive().
realpath | ( | $path | ) |
Canonicalize the Server-Side Path Name
SFTP doesn't provide a mechanism by which the current working directory can be changed, so we'll emulate it. Returns the absolute (canonicalized) path.
If canonicalize_paths has been disabled using disablePathCanonicalization(), $path is returned as-is.
string | $path |
Références $dir, $path, SFTP\logError(), Strings\packSSH2(), SFTP\precheck(), SFTP\pwd(), SFTP\send_sftp_packet(), et Strings\unpackSSH2().
Référencé par SFTP\chdir(), SFTP\chmod(), SFTP\delete(), SFTP\file_exists(), SFTP\get(), SFTP\get_xstat_cache_prop(), SFTP\init_sftp_connection(), SFTP\is_readable(), SFTP\is_writable(), SFTP\lstat(), SFTP\mkdir(), SFTP\nlist_helper(), SFTP\put(), SFTP\rawlist(), SFTP\readlink(), SFTP\readlist(), SFTP\rmdir(), SFTP\setstat(), SFTP\stat(), SFTP\symlink(), et SFTP\touch().
|
private |
Remove files / directories from cache
string | $path |
Références $dir, $i, $path, SFTP\$stat_cache, et $temp.
Référencé par SFTP\delete(), SFTP\delete_recursive(), SFTP\lstat(), SFTP\put(), SFTP\rmdir(), SFTP\setstat(), et SFTP\stat().
rename | ( | $oldname, | |
$newname | |||
) |
Renames a file or a directory on the SFTP server.
If the file already exists this will return false
string | $oldname | |
string | $newname |
Références Strings\packSSH2(), et Strings\unpackSSH2().
|
protected |
Resets a connection for re-use
int | $reason | private |
rmdir | ( | $dir | ) |
Removes a directory.
string | $dir |
Références $dir, SFTP\logError(), Strings\packSSH2(), SFTP\precheck(), SFTP\realpath(), SFTP\remove_from_stat_cache(), SFTP\send_sftp_packet(), et Strings\unpackSSH2().
|
private |
Sends SFTP Packets
See '6. General Packet Format' of draft-ietf-secsh-filexfer-13 for more info.
int | $type | |
string | $data | |
int | $request_id |
Références $data, $start, et $type.
Référencé par SFTP\chdir(), SFTP\chmod(), SFTP\close_handle(), SFTP\delete(), SFTP\delete_recursive(), SFTP\get(), SFTP\init_sftp_connection(), SFTP\is_readable(), SFTP\is_writable(), SFTP\mkdir_helper(), SFTP\partial_init_sftp_connection(), SFTP\put(), SFTP\readlink(), SFTP\readlist(), SFTP\realpath(), SFTP\rmdir(), SFTP\setstat(), SFTP\setstat_recursive(), SFTP\stat_helper(), SFTP\symlink(), et SFTP\touch().
setListOrder | ( | $args | ) |
Defines how nlist() and rawlist() will be sorted - if at all.
If sorting is enabled directories and files will be sorted independently with directories appearing before files in the resultant array that is returned.
Any parameter returned by stat is a valid sort parameter for this function. Filename comparisons are case insensitive.
Examples:
$sftp->setListOrder('filename', SORT_ASC); $sftp->setListOrder('size', SORT_DESC, 'filename', SORT_ASC); $sftp->setListOrder(true); Separates directories from files but doesn't do any sorting beyond that $sftp->setListOrder(); Don't do any sort of sorting
string | ...$args public |
Références $i.
setPreferredVersion | ( | $version | ) |
|
private |
Sets information about a file
string | $filename | |
string | $attr | |
bool | $recursive |
Références $attr, $i, $result, SFTP\logError(), Strings\packSSH2(), SFTP\precheck(), SFTP\read_put_responses(), SFTP\realpath(), SFTP\remove_from_stat_cache(), SFTP\send_sftp_packet(), SFTP\setstat_recursive(), et Strings\unpackSSH2().
Référencé par SFTP\chgrp(), SFTP\chmod(), SFTP\chown(), SFTP\put(), SFTP\setstat_recursive(), SFTP\touch(), et SFTP\truncate().
|
private |
Recursively sets information on directories on the SFTP server
Minimizes directory lookups and SSH_FXP_STATUS requests for speed.
string | $path | |
string | $attr | |
int | $i |
Références $attr, $i, $path, $temp, Strings\packSSH2(), SFTP\read_put_responses(), SFTP\readlist(), SFTP\send_sftp_packet(), et SFTP\setstat().
Référencé par SFTP\setstat().
stat | ( | $filename | ) |
Returns general information about a file.
Returns an array on success and false otherwise.
string | $filename |
Références SFTP\$pwd, $result, SFTP\chdir(), SFTP\precheck(), SFTP\pwd(), SFTP\query_stat_cache(), SFTP\realpath(), SFTP\remove_from_stat_cache(), SFTP\stat_helper(), et SFTP\update_stat_cache().
Référencé par SFTP\file_exists(), SFTP\get(), SFTP\put(), et SFTP\update_stat_cache().
|
private |
Returns general information about a file or symbolic link
Determines information without calling ::realpath(). The second parameter can be either NET_SFTP_STAT or NET_SFTP_LSTAT.
string | $filename | |
int | $type |
Références $type, SFTP\logError(), Strings\packSSH2(), SFTP\parseAttributes(), et SFTP\send_sftp_packet().
Référencé par SFTP\lstat(), et SFTP\stat().
symlink | ( | $target, | |
$link | |||
) |
Create a symlink
symlink() creates a symbolic link to the existing target with the specified name link.
string | $target | |
string | $link |
Références $link, $target, $type, SFTP\logError(), Strings\packSSH2(), SFTP\precheck(), SFTP\realpath(), SFTP\send_sftp_packet(), et Strings\unpackSSH2().
Sets access and modification time of file.
If the file does not exist, it will be created.
string | $filename | |
int | $time | |
int | $atime |
Références $attr, SFTP\close_handle(), SFTP\logError(), Strings\packSSH2(), SFTP\precheck(), SFTP\realpath(), SFTP\send_sftp_packet(), et SFTP\setstat().
Référencé par SFTP\get().
truncate | ( | $filename, | |
$new_size | |||
) |
Truncates a file to a given length
string | $filename | |
int | $new_size |
Références $attr, Strings\packSSH2(), et SFTP\setstat().
|
private |
Save files / directories to cache
string | $path | |
mixed | $value | private |
Références $dir, $i, $path, SFTP\$stat_cache, $temp, $value, SFTP\lstat(), et SFTP\stat().
Référencé par SFTP\chdir(), SFTP\init_sftp_connection(), SFTP\lstat(), SFTP\readlist(), et SFTP\stat().
|
private |
|
private |
Référencé par SFTP\readlist().
|
private |
|
private |
|
private |
Référencé par SFTP\init_sftp_connection().
|
private |
|
private |
|
private |
Référencé par SFTP\get(), et SFTP\put().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Référencé par SFTP\lstat(), SFTP\pwd(), et SFTP\stat().
|
private |
|
private |
|
protected |
|
private |
Référencé par SFTP\query_stat_cache(), SFTP\remove_from_stat_cache(), et SFTP\update_stat_cache().
|
private |
|
private |
|
private |
|
private |
const CHANNEL = 0x100 |
SFTP channel constant
::exec() uses 0 and ::read() / ::write() use 1.
const RESUME = 4 |
Resumes an upload
public
const RESUME_START = 8 |
Append a local file to an already existing remote file
public
const SOURCE_CALLBACK = 16 |
Reads data from callback: function callback($length) returns string to proceed, null for EOF
public
const SOURCE_LOCAL_FILE = 1 |
const SOURCE_STRING = 2 |