MediaWiki  1.23.3
CdbReader Class Reference

Read from a CDB file. More...

Inheritance diagram for CdbReader:

Public Member Functions

 __construct ( $fileName)
 Create the object and open the file. More...
 
 close ()
 Close the file. More...
 
 get ( $key)
 Get a value with a given key. More...
 

Static Public Member Functions

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

 $handle
 The file handle. More...
 

Detailed Description

Read from a CDB file.

Native and pure PHP implementations are provided. http://cr.yp.to/cdb.html

Definition at line 28 of file Cdb.php.

Constructor & Destructor Documentation

◆ __construct()

CdbReader::__construct (   $fileName)
abstract

Create the object and open the file.

Parameters
$fileNamestring

Reimplemented in CdbReaderPHP, and CdbReaderDBA.

Member Function Documentation

◆ close()

CdbReader::close ( )
abstract

Close the file.

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

Reimplemented in CdbReaderPHP, and CdbReaderDBA.

◆ get()

CdbReader::get (   $key)
abstract

Get a value with a given key.

Only string values are supported.

Parameters
$keystring

Reimplemented in CdbReaderPHP, and CdbReaderDBA.

◆ haveExtension()

static CdbReader::haveExtension ( )
static

Returns true if the native extension is available.

Returns
bool

Definition at line 52 of file Cdb.php.

Referenced by open(), CdbWriter\open(), and CdbTest\setUp().

◆ open()

static CdbReader::open (   $fileName)
static

Open a file and return a subclass instance.

Parameters
$fileNamestring
Returns
CdbReader

Definition at line 41 of file Cdb.php.

References haveExtension().

Referenced by LCStoreCDB\get(), Interwiki\getAllPrefixesCached(), and Interwiki\getInterwikiCacheEntry().

Member Data Documentation

◆ $handle

CdbReader::$handle
protected

The file handle.

Definition at line 32 of file Cdb.php.


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