PHP 클래스 Horde_Vfs_File, horde

Copyright 2002-2016 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.
저자: Chuck Hagenbuch
상속: extends Horde_Vfs_Base
파일 보기 프로젝트 열기: horde/horde

보호된 프로퍼티들

프로퍼티 타입 설명
$_features array List of features that the VFS driver supports.
$_permissions array List of permissions and if they can be changed in this VFS backend.

공개 메소드들

메소드 설명
__construct ( array $params = [] ) Constructs a new Filesystem based VFS object.
changePermissions ( string $path, string $name, string $permission ) Changes permissions for an item in the VFS.
copy ( string $path, string $name, string $dest, boolean $autocreate = false ) Copies a file through the backend.
createFolder ( string $path, string $name ) Creates a folder on the VFS.
deleteFile ( string $path, string $name ) Delete a file from the VFS.
deleteFolder ( string $path, string $name, boolean $recursive = false ) Delete a folder from the VFS.
exists ( string $path, string $name ) : boolean Returns if a given file or folder exists in a folder.
isFolder ( string $path, string $name ) : boolean Check if a given pathname is a folder.
move ( string $path, string $name, string $dest, boolean $autocreate = false ) Moves a file in the database and the file system.
read ( string $path, string $name ) : string Retrieve a file from the VFS.
readByteRange ( string $path, string $name, integer &$offset, integer $length, integer &$remaining ) : 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.
readFile ( string $path, string $name ) : string Retrieves a file from the VFS as an on-disk local file.
readStream ( string $path, string $name ) : resource Open a read-only stream to a file in the VFS.
rename ( string $oldpath, string $oldname, string $newpath, string $newname ) Rename a file or folder in the VFS.
size ( string $path, string $name ) : integer Retrieves the filesize from the VFS.
write ( string $path, string $name, string $tmpFile, boolean $autocreate = false ) Store a file in the VFS, with the data copied from a temporary file.
writeData ( string $path, string $name, string $data, boolean $autocreate = false ) Store a file in the VFS from raw data.

보호된 메소드들

메소드 설명
_connect ( ) Make sure that the vfsroot is readable.
_getNativePath ( string $path = '', string $name = '' ) : string Return a full filename on the native filesystem, from a VFS path and name.
_getUnixPerms ( integer $perms ) : string Return Unix style perms.
_listFolder ( string $path, string | array $filter = null, boolean $dotfiles = true, boolean $dironly = false ) : array Returns an unsorted file list of the specified directory.

메소드 상세

__construct() 공개 메소드

Constructs a new Filesystem based VFS object.
public __construct ( array $params = [] )
$params array 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.

_connect() 보호된 메소드

Make sure that the vfsroot is readable.
protected _connect ( )

_getNativePath() 보호된 메소드

Return a full filename on the native filesystem, from a VFS path and name.
protected _getNativePath ( string $path = '', string $name = '' ) : string
$path string The VFS file path.
$name string The VFS filename.
리턴 string The full native filename.

_getUnixPerms() 보호된 메소드

Return Unix style perms.
protected _getUnixPerms ( integer $perms ) : string
$perms integer The permissions to set.
리턴 string Unix style perms.

_listFolder() 보호된 메소드

Returns an unsorted file list of the specified directory.
protected _listFolder ( string $path, string | array $filter = null, boolean $dotfiles = true, boolean $dironly = false ) : array
$path string The path of the directory.
$filter string | array Regular expression(s) to filter file/directory name on.
$dotfiles boolean Show dotfiles?
$dironly boolean Show only directories?
리턴 array File list.

changePermissions() 공개 메소드

Changes permissions for an item in the VFS.
public changePermissions ( string $path, string $name, string $permission )
$path string The path of directory of the item.
$name string The name of the item.
$permission string The permission to set in octal notation.

copy() 공개 메소드

Copies a file through the backend.
public copy ( string $path, string $name, string $dest, boolean $autocreate = false )
$path string The path to store the file in.
$name string The filename to use.
$dest string The destination of the file.
$autocreate boolean Automatically create directories?

createFolder() 공개 메소드

Creates a folder on the VFS.
public createFolder ( string $path, string $name )
$path string The path to create the folder in.
$name string The foldername to use.

deleteFile() 공개 메소드

Delete a file from the VFS.
public deleteFile ( string $path, string $name )
$path string The path to store the file in.
$name string The filename to use.

deleteFolder() 공개 메소드

Delete a folder from the VFS.
public deleteFolder ( string $path, string $name, boolean $recursive = false )
$path string The path to delete the folder from.
$name string The foldername to use.
$recursive boolean Force a recursive delete?

exists() 공개 메소드

Returns if a given file or folder exists in a folder.
public exists ( string $path, string $name ) : boolean
$path string The path to the folder.
$name string The file or folder name.
리턴 boolean True if it exists, false otherwise.

isFolder() 공개 메소드

Check if a given pathname is a folder.
public isFolder ( string $path, string $name ) : boolean
$path string The path to the folder.
$name string The file/folder name.
리턴 boolean True if it is a folder, false otherwise.

move() 공개 메소드

Moves a file in the database and the file system.
public move ( string $path, string $name, string $dest, boolean $autocreate = false )
$path string The path to store the file in.
$name string The filename to use.
$dest string The destination of the file.
$autocreate boolean Automatically create directories?

read() 공개 메소드

Retrieve a file from the VFS.
public read ( string $path, string $name ) : string
$path string The pathname to the file.
$name string The filename to retrieve.
리턴 string The file data.

readByteRange() 공개 메소드

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.
public readByteRange ( string $path, string $name, integer &$offset, integer $length, integer &$remaining ) : string
$path string The pathname to the file.
$name string The filename to retrieve.
$offset integer The offset of the part. (The new offset will be stored in here).
$length integer 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.
$remaining integer The bytes that are left, after the part that is retrieved.
리턴 string The file data.

readFile() 공개 메소드

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.
public readFile ( string $path, string $name ) : string
$path string The pathname to the file.
$name string The filename to retrieve.
리턴 string A local filename.

readStream() 공개 메소드

Open a read-only stream to a file in the VFS.
public readStream ( string $path, string $name ) : resource
$path string The pathname to the file.
$name string The filename to retrieve.
리턴 resource The stream.

rename() 공개 메소드

Rename a file or folder in the VFS.
public rename ( string $oldpath, string $oldname, string $newpath, string $newname )
$oldpath string The old path to the file.
$oldname string The old filename.
$newpath string The new path of the file.
$newname string The new filename.

size() 공개 메소드

Retrieves the filesize from the VFS.
public size ( string $path, string $name ) : integer
$path string The pathname to the file.
$name string The filename to retrieve.
리턴 integer The file size.

write() 공개 메소드

Store a file in the VFS, with the data copied from a temporary file.
public write ( string $path, string $name, string $tmpFile, boolean $autocreate = false )
$path string The path to store the file in.
$name string The filename to use.
$tmpFile string The temporary file containing the data to be stored.
$autocreate boolean Automatically create directories?

writeData() 공개 메소드

Store a file in the VFS from raw data.
public writeData ( string $path, string $name, string $data, boolean $autocreate = false )
$path string The path to store the file in.
$name string The filename to use.
$data string The file data.
$autocreate boolean Automatically create directories?

프로퍼티 상세

$_features 보호되어 있는 프로퍼티

List of features that the VFS driver supports.
protected array $_features
리턴 array

$_permissions 보호되어 있는 프로퍼티

List of permissions and if they can be changed in this VFS backend.
protected array $_permissions
리턴 array