Filesystem
in package
implements
DirectoryInterface
FileSystem implementation of DirectoryInterface abstraction.
Tags
Table of Contents
Interfaces
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
Methods
__construct()
Object constructor Checks if $path is a directory or tries to create it.
public
__construct(string $path) : mixed
Parameters
- $path : string
Tags
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
FileInterfacedeleteFile()
Removes an existing $filename in the directory.
public
deleteFile(string $filename) : void
Parameters
- $filename : string
Tags
fileExists()
Returns true if a file with the given $filename exists.
public
fileExists(string $filename) : bool
Parameters
- $filename : string
Return values
boolfileLength()
Returns the length of a $filename in the directory.
public
fileLength(string $filename) : int
Parameters
- $filename : string
Return values
intfileList()
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
intgetDefaultFilePermissions()
Get default file permissions
public
static getDefaultFilePermissions() : int
Return values
intgetFileObject()
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
FileInterfacemkdirs()
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
boolpurgeFile()
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
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