Search/Lucene/Storage/File/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 [email protected] 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
- 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
Methods

__construct(string $filename, string $mode = 'r+b') : voidClass constructor.
Open the file.
| Name | Type | Description |
|---|---|---|
| $filename | string | |
| $mode | string |

_fread(integer $length = 1) : stringRead a $length bytes from the file and advance the file pointer.
| Name | Type | Description |
|---|---|---|
| $length | integer |
| Type | Description |
|---|---|
| string |

_fwrite(string $data, integer $length = null) : voidWrites $length number of bytes (all, if $length===null) to the end of the file.
| Name | Type | Description |
|---|---|---|
| $data | string | |
| $length | integer |

flush() : booleanFlush output.
Returns true on success or false on failure.
| Type | Description |
|---|---|
| boolean |

lock(integer $lockType, boolean $nonBlockingLock = false) : booleanLock file
Lock type may be a LOCK_SH (shared lock) or a LOCK_EX (exclusive lock)
| Name | Type | Description |
|---|---|---|
| $lockType | integer | |
| $nonBlockingLock | boolean |
| Type | Description |
|---|---|
| boolean |

readBinary() : stringReads binary data from the current position in the file and advances the file pointer.
Inherited from: \Zend_Search_Lucene_Storage_File::readBinary()| Type | Description |
|---|---|
| string |

readByte() : integerReads a byte from the current position in the file and advances the file pointer.
Inherited from: \Zend_Search_Lucene_Storage_File::readByte()| Type | Description |
|---|---|
| integer |

readBytes(integer $num) : stringRead num bytes from the current position in the file and advances the file pointer.
Inherited from: \Zend_Search_Lucene_Storage_File::readBytes()| Name | Type | Description |
|---|---|---|
| $num | integer |
| Type | Description |
|---|---|
| string |

readInt() : integerReads an integer from the current position in the file and advances the file pointer.
Inherited from: \Zend_Search_Lucene_Storage_File::readInt()| Type | Description |
|---|---|
| integer |

readLong() : integer | floatReturns a long integer from the current position in the file and advances the file pointer.
Inherited from: \Zend_Search_Lucene_Storage_File::readLong()| Type | Description |
|---|---|
| integer | float |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

readLong32Bit() : integer | floatReturns 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()| Type | Description |
|---|---|
| integer | float |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

readString() : stringReads a string from the current position in the file and advances the file pointer.
Inherited from: \Zend_Search_Lucene_Storage_File::readString()| Type | Description |
|---|---|
| string |

readVInt() : integerReturns a variable-length integer from the current position in the file and advances the file pointer.
Inherited from: \Zend_Search_Lucene_Storage_File::readVInt()| Type | Description |
|---|---|
| integer |

seek(integer $offset, integer $whence = SEEK_SET) : integerSets 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
| Name | Type | Description |
|---|---|---|
| $offset | integer | |
| $whence | integer |
| Type | Description |
|---|---|
| integer |

writeByte(integer $byte) : voidWrites a byte to the end of the file.
Inherited from: \Zend_Search_Lucene_Storage_File::writeByte()| Name | Type | Description |
|---|---|---|
| $byte | integer |

writeBytes(string $data, integer $num = null) : voidWrites num bytes of data (all, if $num===null) to the end of the string.
Inherited from: \Zend_Search_Lucene_Storage_File::writeBytes()| Name | Type | Description |
|---|---|---|
| $data | string | |
| $num | integer |

writeInt(integer $value) : voidWrites an integer to the end of file.
Inherited from: \Zend_Search_Lucene_Storage_File::writeInt()| Name | Type | Description |
|---|---|---|
| $value | integer |

writeLong(integer $value) : voidWrites long integer to the end of file
Inherited from: \Zend_Search_Lucene_Storage_File::writeLong()| Name | Type | Description |
|---|---|---|
| $value | integer |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

writeLong32Bit(integer | float $value) : voidWrites long integer to the end of file (32-bit platforms implementation)
Inherited from: \Zend_Search_Lucene_Storage_File::writeLong32Bit()| Name | Type | Description |
|---|---|---|
| $value | integer | float |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

writeString(string $str) : voidWrites a string to the end of file.
Inherited from: \Zend_Search_Lucene_Storage_File::writeString()| Name | Type | Description |
|---|---|---|
| $str | string |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

writeVInt(integer $value) : voidWrites a variable-length integer to the end of file.
Inherited from: \Zend_Search_Lucene_Storage_File::writeVInt()| Name | Type | Description |
|---|---|---|
| $value | integer |