Search/Lucene/Storage/Directory/Filesystem.php

Show: PublicProtectedPrivateinherited
Table of Contents
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
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

>VPropertyprotectedinteger $_defaultFilePermissions = 438
static
Default file permissions
Default value438Details
Type
integer
>VPropertyprotectedstring $_dirPath = null
Filesystem path to the directory
Default valuenullDetails
Type
string
>VPropertyprotectedarray $_fileHandlers
Cache for Zend_Search_Lucene_Storage_File_Filesystem objects Array: filename => Zend_Search_Lucene_Storage_File object

Methods

methodpublic__construct(string $path) : void

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

Parameters
NameTypeDescription
$pathstring
Throws
ExceptionDescription
\Zend_Search_Lucene_Exception
methodpublicclose() : void

Closes the store.

methodpubliccreateFile(string $filename) : \Zend_Search_Lucene_Storage_File

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

Parameters
NameTypeDescription
$filenamestring
Returns
TypeDescription
\Zend_Search_Lucene_Storage_File
Throws
ExceptionDescription
\Zend_Search_Lucene_Exception
methodpublicdeleteFile(string $filename) : void

Removes an existing $filename in the directory.

Parameters
NameTypeDescription
$filenamestring
Throws
ExceptionDescription
\Zend_Search_Lucene_Exception
methodpublicfileExists(string $filename) : boolean

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

Parameters
NameTypeDescription
$filenamestring
Returns
TypeDescription
boolean
methodpublicfileLength(string $filename) : integer

Returns the length of a $filename in the directory.

Parameters
NameTypeDescription
$filenamestring
Returns
TypeDescription
integer
methodpublicfileList() : array

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

Returns
TypeDescription
array
methodpublicfileModified(string $filename) : integer

Returns the UNIX timestamp $filename was last modified.

Parameters
NameTypeDescription
$filenamestring
Returns
TypeDescription
integer
methodpublicgetDefaultFilePermissions() : integer
static

Get default file permissions

Returns
TypeDescription
integer
methodpublicgetFileObject(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).
Parameters
NameTypeDescription
$filenamestring
$shareHandlerboolean
Returns
TypeDescription
\Zend_Search_Lucene_Storage_File
methodpublicmkdirs(string $dir, integer $mode = 511, boolean $recursive = true) : boolean
static

Utility function to recursive directory creation

Parameters
NameTypeDescription
$dirstring
$modeinteger
$recursiveboolean
Returns
TypeDescription
boolean
methodpublicpurgeFile(string $filename) : void

Purge file if it's cached by directory object

Method is used to prevent 'too many open files' error
Parameters
NameTypeDescription
$filenamestring
methodpublicrenameFile(string $from, string $to) : void

Renames an existing file in the directory.

Parameters
NameTypeDescription
$fromstring
$tostring
Throws
ExceptionDescription
\Zend_Search_Lucene_Exception
methodpublicsetDefaultFilePermissions(integer $mode) : void
static

Set default file permissions

Parameters
NameTypeDescription
$modeinteger
methodpublictouchFile(string $filename) : void

Sets the modified time of $filename to now.

Parameters
NameTypeDescription
$filenamestring
Documentation was generated by phpDocumentor 2.2.0 .