MediaWiki  1.23.8
CdbReaderPHP Class Reference

CDB reader class. More...

Inheritance diagram for CdbReaderPHP:
Collaboration diagram for CdbReaderPHP:

Public Member Functions

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

Public Attributes

 $dlen
 
 $dpos
 
 $fileName
 The filename. More...
 
 $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. More...
 
 unpackSigned ( $s)
 Unpack a 32-bit signed integer. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CdbReader
static haveExtension ()
 Returns true if the native extension is available. More...
 
static open ( $fileName)
 Open a file and return a subclass instance. More...
 
- Protected Attributes inherited from CdbReader
 $handle
 The file handle. More...
 

Detailed Description

CDB reader class.

Definition at line 102 of file CdbPHP.php.

Constructor & Destructor Documentation

◆ __construct()

CdbReaderPHP::__construct (   $fileName)
Parameters
$fileNamestring
Exceptions
CdbException

Reimplemented from CdbReader.

Definition at line 131 of file CdbPHP.php.

References $fileName, and findStart().

Member Function Documentation

◆ close()

CdbReaderPHP::close ( )

Close the file.

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

Reimplemented from CdbReader.

Definition at line 140 of file CdbPHP.php.

◆ find()

CdbReaderPHP::find (   $key)
protected
Parameters
$key
Returns
bool

Definition at line 280 of file CdbPHP.php.

References findNext(), and findStart().

Referenced by get().

◆ findNext()

CdbReaderPHP::findNext (   $key)
protected
Parameters
$key
Returns
bool

Definition at line 232 of file CdbPHP.php.

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

Referenced by find().

◆ findStart()

CdbReaderPHP::findStart ( )
protected

Definition at line 171 of file CdbPHP.php.

Referenced by __construct(), and find().

◆ get()

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

Reimplemented from CdbReader.

Definition at line 151 of file CdbPHP.php.

References find(), and read().

◆ match()

CdbReaderPHP::match (   $key,
  $pos 
)
protected
Parameters
$key
$pos
Returns
bool

Definition at line 165 of file CdbPHP.php.

References read().

Referenced by findNext().

◆ read()

CdbReaderPHP::read (   $length,
  $pos 
)
protected
Exceptions
CdbException
Parameters
$length
$pos
Returns
string

Definition at line 181 of file CdbPHP.php.

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

◆ unpack31()

CdbReaderPHP::unpack31 (   $s)
protected

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

Parameters
$s
Exceptions
CdbException
Returns
mixed

Definition at line 207 of file CdbPHP.php.

References $s.

Referenced by findNext().

◆ unpackSigned()

CdbReaderPHP::unpackSigned (   $s)
protected

Unpack a 32-bit signed integer.

Parameters
$s
Returns
int

Definition at line 222 of file CdbPHP.php.

References $s.

Referenced by findNext().

Member Data Documentation

◆ $dlen

CdbReaderPHP::$dlen

Definition at line 125 of file CdbPHP.php.

◆ $dpos

CdbReaderPHP::$dpos

Definition at line 122 of file CdbPHP.php.

◆ $fileName

CdbReaderPHP::$fileName

The filename.

Definition at line 104 of file CdbPHP.php.

Referenced by __construct().

◆ $hpos

CdbReaderPHP::$hpos

Definition at line 116 of file CdbPHP.php.

Referenced by findNext().

◆ $hslots

CdbReaderPHP::$hslots

Definition at line 119 of file CdbPHP.php.

◆ $khash

CdbReaderPHP::$khash

Definition at line 110 of file CdbPHP.php.

◆ $kpos

CdbReaderPHP::$kpos

Definition at line 113 of file CdbPHP.php.

◆ $loop

CdbReaderPHP::$loop

Definition at line 107 of file CdbPHP.php.


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