[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/VFS/ -> smb.php (sommaire)

(pas de description)

Poids: 679 lignes (24 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

VFS_smb:: (18 méthodes):
  _connect()
  read()
  write()
  writeData()
  deleteFile()
  isFolder()
  deleteFolder()
  rename()
  createFolder()
  listFolder()
  listFolders()
  copy()
  move()
  _getPath()
  _escapeShellCommand()
  _execute()
  _command()
  _createTempFile()


Classe: VFS_smb  - X-Ref

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

Required values for $params:
<pre>
'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.
</pre>

Optional values for $params:
<pre>
'ipaddress' - The address of the server to connect to.
</pre>

Functions not implemented:
- changePermissions(): The SMB permission style does not fit with the
module.

$Horde: framework/VFS/VFS/smb.php,v 1.11.2.8 2006/05/31 04:50:02 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.

_connect()   X-Ref
Authenticates a user on the SMB server and share.

return: boolean|PEAR_Error  True on success or a PEAR_Error on failure.

read($path, $name)   X-Ref
Retrieves a file from the VFS.

param: string $path  The pathname to the file.
param: string $name  The filename to retrieve.
return: string  The file data.

write($path, $name, $tmpFile, $autocreate = false)   X-Ref
Stores a file in the VFS.

param: string $path         The path to store the file in.
param: string $name         The filename to use.
param: string $tmpFile      The temporary file containing the data to be
param: boolean $autocreate  Automatically create directories?
return: boolean|PEAR_Error  True on success or a PEAR_Error on failure.

writeData($path, $name, $data, $autocreate = false)   X-Ref
Stores a file in the VFS from raw data.

param: string $path         The path to store the file in.
param: string $name         The filename to use.
param: string $data         The file data.
param: boolean $autocreate  Automatically create directories?
return: boolean|PEAR_Error  True on success or a PEAR_Error on failure.

deleteFile($path, $name)   X-Ref
Deletes a file from the VFS.

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

isFolder($path, $name)   X-Ref
Checks if a given pathname is a folder.

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

deleteFolder($path, $name, $recursive = false)   X-Ref
Deletes a folder from the VFS.

param: string $path        The path to delete the folder from.
param: string $name        The name of the folder to delete.
param: boolean $recursive  Force a recursive delete?
return: boolean|PEAR_Error  True on success or a PEAR_Error on failure.

rename($oldpath, $oldname, $newpath, $newname)   X-Ref
Renames a file in the VFS.

param: string $oldpath  The old path to the file.
param: string $oldname  The old filename.
param: string $newpath  The new path of the file.
param: string $newname  The new filename.
return: boolean|PEAR_Error  True on success or a PEAR_Error on failure.

createFolder($path, $name)   X-Ref
Creates a folder on the VFS.

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

listFolder($path = '', $filter = null, $dotfiles = true, $dironly = false)   X-Ref
Returns an unsorted file list.

param: string $path       The path of the directory to get the file list
param: mixed $filter      Hash of items to filter based on filename.
param: boolean $dotfiles  Show dotfiles? This is irrelevant with
param: boolean $dironly   Show directories only?
return: boolean|PEAR_Error  File list on success or a PEAR_Error on

listFolders($path = '', $filter = null, $dotfolders = true)   X-Ref
Returns a sorted list of folders in specified directory.

param: string $path         The path of the directory to get the
param: mixed $filter        Hash of items to filter based on folderlist.
param: boolean $dotfolders  Include dotfolders? Irrelevant for SMB.
return: boolean|PEAR_Error  Folder list on success or a PEAR_Error on

copy($path, $name, $dest)   X-Ref
Copies a file through the backend.

param: string $path  The path to store the file in.
param: string $name  The filename to use.
param: string $dest  The destination of the file.
return: boolean|PEAR_Error  True on success or a PEAR_Error on failure.

move($path, $name, $dest)   X-Ref
Moves a file through the backend.

param: string $path  The path to store the file in.
param: string $name  The filename to use.
param: string $dest  The destination of the file.
return: boolean|PEAR_Error  True on success or a PEAR_Error on failure.

_getPath($path, $name)   X-Ref
Returns the full path of an item.

param: string $path  The path of directory of the item.
param: string $name  The name of the item.
return: mixed  Full path when $path isset and just $name when not set.

_escapeShellCommand()   X-Ref
Replacement for escapeshellcmd(), variable length args, as we only want
certain characters escaped.

param: array $array  Strings to escape.
return: array

_execute($cmd)   X-Ref
Executes a command and returns output lines in array.

param: string $cmd  Command to be executed
return: mixed  Array on success, false on failure.

_command($path, $cmd)   X-Ref
Executes SMB commands - without authentication - and returns output
lines in array.

param: array $path  Base path for command.
param: array $cmd   Commands to be executed.
return: mixed  Array on success, false on failure.

_createTempFile($path, $name)   X-Ref
Retrieves a file from the VFS and stores it to a temporary file.

param: string $path  The pathname to the file.
param: string $name  The filename to retrieve.
return: mixed  The temporary filename or a PEAR_Error on failure.



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7