PHP 클래스 Horde_Vfs_Ssh2, horde

This module requires the SSH2 (version 0.10+) PECL package. Required values for $params:
username - (string) The username with which to connect to the ssh2 server.
password - (string) The password with which to connect to the ssh2 server.
hostspec - (string) The ssh2 server to connect to.
Optional values for $params:
port - (integer) The port used to connect to the ssh2 server if other than
       22.
Copyright 2006-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
상속: extends Horde_Vfs_Base
파일 보기 프로젝트 열기: horde/horde

보호된 프로퍼티들

프로퍼티 타입 설명
$_credentials array List of additional credentials required for this VFS backend.
$_cwd string The current working directory.
$_gids array Local cache array for group IDs.
$_permissions array List of permissions and if they can be changed in this VFS backend.
$_sftp resource The SFTP resource stream.
$_stream resource Variable holding the connection to the ssh2 server.
$_uids array Local cache array for user IDs.

공개 메소드들

메소드 설명
changePermissions ( string $path, string $name, string $permission ) Changes permissions for an item on the VFS.
copy ( string $path, string $name, string $dest, boolean $autocreate = false ) Copies a file through the backend.
createFolder ( string $path, string $name ) Creates a folder on the VFS.
deleteFile ( string $path, string $name ) Deletes a file from the VFS.
deleteFolder ( string $path, string $name, boolean $recursive = false ) Deletes a folder from the VFS.
exists ( string $path, string $name ) : boolean Returns if a given file or folder exists in a folder.
getCurrentDirectory ( ) : string Returns the current working directory on the SSH2 server.
isFolder ( string $path, string $name ) : boolean Checks if a given item is a folder.
move ( string $path, string $name, string $dest, boolean $autocreate = false ) Moves a file through the backend.
read ( string $path, string $name ) : string Retrieves a file from the VFS.
readFile ( string $path, string $name ) : string Retrieves a file from the VFS as an on-disk local file.
readStream ( string $path, string $name ) : resource Open a stream to a file in the VFS.
rename ( string $oldpath, string $oldname, string $newpath, string $newname ) Renames a file in the VFS.
size ( string $path, string $name ) : integer Returns the size of a file.
write ( string $path, string $name, string $tmpFile, boolean $autocreate = false ) Stores a file in the VFS.
writeData ( string $path, string $name, string $data, boolean $autocreate = false ) Stores a file in the VFS from raw data.

보호된 메소드들

메소드 설명
_connect ( ) Attempts to open a connection to the SSH2 server.
_getPath ( string $path, string $name ) : mixed Returns the full path of an item.
_listFolder ( string $path = '', string | array $filter = null, boolean $dotfiles = true, boolean $dironly = false ) : array Returns an unsorted file list of the specified directory.
_parentDir ( string $path ) : string Returns the parent directory of the specified path.
_recv ( string $remote, string $local ) : boolean Receives file from remote host.
_send ( string $local, string $remote ) : boolean Sends local file to remote host.
_setPath ( string $path ) Changes the current directory on the server.
_wrap ( string $remote ) : string Generate a stream wrapper file spec for a remote file path

메소드 상세

_connect() 보호된 메소드

Attempts to open a connection to the SSH2 server.
protected _connect ( )

_getPath() 보호된 메소드

Returns the full path of an item.
protected _getPath ( string $path, string $name ) : mixed
$path string The directory of the item.
$name string The name of the item.
리턴 mixed Full path to the file when $path is not empty and just $name when not set.

_listFolder() 보호된 메소드

Returns an unsorted file list of the specified directory.
protected _listFolder ( string $path = '', string | array $filter = null, boolean $dotfiles = true, boolean $dironly = false ) : array
$path string The path of the directory.
$filter string | array Regular expression(s) to filter file/directory name on.
$dotfiles boolean Show dotfiles?
$dironly boolean Show only directories?
리턴 array File list.

_parentDir() 보호된 메소드

Returns the parent directory of the specified path.
protected _parentDir ( string $path ) : string
$path string The path to get the parent of.
리턴 string The parent directory.

_recv() 보호된 메소드

This function exists because the ssh2_scp_recv function doesn't seem to work on some hosts.
protected _recv ( string $remote, string $local ) : boolean
$remote string Full path to the remote location.
$local string Full path to the local file.
리턴 boolean Success.

_send() 보호된 메소드

This function exists because the ssh2_scp_send function doesn't seem to work on some hosts.
protected _send ( string $local, string $remote ) : boolean
$local string Full path to the local file.
$remote string Full path to the remote location.
리턴 boolean Success.

_setPath() 보호된 메소드

Changes the current directory on the server.
protected _setPath ( string $path )
$path string The path to change to.

_wrap() 보호된 메소드

