PHP Класс Horde_Vfs_Ftp, horde

Required values for $params: - username: (string) The username with which to connect to the FTP server. - password: (string) The password with which to connect to the FTP server. - hostspec: (string) The FTP server to connect to. Optional values for $params: - lsformat: (string) The return formatting from the 'ls' command. Possible values: 'aix', 'standard' (default). - maplocalids: (boolean) If true and the POSIX extension is available, the driver will map the user and group IDs returned from the FTP server with the local IDs from the local password file. This is useful only if the FTP server is running on localhost or if the local user/group IDs are identical to the remote FTP server. - pasv: (boolean) If true, connection will be set to passive mode. - port: (integer) The port used to connect to the ftp server if other than 21 (FTP default). - ssl: (boolean) If true, and PHP had been compiled with OpenSSL support, TLS transport-level encryption will be negotiated with the server. - timeout: (integer) The timeout for the server. - type: (string) The type of the remote FTP server. Possible values: 'unix', 'win', 'netware' By default, we attempt to auto-detect type. Copyright 2002-2016 Horde LLC (http://www.horde.org/) Copyright 2002-2007 Michael Varghese See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Chuck Hagenbuch ([email protected])
Автор: Michael Varghese ([email protected])
Наследование: extends Horde_Vfs_Base
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_credentials array List of additional credentials required for this VFS backend.
$_gids array Local cache array for group IDs.
$_params array Hash containing connection parameters.
$_permissions array List of permissions and if they can be changed in this VFS backend.
$_stream resource Variable holding the connection to the ftp server.
$_type string The FTP server type.
$_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.
getCurrentDirectory ( ) : string Returns the current working directory on the FTP 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 FTP 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.
_setPath ( string $path ) Changes the current directory on the server.

Описание методов

_connect() защищенный Метод

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

_getPath() защищенный Метод

Returns the full path of an item.
protected _getPath ( string $path, string $name ) : mixed
$path string The path of directory of the item.
$name string The name of the item.
Результат mixed Full path when $path isset 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.

_setPath() защищенный Метод

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

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 Automatically create directories?

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?

getCurrentDirectory() публичный Метод

Returns the current working directory on the FTP 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 Automatically create directories?

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

$_gids защищенное свойство

Local cache array for group IDs.
protected array $_gids
Результат array

$_params защищенное свойство

Hash containing connection parameters.
protected array $_params
Результат array

$_permissions защищенное свойство

List of permissions and if they can be changed in this VFS backend.
protected array $_permissions
Результат array

$_stream защищенное свойство

Variable holding the connection to the ftp server.
protected resource $_stream
Результат resource

$_type защищенное свойство

The FTP server type.
protected string $_type
Результат string

$_uids защищенное свойство

Local cache array for user IDs.
protected array $_uids
Результат array