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

CDB writer class. More...

+ Inheritance diagram for Cdb\Writer\PHP:

Public Member Functions

 __construct (string $fileName)
 Create the object and open the file.
 
 set ( $key, $value)
 
 close ()
 Close the writer object.
 
- Public Member Functions inherited from Cdb\Writer
 __destruct ()
 If the object goes out of scope, close it.
 

Protected Member Functions

 write ( $buf)
 
 posplus ( $len)
 
 finish ()
 
 throwException ( $msg)
 Clean up the temp file and throw an exception.
 
- Protected Member Functions inherited from Cdb\Writer
 isWindows ()
 Are we running on Windows?
 

Protected Attributes

 $handle
 
 $hplist = []
 
 $numentries = 0
 
 $pos
 
- Protected Attributes inherited from Cdb\Writer
 $realFileName
 
 $tmpFileName
 

Additional Inherited Members

- Static Public Member Functions inherited from Cdb\Writer
static open ( $fileName)
 Open a writer and return a subclass instance.
 

Detailed Description

CDB writer class.

This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that appears in PHP 5.3.

Constructor & Destructor Documentation

◆ __construct()

Cdb\Writer\PHP::__construct ( string $fileName)

Create the object and open the file.

Parameters
string$fileName

Member Function Documentation

◆ close()

Cdb\Writer\PHP::close ( )

Close the writer object.

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

Reimplemented from Cdb\Writer.

◆ posplus()

Cdb\Writer\PHP::posplus ( $len)
protected
Parameters
int$len

◆ set()

Cdb\Writer\PHP::set ( $key,
$value )
Parameters
string$key
string$value

Reimplemented from Cdb\Writer.

◆ throwException()

Cdb\Writer\PHP::throwException ( $msg)
protected

Clean up the temp file and throw an exception.

Parameters
string$msg
Returns
never
Exceptions
Exception

◆ write()

Cdb\Writer\PHP::write ( $buf)
protected
Parameters
string$buf

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