MediaWiki  REL1_24
CdbWriter Class Reference

Write to a CDB file. More...

Inheritance diagram for CdbWriter:
Collaboration diagram for CdbWriter:

List of all members.

Public Member Functions

 __construct ($fileName)
 Create the object and open the file.
 __destruct ()
 If the object goes out of scope, close it for sanity.
 close ()
 Close the writer object.
 set ($key, $value)
 Set a key to a given value.

Static Public Member Functions

static open ($fileName)
 Open a writer and return a subclass instance.

Protected Member Functions

 isWindows ()
 Are we running on Windows?

Protected Attributes

 $handle
 The file handle.
string $realFileName
 File we'll be writing to when we're done.
string $tmpFileName
 File we write to temporarily until we're done.

Detailed Description

Write to a CDB file.

Native and pure PHP implementations are provided.

Definition at line 88 of file Cdb.php.


Constructor & Destructor Documentation

CdbWriter::__construct ( fileName) [abstract]

Create the object and open the file.

Parameters:
string$fileName

Reimplemented in CdbWriterPHP, and CdbWriterDBA.

If the object goes out of scope, close it for sanity.

Definition at line 141 of file Cdb.php.


Member Function Documentation

CdbWriter::close ( ) [abstract]

Close the writer object.

You should call this function before the object goes out of scope, to write out the final hashtables.

Reimplemented in CdbWriterPHP, and CdbWriterDBA.

CdbWriter::isWindows ( ) [protected]

Are we running on Windows?

Returns:
bool

Definition at line 151 of file Cdb.php.

Referenced by CdbWriterDBA\close(), and CdbWriterPHP\close().

static CdbWriter::open ( fileName) [static]

Open a writer and return a subclass instance.

The user must have write access to the directory, for temporary file creation.

Parameters:
string$fileName
Returns:
CdbWriterDBA|CdbWriterPHP

Definition at line 112 of file Cdb.php.

CdbWriter::set ( key,
value 
) [abstract]

Set a key to a given value.

The value will be converted to string.

Parameters:
string$key
string$value

Reimplemented in CdbWriterPHP, and CdbWriterDBA.


Member Data Documentation

CdbWriter::$handle [protected]

The file handle.

Definition at line 92 of file Cdb.php.

string CdbWriter::$realFileName [protected]

File we'll be writing to when we're done.

Definition at line 97 of file Cdb.php.

string CdbWriter::$tmpFileName [protected]

File we write to temporarily until we're done.

Definition at line 102 of file Cdb.php.


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