https://github.com/wikimedia/cdb
Mirror of https://gerrit.wikimedia.org/g/cdb/
https://github.com/wikimedia/cdb
Last synced: 2 months ago
JSON representation
Mirror of https://gerrit.wikimedia.org/g/cdb/
- Host: GitHub
- URL: https://github.com/wikimedia/cdb
- Owner: wikimedia
- License: gpl-2.0
- Created: 2014-11-10T19:15:52.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-02-20T15:42:19.000Z (4 months ago)
- Last Synced: 2025-03-29T04:05:47.772Z (2 months ago)
- Language: PHP
- Homepage: https://www.mediawiki.org/wiki/CDB
- Size: 230 KB
- Stars: 13
- Watchers: 14
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: COPYING
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[![Latest Stable Version]](https://packagist.org/packages/wikimedia/cdb) [![License]](https://packagist.org/packages/wikimedia/cdb)
CDB functions for PHP
=====================[CDB][], short for "constant database", refers to a very fast and highly
reliable database system which uses a simple file with key value pairs. This
library wraps the CDB functionality exposed in PHP via the `dba_*` functions.
In cases where `dba_*` functions are not present or are not compiled with CDB
support, a pure-PHP implementation is provided for falling back.Additional documentation about the library can be found on
[mediawiki.org](https://www.mediawiki.org/wiki/CDB).Usage
-----```php
// Reading a CDB file
$cdb = Cdb\Reader::open( 'db.cdb' );
$foo = $cdb->get( 'somekey' );// Writing to a CDB file
$cdb = Cdb\Writer::open( 'anotherdb.cdb' );
$cdb->set( 'somekey', $foo );
```// Using the CLI
$ cdb ./myfile.cdb [get|list|match]Running tests
-------------composer install --prefer-dist
composer testHistory
-------This library was first introduced in [MediaWiki 1.16][] ([r52203][]). It was
split out of the MediaWiki codebase and published as an independent library
during the [MediaWiki 1.25][] development cycle.---
[CDB]: https://en.wikipedia.org/wiki/cdb_(software)
[MediaWiki 1.16]: https://www.mediawiki.org/wiki/MediaWiki_1.16
[r52203]: https://www.mediawiki.org/wiki/Special:Code/MediaWiki/52203
[MediaWiki 1.25]: https://www.mediawiki.org/wiki/MediaWiki_1.25
[Latest Stable Version]: https://poser.pugx.org/wikimedia/cdb/v/stable.svg
[License]: https://poser.pugx.org/wikimedia/cdb/license.svg