1 [![Latest Stable Version]](https://packagist.org/packages/wikimedia/cdb) [![License]](https://packagist.org/packages/wikimedia/cdb)
6 [CDB][], short for "constant database", refers to a very fast and highly
7 reliable database system which uses a simple file with key value pairs. This
8 library wraps the CDB functionality exposed in PHP via the `dba_*` functions.
9 In cases where `dba_*` functions are not present or are not compiled with CDB
10 support, a pure-PHP implementation is provided for falling back.
12 Additional documentation about the library can be found on
13 [MediaWiki.org](https://www.mediawiki.org/wiki/CDB).
20 $cdb = \Cdb\Reader::open( 'db.cdb' );
21 $foo = $cdb->get( 'somekey' );
23 // Writing to a CDB file
24 $cdb = \Cdb\Writer::open( 'anotherdb.cdb' );
25 $cdb->set( 'somekey', $foo );
31 composer install --prefer-dist
38 This library was first introduced in [MediaWiki 1.16][] ([r52203][]). It was
39 split out of the MediaWiki codebase and published as an independent library
40 during the [MediaWiki 1.25][] development cycle.
44 [CDB]: https://en.wikipedia.org/wiki/cdb_(software)
45 [MediaWiki 1.16]: https://www.mediawiki.org/wiki/MediaWiki_1.16
46 [r52203]: https://www.mediawiki.org/wiki/Special:Code/MediaWiki/52203
47 [MediaWiki 1.25]: https://www.mediawiki.org/wiki/MediaWiki_1.25
48 [Latest Stable Version]: https://poser.pugx.org/wikimedia/cdb/v/stable.svg
49 [License]: https://poser.pugx.org/wikimedia/cdb/license.svg