Class VFS_ftp

Description

VFS implementation for an FTP server.

Required values for $params:

      'username'       The username with which to connect to the ftp server.
      'password'       The password with which to connect to the ftp server.
      'hostspec'       The ftp server to connect to.

Optional values for $params:

      'lsformat'       The return formatting from the 'ls' command).
                       Values: 'aix', 'standard' (default)
      'maplocalids'    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'           If true, connection will be set to passive mode.
      'port'           The port used to connect to the ftp server if other
                       than 21.
      'ssl'            If true, and PHP had been compiled with OpenSSL
                       support, TLS transport-level encryption will be
                       negotiated with the server.
      'timeout'        If defined, use this value as the timeout for the
                       server.
      'type'           The type of the remote FTP server.
                       Possible values: 'unix', 'win', 'netware'
                       By default, we attempt to auto-detect type.

$Horde: framework/VFS/lib/VFS/ftp.php,v 1.1.2.7 2009/10/15 17:18:48 jan Exp $

Copyright 2002-2009 The Horde Project (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.fsf.org/copyleft/lgpl.html.

Located in /VFS/lib/VFS/ftp.php (line 43)

VFS
   |
   --VFS_ftp
Variable Summary
 array $_gids
 resource $_stream
 mixed $_type
 array $_uids
Method Summary
 mixed changePermissions (string $path, string $name, string $permission)
 mixed copy (string $path, string $name, string $dest, [boolean $autocreate = false])
 mixed createFolder (string $path, string $name)
 mixed deleteFile (string $path, string $name)
 mixed deleteFolder (string $path, string $name, [boolean $recursive = false])
 boolean isFolder (string $path, string $name)
 mixed listFolders ([string $path = ''], [mixed $filter = null], [boolean $dotfolders = true])
 mixed move (string $path, string $name, string $dest, [boolean $autocreate = false])
 string read (string $path, string $name)
 string readFile (string $path, string $name)
 resource readStream (string $path, string $name)
 mixed rename (string $oldpath, string $oldname, string $newpath, string $newname)
 integer size (string $path, string $name)
 mixed write (string $path, string $name, string $tmpFile, [boolean $autocreate = false])
 mixed writeData (string $path, string $name, string $data, [boolean $autocreate = false])
 array _listFolder ([string $path = ''], [mixed $filter = null], [boolean $dotfiles = true], [boolean $dironly = false])
Variables
array $_credentials = array('username', 'password') (line 50)

List of additional credentials required for this VFS backend.


Redefinition of:
VFS::$_credentials
List of additional credentials required for this VFS backend (example: For FTP, we need a username and password to log in to the server with).
array $_gids = array() (line 81)

Local cache array for group IDs.

array $_permissions = array(
'owner' => array('read' => true, 'write' => true, 'execute' => true),'group'=>array('read'=>true,'write'=>true,'execute'=>true),'all'=>array('read'=>true,'write'=>true,'execute'=>true))
(line 57)

List of permissions and if they can be changed in this VFS backend.


Redefinition of:
VFS::$_permissions
List of permissions and if they can be changed in this VFS backend.
resource $_stream = false (line 67)

Variable holding the connection to the ftp server.

mixed $_type (line 85)
array $_uids = array() (line 74)

Local cache array for user IDs.

Inherited Variables

Inherited from VFS

VFS::$_logger
VFS::$_logLevel
VFS::$_params
VFS::$_vfsSize
Methods
changePermissions (line 432)

Changes permissions for an item on the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed changePermissions (string $path, string $name, string $permission)
  • string $path: The parent folder of the item.
  • string $name: The name of the item.
  • string $permission: The permission to set.

Redefinition of:
VFS::changePermissions()
Changes permissions for an item on the VFS.
copy (line 745)

Copies a file through the backend.

  • return: True on success or a PEAR_Error object on failure.
mixed copy (string $path, string $name, string $dest, [boolean $autocreate = false])
  • string $path: The path of the original file.
  • string $name: The name of the original file.
  • string $dest: The name of the destination directory.
  • boolean $autocreate: Automatically create directories?

Redefinition of:
VFS::copy()
Copies a file through the backend.
createFolder (line 409)

Creates a folder on the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed createFolder (string $path, string $name)
  • string $path: The parent folder.
  • string $name: The name of the new folder.

Redefinition of:
VFS::createFolder()
Creates a folder in the VFS.
deleteFile (line 268)

Deletes a file from the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed deleteFile (string $path, string $name)
  • string $path: The path to delete the file from.
  • string $name: The filename to delete.

Redefinition of:
VFS::deleteFile()
Deletes a file from the VFS.
deleteFolder (line 324)

Deletes a folder from the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed deleteFolder (string $path, string $name, [boolean $recursive = false])
  • string $path: The parent folder.
  • string $name: The name of the folder to delete.
  • boolean $recursive: Force a recursive delete?

Redefinition of:
VFS::deleteFolder()
Deletes a folder from the VFS.
getCurrentDirectory (line 853)

Returns the current working directory on the FTP server.

  • return: The current working directory.
string getCurrentDirectory ()

Redefinition of:
VFS::getCurrentDirectory()
Returns the current working directory of the VFS backend.
isFolder (line 295)

Checks if a given item is a folder.

  • return: True if it is a folder, false otherwise.
boolean isFolder (string $path, string $name)
  • string $path: The parent folder.
  • string $name: The item name.

Redefinition of:
VFS::isFolder()
Checks if a given item is a folder.
listFolders (line 702)

Returns a sorted list of folders in the specified directory.

  • return: Folder list on success or a PEAR_Error object on failure.
mixed listFolders ([string $path = ''], [mixed $filter = null], [boolean $dotfolders = true])
  • string $path: The path of the directory to get the directory list for.
  • mixed $filter: Hash of items to filter based on folderlist.
  • boolean $dotfolders: Include dotfolders?

Redefinition of:
VFS::listFolders()
Returns a sorted list of folders in the specified directory.
move (line 812)

Moves a file through the backend.

  • return: True on success or a PEAR_Error object on failure.
mixed move (string $path, string $name, string $dest, [boolean $autocreate = false])
  • string $path: The path of the original file.
  • string $name: The name of the original file.
  • string $dest: The destination file name.
  • boolean $autocreate: Automatically create directories?

Redefinition of:
VFS::move()
Moves a file through the backend.
read (line 120)

Retrieves a file from the VFS.

  • return: The file data.
string read (string $path, string $name)
  • string $path: The pathname to the file.
  • string $name: The filename to retrieve.

Redefinition of:
VFS::read()
Retrieves a file from the VFS.
readFile (line 147)

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 <em>cannot</em> be modified! The behavior if you do modify it is undefined. It will be removed at the end of the request.

  • return: A local filename.
string readFile (string $path, string $name)
  • string $path: The pathname to the file.
  • string $name: The filename to retrieve.

Redefinition of:
VFS::readFile()
Retrieves a file from the VFS as an on-disk local file.
readStream (line 182)

Open a stream to a file in the VFS.

  • return: The stream.
resource readStream (string $path, string $name)
  • string $path: The pathname to the file.
  • string $name: The filename to retrieve.
rename (line 384)

Renames a file in the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed rename (string $oldpath, string $oldname, string $newpath, string $newname)
  • string $oldpath: The old path to the file.
  • string $oldname: The old filename.
  • string $newpath: The new path of the file.
  • string $newname: The new filename.

Redefinition of:
VFS::rename()
Renames a file in the VFS.
size (line 98)

Returns the size of a file.

  • return: The size of the file in bytes or PEAR_Error on failure.
  • access: public
integer size (string $path, string $name)
  • string $path: The path of the file.
  • string $name: The filename.

Redefinition of:
VFS::size()
Retrieves the size of a file from the VFS.
write (line 204)

Stores a file in the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed write (string $path, string $name, string $tmpFile, [boolean $autocreate = false])
  • string $path: The path to store the file in.
  • string $name: The filename to use.
  • string $tmpFile: The temporary file containing the data to be stored.
  • boolean $autocreate: Automatically create directories?

Redefinition of:
VFS::write()
Stores a file in the VFS.
writeData (line 243)

Stores a file in the VFS from raw data.

  • return: True on success or a PEAR_Error object on failure.
mixed writeData (string $path, string $name, string $data, [boolean $autocreate = false])
  • string $path: The path to store the file in.
  • string $name: The filename to use.
  • string $data: The file data.
  • boolean $autocreate: Automatically create directories?

Redefinition of:
VFS::writeData()
Stores a file in the VFS from raw data.
_listFolder (line 456)

Returns an an unsorted file list of the specified directory.

  • return: File list on success or PEAR_Error on failure.
array _listFolder ([string $path = ''], [mixed $filter = null], [boolean $dotfiles = true], [boolean $dironly = false])
  • string $path: The path of the directory.
  • mixed $filter: String/hash to filter file/dirname on.
  • boolean $dotfiles: Show dotfiles?
  • boolean $dironly: Show only directories?

Redefinition of:
VFS::_listFolder()
Returns an an unsorted file list of the specified directory.

Inherited Methods

Inherited From VFS

 VFS::VFS()
 VFS::autocreatePath()
 VFS::changePermissions()
 VFS::checkCredentials()
 VFS::copy()
 VFS::createFolder()
 VFS::delete()
 VFS::deleteFile()
 VFS::deleteFolder()
 VFS::emptyFolder()
 VFS::exists()
 VFS::factory()
 VFS::getCurrentDirectory()
 VFS::getFolderSize()
 VFS::getModifiablePermissions()
 VFS::getParam()
 VFS::getQuota()
 VFS::getRequiredCredentials()
 VFS::getVFSSize()
 VFS::isFolder()
 VFS::listFolder()
 VFS::listFolders()
 VFS::log()
 VFS::move()
 VFS::read()
 VFS::readByteRange()
 VFS::readFile()
 VFS::rename()
 VFS::setLogger()
 VFS::setParams()
 VFS::setQuota()
 VFS::setQuotaRoot()
 VFS::singleton()
 VFS::size()
 VFS::strlen()
 VFS::strtolower()
 VFS::write()
 VFS::writeData()
 VFS::_copyRecursive()
 VFS::_getPath()
 VFS::_getTempDir()
 VFS::_getTempFile()
 VFS::_listFolder()

Documentation generated on Sun, 30 Jan 2011 05:17:40 +0000 by phpDocumentor 1.4.3