VFS implementation for an FTP server.
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).
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-2012 Horde LLC (http://www.horde.org/)
Copyright 2002-2007 Michael Varghese mike.varghese@ascellatech.com
See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.horde.org/licenses/lgpl21.
Methods summary
public
integer
|
#
size( string $path, string $name )
Returns the size of a file.
Returns the size of a file.
Parameters
- $path
- The path of the file.
- $name
- The filename.
Returns
integer The size of the file in bytes.
Throws
Overrides
|
public
string
|
#
read( string $path, string $name )
Retrieves a file from the VFS.
Retrieves a file from the VFS.
Parameters
- $path
- The pathname to the file.
- $name
- The filename to retrieve.
Returns
string The file data.
Throws
Overrides
|
public
string
|
#
readFile( string $path, string $name )
Retrieves a file from the VFS as an on-disk local file.
Retrieves a file from the VFS as an on-disk local file.
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.
Parameters
- $path
- The pathname to the file.
- $name
- The filename to retrieve.
Returns
string A local filename.
Throws
Overrides
|
public
resource
|
#
readStream( string $path, string $name )
Open a stream to a file in the VFS.
Open a stream to a file in the VFS.
Parameters
- $path
- The pathname to the file.
- $name
- The filename to retrieve.
Returns
resource The stream.
Throws
|
public
|
#
write( string $path, string $name, string $tmpFile, boolean $autocreate = false )
Stores a file in the VFS.
Stores a file in the VFS.
Parameters
- $path
- The path to store the file in.
- $name
- The filename to use.
- $tmpFile
- <p>The temporary file containing the data to
be stored.</p>
- $autocreate
- Automatically create directories?
Throws
Overrides
|
public
|
#
writeData( string $path, string $name, string $data, boolean $autocreate = false )
Stores a file in the VFS from raw data.
Stores a file in the VFS from raw data.
Parameters
- $path
- The path to store the file in.
- $name
- The filename to use.
- $data
- The file data.
- $autocreate
- Automatically create directories?
Throws
Overrides
|
public
|
#
deleteFile( string $path, string $name )
Deletes a file from the VFS.
Deletes a file from the VFS.
Parameters
- $path
- The path to delete the file from.
- $name
- The filename to delete.
Throws
Overrides
|
public
boolean
|
#
isFolder( string $path, string $name )
Checks if a given item is a folder.
Checks if a given item is a folder.
Parameters
- $path
- The parent folder.
- $name
- The item name.
Returns
boolean True if it is a folder, false otherwise.
Overrides
|
public
|
#
deleteFolder( string $path, string $name, boolean $recursive = false )
Deletes a folder from the VFS.
Deletes a folder from the VFS.
Parameters
- $path
- The parent folder.
- $name
- The name of the folder to delete.
- $recursive
- Force a recursive delete?
Throws
Overrides
|
public
|
#
rename( string $oldpath, string $oldname, string $newpath, string $newname )
Renames a file in the VFS.
Renames a file in the VFS.
Parameters
- $oldpath
- The old path to the file.
- $oldname
- The old filename.
- $newpath
- The new path of the file.
- $newname
- The new filename.
Throws
Overrides
|
public
|
#
createFolder( string $path, string $name )
Creates a folder on the VFS.
Creates a folder on the VFS.
Parameters
- $path
- The parent folder.
- $name
- The name of the new folder.
Throws
Overrides
|
public
|
#
changePermissions( string $path, string $name, string $permission )
Changes permissions for an item on the VFS.
Changes permissions for an item on the VFS.
Parameters
- $path
- The parent folder of the item.
- $name
- The name of the item.
- $permission
- The permission to set in octal notation.
Throws
Overrides
|
public
array
|
#
listFolders( string $path = '', mixed $filter = null, boolean $dotfolders = true )
Returns a sorted list of folders in the specified directory.
Returns a sorted list of folders in the specified directory.
Parameters
- $path
- <p>The path of the directory to get the
directory list for.</p>
- $filter
- Hash of items to filter based on folderlist.
- $dotfolders
- Include dotfolders?
Returns
array Folder list.
Throws
Overrides
|
public
|
#
copy( string $path, string $name, string $dest, boolean $autocreate = false )
Copies a file through the backend.
Copies a file through the backend.
Parameters
- $path
- The path of the original file.
- $name
- The name of the original file.
- $dest
- The name of the destination directory.
- $autocreate
- Automatically create directories?
Throws
Overrides
|
public
|
#
move( string $path, string $name, string $dest, boolean $autocreate = false )
Moves a file through the backend.
Moves a file through the backend.
Parameters
- $path
- The path of the original file.
- $name
- The name of the original file.
- $dest
- The destination file name.
- $autocreate
- Automatically create directories?
Throws
Overrides
|
public
string
|
#
getCurrentDirectory( )
Returns the current working directory on the FTP server.
Returns the current working directory on the FTP server.
Returns
string The current working directory.
Throws
Overrides
|