MediaWiki  REL1_22
CdbReader_PHP Class Reference

CDB reader class. More...

Inheritance diagram for CdbReader_PHP:
Collaboration diagram for CdbReader_PHP:

List of all members.

Public Member Functions

 __construct ($fileName)
 close ()
 Close the file.
 get ($key)

Public Attributes

 $dlen
 $dpos
 $fileName
 The filename.
 $handle
 The file handle.
 $hpos
 $hslots
 $khash
 $kpos
 $loop

Protected Member Functions

 find ($key)
 findNext ($key)
 findStart ()
 match ($key, $pos)
 read ($length, $pos)
 unpack31 ($s)
 Unpack an unsigned integer and throw an exception if it needs more than 31 bits.
 unpackSigned ($s)
 Unpack a 32-bit signed integer.

Detailed Description

CDB reader class.

Definition at line 99 of file Cdb_PHP.php.


Constructor & Destructor Documentation

CdbReader_PHP::__construct ( fileName)
Parameters:
$fileNamestring
Exceptions:
MWException

Reimplemented from CdbReader.

Definition at line 131 of file Cdb_PHP.php.

References $fileName, and findStart().


Member Function Documentation

Close the file.

Optional, you can just let the variable go out of scope.

Reimplemented from CdbReader.

Definition at line 140 of file Cdb_PHP.php.

CdbReader_PHP::find ( key) [protected]
Parameters:
$key
Returns:
bool

Definition at line 274 of file Cdb_PHP.php.

References $key, findNext(), and findStart().

Referenced by get().

CdbReader_PHP::findNext ( key) [protected]
Parameters:
$key
Returns:
bool

Definition at line 228 of file Cdb_PHP.php.

References $key, CdbFunctions\hash(), match(), read(), unpack31(), unpackSigned(), CdbFunctions\unsignedMod(), and CdbFunctions\unsignedShiftRight().

Referenced by find().

CdbReader_PHP::findStart ( ) [protected]

Definition at line 170 of file Cdb_PHP.php.

Referenced by __construct(), and find().

CdbReader_PHP::get ( key)
Parameters:
$key
Returns:
bool|string

Reimplemented from CdbReader.

Definition at line 151 of file Cdb_PHP.php.

References $key, find(), and read().

CdbReader_PHP::match ( key,
pos 
) [protected]
Parameters:
$key
$pos
Returns:
bool

Definition at line 165 of file Cdb_PHP.php.

References $key, and read().

Referenced by findNext().

CdbReader_PHP::read ( length,
pos 
) [protected]
Exceptions:
MWException
Parameters:
$length
$pos
Returns:
string

Definition at line 180 of file Cdb_PHP.php.

Referenced by findNext(), get(), and match().

CdbReader_PHP::unpack31 ( s) [protected]

Unpack an unsigned integer and throw an exception if it needs more than 31 bits.

Parameters:
$s
Exceptions:
MWException
Returns:
mixed

Definition at line 205 of file Cdb_PHP.php.

References $s.

Referenced by findNext().

CdbReader_PHP::unpackSigned ( s) [protected]

Unpack a 32-bit signed integer.

Parameters:
$s
Returns:
int

Definition at line 219 of file Cdb_PHP.php.

References $s.

Referenced by findNext().


Member Data Documentation

CdbReader_PHP::$dlen

Definition at line 125 of file Cdb_PHP.php.

CdbReader_PHP::$dpos

Definition at line 122 of file Cdb_PHP.php.

CdbReader_PHP::$fileName

The filename.

Definition at line 101 of file Cdb_PHP.php.

Referenced by __construct().

CdbReader_PHP::$handle

The file handle.

Definition at line 104 of file Cdb_PHP.php.

CdbReader_PHP::$hpos

Definition at line 116 of file Cdb_PHP.php.

CdbReader_PHP::$hslots

Definition at line 119 of file Cdb_PHP.php.

CdbReader_PHP::$khash

Definition at line 110 of file Cdb_PHP.php.

CdbReader_PHP::$kpos

Definition at line 113 of file Cdb_PHP.php.

CdbReader_PHP::$loop

Definition at line 107 of file Cdb_PHP.php.


The documentation for this class was generated from the following file: