MediaWiki  1.23.8
CdbWriter Class Reference

Write to a CDB file. More...

Inheritance diagram for CdbWriter:
Collaboration diagram for CdbWriter:

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

 isWindows ()
 Are we running on Windows? More...
 

Protected Attributes

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

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

◆ __construct()

CdbWriter::__construct (   $fileName)
abstract

Create the object and open the file.

Parameters
$fileNamestring

Reimplemented in CdbWriterPHP, and CdbWriterDBA.

◆ __destruct()

CdbWriter::__destruct ( )

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

Definition at line 141 of file Cdb.php.

References close().

Member Function Documentation

◆ close()

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.

Referenced by __destruct().

◆ isWindows()

CdbWriter::isWindows ( )
protected

Are we running on Windows?

Definition at line 150 of file Cdb.php.

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

◆ open()

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
$fileNamestring
Returns
CdbWriterDBA|CdbWriterPHP

Definition at line 112 of file Cdb.php.

References CdbReader\haveExtension().

Referenced by LCStoreCDB\startWrite().

◆ set()

CdbWriter::set (   $key,
  $value 
)
abstract

Set a key to a given value.

The value will be converted to string.

Parameters
$keystring
$valuestring

Reimplemented in CdbWriterPHP, and CdbWriterDBA.

Member Data Documentation

◆ $handle

CdbWriter::$handle
protected

The file handle.

Definition at line 92 of file Cdb.php.

◆ $realFileName

string CdbWriter::$realFileName
protected

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

Definition at line 97 of file Cdb.php.

◆ $tmpFileName

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: