Search/Lucene/Storage/Directory/Filesystem.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Search_Lucene
- Subpackage
- Storage
- Version
- $Id$
\Zend_Search_Lucene_Storage_Directory_Filesystem
Package: Zend_Search_Lucene\Storage










Returns




FileSystem implementation of Directory abstraction.
- Parent(s)
- \Zend_Search_Lucene_Storage_Directory
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

integer $_defaultFilePermissions = 438static
Default file permissions
Default value
438Details- Type
- integer

array $_fileHandlersCache for Zend_Search_Lucene_Storage_File_Filesystem objects
Array: filename => Zend_Search_Lucene_Storage_File object
Details
- Type
- array
Methods

__construct(string $path) : voidObject constructor Checks if $path is a directory or tries to create it.
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $path | string |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

createFile(string $filename) : \Zend_Search_Lucene_Storage_FileCreates a new, empty file in the directory with the given $filename.
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Storage_File |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

deleteFile(string $filename) : voidRemoves an existing $filename in the directory.
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

fileExists(string $filename) : booleanReturns true if a file with the given $filename exists.
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Type | Description |
|---|---|
| boolean |

fileLength(string $filename) : integerReturns the length of a $filename in the directory.
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Type | Description |
|---|---|
| integer |

fileList() : arrayReturns an array of strings, one for each file in the directory.
Returns
| Type | Description |
|---|---|
| array |

fileModified(string $filename) : integerReturns the UNIX timestamp $filename was last modified.
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Type | Description |
|---|---|
| integer |

getDefaultFilePermissions() : integerstatic
Get default file permissions
Returns
| Type | Description |
|---|---|
| integer |

getFileObject(string $filename, boolean $shareHandler = true) : \Zend_Search_Lucene_Storage_FileReturns a Zend_Search_Lucene_Storage_File object for a given $filename in the directory.
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| Name | Type | Description |
|---|---|---|
| $filename | string | |
| $shareHandler | boolean |
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Storage_File |

mkdirs(string $dir, integer $mode = 511, boolean $recursive = true) : booleanstatic
Utility function to recursive directory creation
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $dir | string | |
| $mode | integer | |
| $recursive | boolean |
| Type | Description |
|---|---|
| boolean |

purgeFile(string $filename) : voidPurge file if it's cached by directory object
Method is used to prevent 'too many open files' error
Parameters| Name | Type | Description |
|---|---|---|
| $filename | string |

renameFile(string $from, string $to) : voidRenames an existing file in the directory.
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $from | string | |
| $to | string |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

setDefaultFilePermissions(integer $mode) : voidstatic
Set default file permissions
Parameters
| Name | Type | Description |
|---|---|---|
| $mode | integer |