Search/Lucene/Storage/File/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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Search_Lucene  
Subpackage
Storage  
Version
$Id: Filesystem.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Search_Lucene_Storage_File_Filesystem

Package: Zend\Search\Lucene\Storage
Parent(s)
\Zend_Search_Lucene_Storage_File
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedresource $_fileHandle
Resource of the open file
Details
Type
resource

Methods

methodpublic__construct(string $filename, string $mode = 'r+b') : void

Class constructor.

Open the file.

Parameters
NameTypeDescription
$filenamestring
$modestring
methodprotected_fread(integer $length = 1) : string

Read a $length bytes from the file and advance the file pointer.

Parameters
NameTypeDescription
$lengthinteger
Returns
TypeDescription
string
methodprotected_fwrite(string $data, integer $length = null) : void

Writes $length number of bytes (all, if $length===null) to the end of the file.

Parameters
NameTypeDescription
$datastring
$lengthinteger
methodpublicclose() : void

Close File object

methodpublicflush() : boolean

Flush output.

Returns true on success or false on failure.

Returns
TypeDescription
boolean
methodpubliclock(integer $lockType, boolean $nonBlockingLock = false) : boolean

Lock file

Lock type may be a LOCK_SH (shared lock) or a LOCK_EX (exclusive lock)

Parameters
NameTypeDescription
$lockTypeinteger
$nonBlockingLockboolean
Returns
TypeDescription
boolean
methodpublicreadBinary() : string
inherited

Reads binary data from the current position in the file and advances the file pointer.

Inherited from: \Zend_Search_Lucene_Storage_File::readBinary()
Returns
TypeDescription
string
methodpublicreadByte() : integer
inherited

Reads a byte from the current position in the file and advances the file pointer.

Inherited from: \Zend_Search_Lucene_Storage_File::readByte()
Returns
TypeDescription
integer
methodpublicreadBytes(integer $num) : string
inherited

Read num bytes from the current position in the file and advances the file pointer.

Inherited from: \Zend_Search_Lucene_Storage_File::readBytes()
Parameters
NameTypeDescription
$numinteger
Returns
TypeDescription
string
methodpublicreadInt() : integer
inherited

Reads an integer from the current position in the file and advances the file pointer.

Inherited from: \Zend_Search_Lucene_Storage_File::readInt()
Returns
TypeDescription
integer
methodpublicreadLong() : integer | float
inherited

Returns a long integer from the current position in the file and advances the file pointer.

Inherited from: \Zend_Search_Lucene_Storage_File::readLong()
Returns
TypeDescription
integer | float
Throws
ExceptionDescription
\Zend_Search_Lucene_Exception
methodpublicreadLong32Bit() : integer | float
inherited

Returns a long integer from the current position in the file, advances the file pointer and return it as float (for 32-bit platforms).

Inherited from: \Zend_Search_Lucene_Storage_File::readLong32Bit()
Returns
TypeDescription
integer | float
Throws
ExceptionDescription
\Zend_Search_Lucene_Exception
methodpublicreadString() : string
inherited

Reads a string from the current position in the file and advances the file pointer.

Inherited from: \Zend_Search_Lucene_Storage_File::readString()
Returns
TypeDescription
string
methodpublicreadVInt() : integer
inherited

Returns a variable-length integer from the current position in the file and advances the file pointer.

Inherited from: \Zend_Search_Lucene_Storage_File::readVInt()
Returns
TypeDescription
integer
methodpublicseek(integer $offset, integer $whence = SEEK_SET) : integer

Sets the file position indicator and advances the file pointer.

The new position, measured in bytes from the beginning of the file, is obtained by adding offset to the position specified by whence, whose values are defined as follows: SEEK_SET - Set position equal to offset bytes. SEEK_CUR - Set position to current location plus offset. SEEK_END - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.) SEEK_CUR is the only supported offset type for compound files

Upon success, returns 0; otherwise, returns -1

Parameters
NameTypeDescription
$offsetinteger
$whenceinteger
Returns
TypeDescription
integer
methodpublicsize() : integer

Get the size of the already opened file

Returns
TypeDescription
integer
methodpublictell() : integer

Get file position.

Returns
TypeDescription
integer
methodpublicunlock() : boolean

Unlock file

Returns true on success

Returns
TypeDescription
boolean
methodpublicwriteByte(integer $byte) : void
inherited

Writes a byte to the end of the file.

Inherited from: \Zend_Search_Lucene_Storage_File::writeByte()
Parameters
NameTypeDescription
$byteinteger
methodpublicwriteBytes(string $data, integer $num = null) : void
inherited

Writes num bytes of data (all, if $num===null) to the end of the string.

Inherited from: \Zend_Search_Lucene_Storage_File::writeBytes()
Parameters
NameTypeDescription
$datastring
$numinteger
methodpublicwriteInt(integer $value) : void
inherited

Writes an integer to the end of file.

Inherited from: \Zend_Search_Lucene_Storage_File::writeInt()
Parameters
NameTypeDescription
$valueinteger
methodpublicwriteLong(integer $value) : void
inherited

Writes long integer to the end of file

Inherited from: \Zend_Search_Lucene_Storage_File::writeLong()
Parameters
NameTypeDescription
$valueinteger
Throws
ExceptionDescription
\Zend_Search_Lucene_Exception
methodpublicwriteLong32Bit(integer | float $value) : void
inherited

Writes long integer to the end of file (32-bit platforms implementation)

Inherited from: \Zend_Search_Lucene_Storage_File::writeLong32Bit()
Parameters
NameTypeDescription
$valueinteger | float
Throws
ExceptionDescription
\Zend_Search_Lucene_Exception
methodpublicwriteString(string $str) : void
inherited

Writes a string to the end of file.

Inherited from: \Zend_Search_Lucene_Storage_File::writeString()
Parameters
NameTypeDescription
$strstring
Throws
ExceptionDescription
\Zend_Search_Lucene_Exception
methodpublicwriteVInt(integer $value) : void
inherited

Writes a variable-length integer to the end of file.

Inherited from: \Zend_Search_Lucene_Storage_File::writeVInt()
Parameters
NameTypeDescription
$valueinteger
Documentation was generated by phpDocumentor 2.0.0a12.