Generate a stream wrapper file spec for a remote file path
protected _wrap ( string $remote ) : string
$remote string Full path to the remote location
리턴 string A full stream wrapper path to the remote location

changePermissions() 공개 메소드

Changes permissions for an item on the VFS.
public changePermissions ( string $path, string $name, string $permission )
$path string The parent folder of the item.
$name string The name of the item.
$permission string The permission to set in octal notation.

copy() 공개 메소드

Copies a file through the backend.
public copy ( string $path, string $name, string $dest, boolean $autocreate = false )
$path string The path of the original file.
$name string The name of the original file.
$dest string The name of the destination directory.
$autocreate boolean Auto-create the directory if it doesn't exist?

createFolder() 공개 메소드

Creates a folder on the VFS.
public createFolder ( string $path, string $name )
$path string The parent folder.
$name string The name of the new folder.

deleteFile() 공개 메소드

Deletes a file from the VFS.
public deleteFile ( string $path, string $name )
$path string The path to delete the file from.
$name string The filename to delete.

deleteFolder() 공개 메소드

Deletes a folder from the VFS.
public deleteFolder ( string $path, string $name, boolean $recursive = false )
$path string The parent folder.
$name string The name of the folder to delete.
$recursive boolean Force a recursive delete?

exists() 공개 메소드

Returns if a given file or folder exists in a folder.
public exists ( string $path, string $name ) : boolean
$path string The path to the folder.
$name string The file or folder name.
리턴 boolean True if it exists, false otherwise.

getCurrentDirectory() 공개 메소드

Returns the current working directory on the SSH2 server.
public getCurrentDirectory ( ) : string
리턴 string The current working directory.

isFolder() 공개 메소드

Checks if a given item is a folder.
public isFolder ( string $path, string $name ) : boolean
$path string The parent folder.
$name string The item name.
리턴 boolean True if it is a folder, false otherwise.

move() 공개 메소드

Moves a file through the backend.
public move ( string $path, string $name, string $dest, boolean $autocreate = false )
$path string The path of the original file.
$name string The name of the original file.
$dest string The destination file name.
$autocreate boolean Auto-create the directory if it doesn't exist?

read() 공개 메소드

Retrieves a file from the VFS.
public read ( string $path, string $name ) : string
$path string The pathname to the file.
$name string The filename to retrieve.
리턴 string The file data.

readFile() 공개 메소드

This function provides a file on local disk with the data of a VFS file in it. This file cannot be modified! The behavior if you do modify it is undefined. It will be removed at the end of the request.
public readFile ( string $path, string $name ) : string
$path string The pathname to the file.
$name string The filename to retrieve.
리턴 string A local filename.

readStream() 공개 메소드

Open a stream to a file in the VFS.
public readStream ( string $path, string $name ) : resource
$path string The pathname to the file.
$name string The filename to retrieve.
리턴 resource The stream.

rename() 공개 메소드

Renames a file in the VFS.
public rename ( string $oldpath, string $oldname, string $newpath, string $newname )
$oldpath string The old path to the file.
$oldname string The old filename.
$newpath string The new path of the file.
$newname string The new filename.

size() 공개 메소드

Returns the size of a file.
public size ( string $path, string $name ) : integer
$path string The path of the file.
$name string The filename.
리턴 integer The size of the file in bytes.

write() 공개 메소드

Stores a file in the VFS.
public write ( string $path, string $name, string $tmpFile, boolean $autocreate = false )
$path string The path to store the file in.
$name string The filename to use.
$tmpFile string The temporary file containing the data to be stored.
$autocreate boolean Automatically create directories?

writeData() 공개 메소드

Stores a file in the VFS from raw data.
public writeData ( string $path, string $name, string $data, boolean $autocreate = false )
$path string The path to store the file in.
$name string The filename to use.
$data string The file data.
$autocreate boolean Automatically create directories?

프로퍼티 상세

$_credentials 보호되어 있는 프로퍼티

List of additional credentials required for this VFS backend.
protected array $_credentials
리턴 array

$_cwd 보호되어 있는 프로퍼티

The current working directory.
protected string $_cwd
리턴 string

$_gids 보호되어 있는 프로퍼티

Local cache array for group IDs.
protected array $_gids
리턴 array

$_permissions 보호되어 있는 프로퍼티

List of permissions and if they can be changed in this VFS backend.
protected array $_permissions
리턴 array

$_sftp 보호되어 있는 프로퍼티

The SFTP resource stream.
protected resource $_sftp
리턴 resource

$_stream 보호되어 있는 프로퍼티

Variable holding the connection to the ssh2 server.
protected resource $_stream
리턴 resource

$_uids 보호되어 있는 프로퍼티

Local cache array for user IDs.
protected array $_uids
리턴 array