PHPackages                             cultuurnet/cdb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cultuurnet/cdb

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cultuurnet/cdb
==============

PHP library for hydrating/manipulating CultuurNet's Cdb XML documents

v2.2.1(9mo ago)1101.9k↓12.5%37Apache-2.0PHPCI passing

Since Nov 24Pushed 6mo ago25 watchersCompare

[ Source](https://github.com/cultuurnet/Cdb)[ Packagist](https://packagist.org/packages/cultuurnet/cdb)[ RSS](/packages/cultuurnet-cdb/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (12)Used By (7)

[![Build Status](https://camo.githubusercontent.com/4ec870f94e44d8ef943598a7f9c647d3ee24e77dd3c4d55f8bea34e8bdb7f4b5/68747470733a2f2f7472617669732d63692e6f72672f63756c747575726e65742f4364622e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/cultuurnet/Cdb) [![Coverage Status](https://camo.githubusercontent.com/d3b723d7a98fd0ffcecaaf80ecc92fcf7a2de25ada3c59cfad86132d4a9b4cfd/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f63756c747575726e65742f4364622f62616467652e737667)](https://coveralls.io/r/cultuurnet/Cdb)

CultuurNet\\Cdb aims to be a fluent PHP library for manipulating, serializing and deserializing data present in CultuurNet's [CdbXML](http://www.cultuurdatabank.com/CdbXML/) format. The library currently supports CdbXML 3.2.

History
=======

[](#history)

In its first incarnation during the summer of 2012 this library was an integral part of a Drupal module called [Culturefeed](https://github.com/cultuurnet/culturefeed). It was developed by [Krimson](http://www.krimson.be), loosely based on an earlier prototype by [Statik](http://www.statik.be) made somewhere back in 2009. The library however was meant to be generally useable from the start, and not to be tightly coupled with a Drupal module. So in February 2013 it was extracted from the Culturefeed module.

To keep backwards compatible breaks to a minimum, the PEAR-style naming conventions were maintained and classes kept their historical CultureFeed\_Cdb prefix. In a later major release, they'll probably be renamed and use the PHP 5.3 CultuurNet\\Cdb namespace instead.

Installation
============

[](#installation)

You are free to install the CultuurNet\\Cdb PHP library in whatever way that fits you. However, we recommend to use [Composer](http://getcomposer.org).

Require the cultuurnet/cdb package (it is [registered on Packagist](https://packagist.org/packages/cultuurnet/cdb)) in your project's composer.json file.

```
{
    "require": {
        "cultuurnet/cdb": "2.*@dev"
    }
}
```

Then run `composer install`

The library is [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) compliant, so you can load its classes with any PSR-0 compliant autoloader. If you are using Composer, you can simply include the autoloader Composer generated.

When using Drupal, there is a very simple way to use the autoloader of Composer:

- place in your Drupal root dir a file with the name composer.json and the json content
- run `composer install`
- include this in the settings.php file of your site:

```
require 'vendor/autoload.php';
```

Backwards Compatibility
=======================

[](#backwards-compatibility)

This section contains information regarding possible backwards compatibility breaks, and outlines the necessary steps for upgrading third party code using the CultuurNet\\Cdb library.

2013-03-18
----------

[](#2013-03-18)

### Rename of setMailAddress() and isMainMail() member methods of CultureFeed\_Cdb\_Data\_Url

[](#rename-of-setmailaddress-and-ismainmail-member-methods-of-culturefeed_cdb_data_url)

The following methods of CultureFeed\_Cdb\_Data\_Url have been renamed to properly describe their goal:

- setMailAddress() is now called setUrl()
- isMainMail is now called isMain()

2013-03-07
----------

[](#2013-03-07)

### CultureFeed\_ParseException replaced by CultureFeed\_Cdb\_ParseException

[](#culturefeed_parseexception-replaced-by-culturefeed_cdb_parseexception)

The CultuurNet\\Cdb library was still using CultureFeed\_ParseException from the culturefeed module, an undesired dependency. A new class CultureFeed\_Cdb\_ParseException has been introduced, and is used now instead of CultureFeed\_ParseException.

### Arguments from addItem in CultureFeed\_Cdb\_Default changed to $item

[](#arguments-from-additem-in-culturefeed_cdb_default-changed-to-item)

The addItem method was using 2 arguments: type, $item. This has been changed to only $item. The type will be internally decided based on the class from $item.

### getXml from CultureFeed\_Cdb\_Default changed to \_\_toString

[](#getxml-from-culturefeed_cdb_default-changed-to-__tostring)

The getXml method from CultureFeed\_Cdb\_Default has been replaced by the \_\_toString method.

2013-01-23
----------

[](#2013-01-23)

### Removal of CultureFeed\_SimpleXMLElement dependency

[](#removal-of-culturefeed_simplexmlelement-dependency)

All occurrences of CultureFeed\_SimpleXMLElement were replaced by SimpleXMLElement, because none of the additional features of CultureFeed\_SimpleXMLElement were actually used. As CultureFeed\_SimpleXMLElement in the Drupal CultureFeed module extends SimpleXMLElement, this change should normally not have any effect on existing code. If you still encounter issues by this change, please let us know!

### Renamed classes for PSR-0 compliance

[](#renamed-classes-for-psr-0-compliance)

For PSR-0 compliance some classes had to be renamed:

- CultureFeed\_Cdb\_Data\_VirtualAddress became CultureFeed\_Cdb\_Data\_Address\_VirtualAddress
- CultureFeed\_Cdb\_Data\_PhysicalAddress became CultureFeed\_Cdb\_Data\_Address\_PhysicalAddress

Third party code should use the new classes which are functionally identical.

### CultureFeed\_Cdb\_Item\_Event::parseFromCdbXml() logic change

[](#culturefeed_cdb_item_eventparsefromcdbxml-logic-change)

CultureFeed\_Cdb\_Item\_Event::parseFromCdbXml() used to expect a SimpleXMLElement argument containing an events element, and parsed the first event element inside that events element. However, CultureFeed\_Cdb\_Item\_Event is supposed to represent a single event, and therefore CultureFeed\_Cdb\_Item\_Event::parseFromCdbXml() should only have expectations about a single 'event' XML element and its contents, in line with how the other classes in the CultuurNet\\Cdb library handle parsing from XML. Third party code should from now on pass a single event XML element to CultureFeed\_Cdb\_Item\_Event::parseFromCdbXml().

### Event external ID vs. CdbId

[](#event-external-id-vs-cdbid)

When parsing CdbXML with CultureFeed\_Cdb\_Item\_Event::parseFromCdbXml(), the CdbId was erroneously set as the external Id with CultureFeed\_Cdb\_Item\_Event::setExternalId(). Third party code could use CultureFeed\_Cdb\_Item\_Event::getExternalId() to get the CdbId. From now on the CdbId should be retrieved with CultureFeed\_Cdb\_Item\_Event::getCdbId() or set with CultureFeed\_Cdb\_Item\_Event::setCdbId(). CultureFeed\_Cdb\_Item\_Event::getExternalId() and CultureFeed\_Cdb\_Item\_Event::setExternalId() should be exclusively used to retrieve and set the external ID of an event, NOT the CdbId.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance64

Regular maintenance activity

Popularity33

Limited adoption so far

Community32

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~428 days

Recently: every ~868 days

Total

11

Last Release

271d ago

Major Versions

v1.0.0 → v2.0.02014-03-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/d36d172d00ced6637c459c23a28191f50ed5e6bbe46ec97e07b78f166fbdff18?d=identicon)[dev-publiq](/maintainers/dev-publiq)

![](https://www.gravatar.com/avatar/df052a58ecfa5a07fd2b4cb12bb128ab28ff4b8e82fb0831eab81623b898ddb4?d=identicon)[madewithlove-machine-user](/maintainers/madewithlove-machine-user)

---

Top Contributors

[![cyberwolf](https://avatars.githubusercontent.com/u/95102?v=4)](https://github.com/cyberwolf "cyberwolf (166 commits)")[![lucwollants](https://avatars.githubusercontent.com/u/1322949?v=4)](https://github.com/lucwollants "lucwollants (84 commits)")[![zuuperman](https://avatars.githubusercontent.com/u/1125693?v=4)](https://github.com/zuuperman "zuuperman (37 commits)")[![svenhoutmeyers](https://avatars.githubusercontent.com/u/897699?v=4)](https://github.com/svenhoutmeyers "svenhoutmeyers (27 commits)")[![HnLn](https://avatars.githubusercontent.com/u/5806950?v=4)](https://github.com/HnLn "HnLn (19 commits)")[![Stalski](https://avatars.githubusercontent.com/u/448077?v=4)](https://github.com/Stalski "Stalski (17 commits)")[![lukdens](https://avatars.githubusercontent.com/u/898075?v=4)](https://github.com/lukdens "lukdens (15 commits)")[![stijnswaanen](https://avatars.githubusercontent.com/u/2233159?v=4)](https://github.com/stijnswaanen "stijnswaanen (4 commits)")[![bertramakers](https://avatars.githubusercontent.com/u/959026?v=4)](https://github.com/bertramakers "bertramakers (3 commits)")[![JonasVHG](https://avatars.githubusercontent.com/u/4658984?v=4)](https://github.com/JonasVHG "JonasVHG (3 commits)")[![wtrv](https://avatars.githubusercontent.com/u/4246645?v=4)](https://github.com/wtrv "wtrv (3 commits)")[![nleroy](https://avatars.githubusercontent.com/u/111720?v=4)](https://github.com/nleroy "nleroy (1 commits)")[![bramcordie](https://avatars.githubusercontent.com/u/1107185?v=4)](https://github.com/bramcordie "bramcordie (1 commits)")[![NoUseFreak](https://avatars.githubusercontent.com/u/879864?v=4)](https://github.com/NoUseFreak "NoUseFreak (1 commits)")[![alduya](https://avatars.githubusercontent.com/u/255367?v=4)](https://github.com/alduya "alduya (1 commits)")

---

Tags

upw

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/cultuurnet-cdb/health.svg)

```
[![Health](https://phpackages.com/badges/cultuurnet-cdb/health.svg)](https://phpackages.com/packages/cultuurnet-cdb)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
