HumHub Documentation (unofficial)

DirectoryInterface

Tags
category

Zend

subpackage

Storage

Table of Contents

Methods

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.
getFileObject()  : FileInterface
Returns a Zend_Search_Lucene_Storage_File object for a given $filename in the directory.
purgeFile()  : void
Purge file if it's cached by directory object
renameFile()  : void
Renames an existing file in the directory.
touchFile()  : void
Sets the modified time of $filename to now.

Methods

deleteFile()

Removes an existing $filename in the directory.

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

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

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

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

touchFile()

Sets the modified time of $filename to now.

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

        
On this page

Search results