HumHub Documentation (unofficial)

Filesystem
in package
implements DirectoryInterface

FileSystem implementation of DirectoryInterface abstraction.

Tags
category

Zend

subpackage

Storage

Table of Contents

Interfaces

DirectoryInterface

Properties

$_defaultFilePermissions  : int
Default file permissions
$_dirPath  : string
Filesystem path to the directory
$_fileHandlers  : array<string|int, mixed>
Cache for Zend_Search_Lucene_Storage_File_Filesystem objects Array: filename => Zend_Search_Lucene_Storage_File object

Methods

__construct()  : mixed
Object constructor Checks if $path is a directory or tries to create it.
close()  : void
Closes the store.
createFile()  : FileInterface
Creates a new, empty file in the directory with the given $filename.
deleteFile()  : void
Removes an existing $filename in the directory.
fileExists()  : bool
Returns true if a file with the given $filename exists.
fileLength()  : int
Returns the length of a $filename in the directory.
fileList()  : array<string|int, mixed>
Returns an array of strings, one for each file in the directory.
fileModified()  : int
Returns the UNIX timestamp $filename was last modified.
getDefaultFilePermissions()  : int
Get default file permissions
getFileObject()  : FileInterface
Returns a Zend_Search_Lucene_Storage_File object for a given $filename in the directory.
mkdirs()  : bool
Utility function to recursive directory creation
purgeFile()  : void
Purge file if it's cached by directory object
renameFile()  : void
Renames an existing file in the directory.
setDefaultFilePermissions()  : void
Set default file permissions
touchFile()  : void
Sets the modified time of $filename to now.

Properties

$_defaultFilePermissions

Default file permissions

protected static int $_defaultFilePermissions = 0666

$_dirPath

Filesystem path to the directory

protected string $_dirPath = null

$_fileHandlers

Cache for Zend_Search_Lucene_Storage_File_Filesystem objects Array: filename => Zend_Search_Lucene_Storage_File object

protected array<string|int, mixed> $_fileHandlers
Tags
throws
ExceptionInterface

Methods

__construct()

Object constructor Checks if $path is a directory or tries to create it.

public __construct(string $path) : mixed
Parameters
$path : string
Tags
throws
InvalidArgumentException

close()

Closes the store.

public close() : void

createFile()

Creates a new, empty file in the directory with the given $filename.

public createFile(string $filename) : FileInterface
Parameters
$filename : string
Return values
FileInterface

deleteFile()

Removes an existing $filename in the directory.

public deleteFile(string $filename) : void
Parameters
$filename : string
Tags
throws
RuntimeException

fileExists()

Returns true if a file with the given $filename exists.

public fileExists(string $filename) : bool
Parameters
$filename : string
Return values
bool

fileLength()

Returns the length of a $filename in the directory.

public fileLength(string $filename) : int
Parameters
$filename : string
Return values
int

fileList()

Returns an array of strings, one for each file in the directory.

public fileList() : array<string|int, mixed>
Return values
array<string|int, mixed>

fileModified()

Returns the UNIX timestamp $filename was last modified.

public fileModified(string $filename) : int
Parameters
$filename : string
Return values
int

getDefaultFilePermissions()

Get default file permissions

public static getDefaultFilePermissions() : int
Return values
int

getFileObject()

Returns a Zend_Search_Lucene_Storage_File object for a given $filename in the directory.

public getFileObject(string $filename[, bool $shareHandler = true ]) : FileInterface

If $shareHandler option is true, then file handler can be shared between File Object requests. It speed-ups performance, but makes problems with file position. Shared handler are good for short atomic requests. Non-shared handlers are useful for stream file reading (especial for compound files).

Parameters
$filename : string
$shareHandler : bool = true
Return values
FileInterface

mkdirs()

Utility function to recursive directory creation

public static mkdirs(string $dir[, int $mode = 0777 ][, bool $recursive = true ]) : bool
Parameters
$dir : string
$mode : int = 0777
$recursive : bool = true
Return values
bool

purgeFile()

Purge file if it's cached by directory object

public purgeFile(string $filename) : void

Method is used to prevent 'too many open files' error

Parameters
$filename : string

renameFile()

Renames an existing file in the directory.

public renameFile(string $from, string $to) : void
Parameters
$from : string
$to : string
Tags
throws
RuntimeException

setDefaultFilePermissions()

Set default file permissions

public static setDefaultFilePermissions(int $mode) : void
Parameters
$mode : int

touchFile()

Sets the modified time of $filename to now.

public touchFile(string $filename) : void
Parameters
$filename : string

        
On this page

Search results