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

Write to a CDB file. More...

+ Inheritance diagram for Cdb\Writer:

Public Member Functions

 set ( $key, $value)
 Set a key to a given value.
 
 close ()
 Close the writer object.
 
 __destruct ()
 If the object goes out of scope, close it.
 

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

 $realFileName
 
 $tmpFileName
 

Detailed Description

Write to a CDB file.

Native C and pure PHP implementations are provided.

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

Member Function Documentation

◆ close()

Cdb\Writer::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 Cdb\Writer\DBA, and Cdb\Writer\PHP.

◆ isWindows()

Cdb\Writer::isWindows ( )
protected

Are we running on Windows?

Returns
bool

◆ open()

static Cdb\Writer::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
Writer

◆ set()

Cdb\Writer::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 Cdb\Writer\DBA, and Cdb\Writer\PHP.


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