PHP 클래스 Horde_Vfs_Smb, horde

Required values for $params: - username: (string) The username with which to connect to the SMB server. - password: (string) The password with which to connect to the SMB server. - hostspec: (string) The SMB server to connect to. - share: (string) The share to access on the SMB server. Any trailing paths will removed from the share and prepended to each path in further requests. Example: a share of 'myshare/basedir' and a request to 'dir/subdir' will result in a request to 'basedir/dir/subdir' on myshare. - smbclient: (string) The path to the 'smbclient' executable. Optional values for $params: - port: (integer) The SMB port number to connect to. - ipaddress: (string) The address of the server to connect to. Functions not implemented: - changePermissions(): The SMB permission style does not fit with the module. All paths need to use forward slashes!
저자: Paul Gareau ([email protected])
저자: Patrice Levesque ([email protected])
상속: extends Horde_Vfs_Base
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_credentials array List of additional credentials required for this VFS backend.
$_prefix string Passed as a path suffix to the share parameter.
$_rootCreated boolean Has the vfsroot already been created?

공개 메소드들

메소드 설명
__construct ( array $params = [] ) Constructor.
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.
isFolder ( string $path, string $name ) : boolean Checks if a given pathname is a folder.
listFolder ( string $path = '', string | array $filter = null, boolean $dotfiles = true, boolean $dironly = false, boolean $recursive = false ) : array Returns a file list of the directory passed in.
move ( string $path, string $name, string $dest, boolean $autocreate = false ) Moves a file through the backend.
parseListing ( $res, $filter, $dotfiles, $dironly )
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 Retrieves the size of a file from the VFS.
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.

보호된 메소드들

메소드 설명
_command ( array $path, array $cmd ) : array Executes SMB commands - without authentication - and returns output lines in array.
_connect ( ) Authenticates a user on the SMB server and share.
_createRoot ( ) Creates the vfsroot.
_escapeShellCommand ( ) : array Replacement for escapeshellcmd(), variable length args, as we only want certain characters escaped.
_execute ( string $cmd ) : array Executes a command and returns output lines in array.
_getNativePath ( string $path ) : string Returns the full path of a directory.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $params = [] )
$params array A hash containing connection parameters.

_command() 보호된 메소드

Executes SMB commands - without authentication - and returns output lines in array.
protected _command ( array $path, array $cmd ) : array
$path array Base path for command.
$cmd array Commands to be executed.
리턴 array Array on success.

_connect() 보호된 메소드

Authenticates a user on the SMB server and share.
protected _connect ( )

_createRoot() 보호된 메소드

Creates the vfsroot.
protected _createRoot ( )

_escapeShellCommand() 보호된 메소드

Replacement for escapeshellcmd(), variable length args, as we only want certain characters escaped.
protected _escapeShellCommand ( ) : array
리턴 array TODO

_execute() 보호된 메소드

Executes a command and returns output lines in array.
protected _execute ( string $cmd ) : array
$cmd string Command to be executed.
리턴 array Array on success.

_getNativePath() 보호된 메소드

Returns the full path of a directory.
protected _getNativePath ( string $path ) : string
$path string The directory.
리턴 string Full path to the directory.

copy() 공개 메소드

Copies a file through the backend.
public copy ( string $path, string $name, string $dest, boolean $autocreate = false )
$path string The path to store the file in.
$name string The filename to use.
$dest string The destination of the file.
$autocreate boolean Automatically create directories?

createFolder() 공개 메소드

Creates a folder on the VFS.
public createFolder ( string $path, string $name )
$path string The path of directory to create 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 use.

deleteFolder() 공개 메소드

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

isFolder() 공개 메소드

Checks if a given pathname is a folder.
public isFolder ( string $path, string $name ) : boolean
$path string The path to the folder.
$name string The file or folder name.
리턴 boolean True if it is a folder, false otherwise.

listFolder() 공개 메소드

Returns a file list of the directory passed in.
public listFolder ( string $path = '', string | array $filter = null, boolean $dotfiles = true, boolean $dironly = false, boolean $recursive = 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?
$recursive boolean Return all directory levels recursively?
리턴 array File list.

move() 공개 메소드

Moves a file through the backend.
public move ( string $path, string $name, string $dest, boolean $autocreate = false )
$path string The path to store the file in.
$name string The filename to use.
$dest string The destination of the file.
$autocreate boolean Automatically create directories?

parseListing() 공개 메소드

public parseListing ( $res, $filter, $dotfiles, $dironly )

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() 공개 메소드

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

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

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

Passed as a path suffix to the share parameter.
protected string $_prefix
리턴 string

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

Has the vfsroot already been created?
protected bool $_rootCreated
리턴 boolean