Class VFS_smb

Description

Stateless VFS implementation for a SMB server, based on smbclient.

Required values for $params:

   'username'  - The username with which to connect to the SMB server.
   'password'  - The password with which to connect to the SMB server.
   'hostspec'  - The SMB server to connect to.
   'port'      - The SMB port number to connect to.
   'share'     - The share to access on the SMB server.
   'smbclient' - The path to the 'smbclient' executable.

Optional values for $params:

   'ipaddress' - The address of the server to connect to.

Functions not implemented:

  • changePermissions(): The SMB permission style does not fit with the module.
$Horde: framework/VFS/lib/VFS/smb.php,v 1.1.2.5 2009/02/06 18:24:20 slusarz Exp $

Codebase copyright 2002 Paul Gareau <paul@xhawk.net>. Adapted with permission by Patrice Levesque <wayne@ptaff.ca> from phpsmb-0.8 code, and converted to the LGPL. Please do not taunt original author, contact Patrice Levesque or dev@lists.horde.org.

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/smb.php (line 39)

VFS
   |
   --VFS_smb
Variable Summary
Method Summary
 boolean|PEAR_Error copy (string $path, string $name, string $dest, [boolean $autocreate = false])
 boolean|PEAR_Error createFolder (string $path, string $name)
 boolean|PEAR_Error deleteFile (string $path, string $name)
 boolean|PEAR_Error deleteFolder (string $path, string $name, [boolean $recursive = false])
 boolean isFolder (string $path, string $name)
 boolean|PEAR_Error listFolder ([string $path = ''], [mixed $filter = null], [boolean $dotfiles = true], [boolean $dironly = false])
 boolean|PEAR_Error listFolders ([string $path = ''], [mixed $filter = null], [boolean $dotfolders = true])
 boolean|PEAR_Error 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)
 boolean|PEAR_Error rename (string $oldpath, string $oldname, string $newpath, string $newname)
 boolean|PEAR_Error write (string $path, string $name, string $tmpFile, [boolean $autocreate = false])
 boolean|PEAR_Error writeData (string $path, string $name, string $data, [boolean $autocreate = false])
Variables
array $_credentials = array('username', 'password') (line 46)

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 $_permissions = array(
'owner' => array('read' => false, 'write' => false, 'execute' => false),'group'=>array('read'=>false,'write'=>false,'execute'=>false),'all'=>array('read'=>false,'write'=>false,'execute'=>false))
(line 53)

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.

Inherited Variables

Inherited from VFS

VFS::$_logger
VFS::$_logLevel
VFS::$_params
VFS::$_vfsSize
Methods
copy (line 507)

Copies a file through the backend.

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

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

Creates a folder on the VFS.

  • return: True on success or a PEAR_Error on failure.
boolean|PEAR_Error createFolder (string $path, string $name)
  • string $path: The path of directory to create folder.
  • string $name: The name of the new folder.

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

Deletes a file from the VFS.

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

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

Deletes a folder from the VFS.

  • return: True on success or a PEAR_Error on failure.
boolean|PEAR_Error deleteFolder (string $path, string $name, [boolean $recursive = false])
  • string $path: The path to delete the folder from.
  • 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.
isFolder (line 238)

Checks if a given pathname is a folder.

  • return: True if it is a folder, false otherwise.
boolean isFolder (string $path, string $name)
  • string $path: The path to the folder.
  • string $name: The file or folder name.

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

Returns an unsorted file list.

  • return: File list on success or a PEAR_Error on failure.
boolean|PEAR_Error listFolder ([string $path = ''], [mixed $filter = null], [boolean $dotfiles = true], [boolean $dironly = false])
  • string $path: The path of the directory to get the file list for.
  • mixed $filter: Hash of items to filter based on filename.
  • boolean $dotfiles: Show dotfiles? This is irrelevant with smbclient.
  • boolean $dironly: Show directories only?

Redefinition of:
VFS::listFolder()
Returns a file list of the directory passed in.
listFolders (line 468)

Returns a sorted list of folders in specified directory.

  • return: Folder list on success or a PEAR_Error on failure.
boolean|PEAR_Error 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? Irrelevant for SMB.

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

Moves a file through the backend.

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

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

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 110)

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 141)

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 312)

Renames a file in the VFS.

  • return: True on success or a PEAR_Error on failure.
boolean|PEAR_Error 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.
write (line 163)

Stores a file in the VFS.

  • return: True on success or a PEAR_Error on failure.
boolean|PEAR_Error 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 194)

Stores a file in the VFS from raw data.

  • return: True on success or a PEAR_Error on failure.
boolean|PEAR_Error 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.

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:21:27 +0000 by phpDocumentor 1.4.3