Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6023605
README.md
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
README.md
View Options
[![
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
]
<
parameter
>
Running
tests
-------------
composer
install
--
prefer
-
dist
composer
test
History
-------
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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 4 2026, 15:50 (5 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ca/81/0baabed44925579fe890df5f23df
Default Alt Text
README.md (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment