Overview

Packages

  • Vfs

Classes

  • Horde_Vfs
  • Horde_Vfs_Base
  • Horde_Vfs_Browser
  • Horde_Vfs_Exception
  • Horde_Vfs_File
  • Horde_Vfs_Ftp
  • Horde_Vfs_Gc
  • Horde_Vfs_Horde
  • Horde_Vfs_Kolab
  • Horde_Vfs_ListItem
  • Horde_Vfs_Musql
  • Horde_Vfs_Object
  • Horde_Vfs_Smb
  • Horde_Vfs_Sql
  • Horde_Vfs_SqlFile
  • Horde_Vfs_Ssh2
  • Horde_Vfs_Translation
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Vfs_File

VFS implementation for a filesystem.

Copyright 2002-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Horde_Vfs_Base
Extended by Horde_Vfs_File

Direct known subclasses

Horde_Vfs_SqlFile
Package: Vfs
Author: Chuck Hagenbuch
Located at Horde/Vfs/File.php
Methods summary
public
# __construct( array $params = array() )

Constructs a new Filesystem based VFS object.

Constructs a new Filesystem based VFS object.

Parameters

$params
<p>A hash containing connection parameters. REQUIRED parameters: - vfsroot: (string) The root path. Note: The user that your webserver runs as MUST have read/write permission to this directory.</p>

Overrides

Horde_Vfs_Base::__construct()
public integer
# size( string $path, string $name )

Retrieves the filesize from the VFS.

Retrieves the filesize from the VFS.

Parameters

$path
The pathname to the file.
$name
The filename to retrieve.

Returns

integer
The file size.

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::size()
public string
# read( string $path, string $name )

Retrieve a file from the VFS.

Retrieve a file from the VFS.

Parameters

$path
The pathname to the file.
$name
The filename to retrieve.

Returns

string
The file data.

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::read()
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

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::readFile()
public resource
# readStream( string $path, string $name )

Open a read-only stream to a file in the VFS.

Open a read-only stream to a file in the VFS.

Parameters

$path
The pathname to the file.
$name
The filename to retrieve.

Returns

resource
The stream.

Throws

Horde_Vfs_Exception
public string
# readByteRange( string $path, string $name, integer & $offset, integer $length, integer & $remaining )

Retrieves a part of a file from the VFS. Particularly useful when reading large files which would exceed the PHP memory limits if they were stored in a string.

Retrieves a part of a file from the VFS. Particularly useful when reading large files which would exceed the PHP memory limits if they were stored in a string.

Parameters

$path
The pathname to the file.
$name
The filename to retrieve.
$offset
<p>The offset of the part. (The new offset will be stored in here).</p>
$length
<p>The length of the part. If the length = -1, the whole part after the offset is retrieved. If more bytes are given as exists after the given offset. Only the available bytes are read.</p>
$remaining
<p>The bytes that are left, after the part that is retrieved.</p>

Returns

string
The file data.

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::readByteRange()
public
# write( string $path, string $name, string $tmpFile, boolean $autocreate = false )

Store a file in the VFS, with the data copied from a temporary file.

Store a file in the VFS, with the data copied from a temporary file.

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

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::write()
public
# move( string $path, string $name, string $dest, boolean $autocreate = false )

Moves a file in the database and the file system.

Moves a file in the database and the file system.

Parameters

$path
The path to store the file in.
$name
The filename to use.
$dest
The destination of the file.
$autocreate
Automatically create directories?

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::move()
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 to store the file in.
$name
The filename to use.
$dest
The destination of the file.
$autocreate
Automatically create directories?

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::copy()
public
# writeData( string $path, string $name, string $data, boolean $autocreate = false )

Store a file in the VFS from raw data.

Store 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

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::writeData()
public
# deleteFile( string $path, string $name )

Delete a file from the VFS.

Delete a file from the VFS.

Parameters

$path
The path to store the file in.
$name
The filename to use.

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::deleteFile()
public
# deleteFolder( string $path, string $name, boolean $recursive = false )

Delete a folder from the VFS.

Delete a folder from the VFS.

Parameters

$path
The path to delete the folder from.
$name
The foldername to use.
$recursive
Force a recursive delete?

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::deleteFolder()
public
# createFolder( string $path, string $name )

Creates a folder on the VFS.

Creates a folder on the VFS.

Parameters

$path
The path to create the folder in.
$name
The foldername to use.

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::createFolder()
public boolean
# isFolder( string $path, string $name )

Check if a given pathname is a folder.

Check if a given pathname is a folder.

Parameters

$path
The path to the folder.
$name
The file/folder name.

Returns

boolean
True if it is a folder, false otherwise.

Overrides

Horde_Vfs_Base::isFolder()
public
# changePermissions( string $path, string $name, string $permission )

Changes permissions for an item in the VFS.

Changes permissions for an item in the VFS.

Parameters

$path
The path of directory of the item.
$name
The name of the item.
$permission
The permission to set in octal notation.

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::changePermissions()
public array
# listFolders( string $path = '', mixed $filter = null, boolean $dotfolders = true )

Returns a sorted list of folders in specified directory.

Returns a sorted list of folders in 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

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::listFolders()
public
# rename( string $oldpath, string $oldname, string $newpath, string $newname )

Rename a file or folder in the VFS.

Rename a file or folder 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

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::rename()
public boolean
# exists( string $path, string $name )

Returns if a given file or folder exists in a folder.

Returns if a given file or folder exists in a folder.

Parameters

$path
The path to the folder.
$name
The file or folder name.

Returns

boolean
True if it exists, false otherwise.

Overrides

Horde_Vfs_Base::exists()
Methods inherited from Horde_Vfs_Base
autocreatePath(), checkCredentials(), delete(), emptyFolder(), getCurrentDirectory(), getFolderSize(), getModifiablePermissions(), getParam(), getQuota(), getRequiredCredentials(), getVFSSize(), listFolder(), setParams(), setQuota(), setQuotaRoot()
API documentation generated by ApiGen