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.
FileSystem implementation of Directory abstraction.

integer
$_defaultFilePermissions= '0666'
Default file permissions
0666
Details
array
$_fileHandlers= ''
Cache for Zend_Search_Lucene_Storage_File_Filesystem objects Array: filename => Zend_Search_Lucene_Storage_File object

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

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

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

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

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

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

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

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

getFileObject(
string $filename, boolean $shareHandler
=
true
)
:
\Zend_Search_Lucene_Storage_File
Returns 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).
Name | Type | Description |
---|---|---|
$filename | string | |
$shareHandler | boolean |
Type | Description |
---|---|
\Zend_Search_Lucene_Storage_File |

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

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

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

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