wikimedia/cdb
CDB functions for PHP
Loading...
Searching...
No Matches
Cdb\Reader Class Reference

Read data from a CDB file. More...

+ Inheritance diagram for Cdb\Reader:

Public Member Functions

 close ()
 Close the file.
 
 get ( $key)
 Get a value with a given key.
 
 exists ( $key)
 Check whether key exists.
 
 firstkey ()
 Fetch first key.
 
 nextkey ()
 Fetch next key.
 

Static Public Member Functions

static open ( $fileName)
 Open a file and return a subclass instance.
 
static haveExtension ()
 Returns true if the native extension is available.
 

Detailed Description

Read data from a CDB file.

Native C and pure PHP implementations are provided.

See also
http://cr.yp.to/cdb.html

Member Function Documentation

◆ close()

Cdb\Reader::close ( )
abstract

Close the file.

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

Reimplemented in Cdb\Reader\DBA, Cdb\Reader\Hash, and Cdb\Reader\PHP.

◆ exists()

Cdb\Reader::exists (   $key)
abstract

Check whether key exists.

Parameters
string$key
Returns
bool

Reimplemented in Cdb\Reader\DBA, Cdb\Reader\Hash, and Cdb\Reader\PHP.

◆ firstkey()

Cdb\Reader::firstkey ( )
abstract

Fetch first key.

Returns
string|false

Reimplemented in Cdb\Reader\DBA, Cdb\Reader\Hash, and Cdb\Reader\PHP.

◆ get()

Cdb\Reader::get (   $key)
abstract

Get a value with a given key.

Only string values are supported.

Parameters
string | int$key
Returns
string|false

Reimplemented in Cdb\Reader\DBA, Cdb\Reader\Hash, and Cdb\Reader\PHP.

◆ haveExtension()

static Cdb\Reader::haveExtension ( )
static

Returns true if the native extension is available.

Returns
bool

◆ nextkey()

Cdb\Reader::nextkey ( )
abstract

Fetch next key.

Returns
string|false

Reimplemented in Cdb\Reader\DBA, Cdb\Reader\Hash, and Cdb\Reader\PHP.

◆ open()

static Cdb\Reader::open (   $fileName)
static

Open a file and return a subclass instance.

Parameters
string$fileName
Returns
Reader

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