PHPackages                             cwmoss/doda - 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. cwmoss/doda

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

cwmoss/doda
===========

load domain specific data from files. fast &amp; easy

v1.0.0(3y ago)0103MITPHPPHP &gt;=7.4

Since Sep 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/cwmoss/doda)[ Packagist](https://packagist.org/packages/cwmoss/doda)[ RSS](/packages/cwmoss-doda/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

doda
====

[](#doda)

load your domain specific data from files or functions, lazy or not

why?
----

[](#why)

i need a fast and simple way to load rather static read only data in my app. that kind of data i don't want to have in a database. maybe the app doesn't need a database anyways.

### features

[](#features)

- multiple data formats: yaml, json, ini, serialized php, php
- lazy load from files
- lazy load from anonymous functions
- cache (serialized php as the fastest format for deserialization)

install
-------

[](#install)

this package depends on `"symfony/yaml"`

```
composer require cwmoss/doda

```

usage
-----

[](#usage)

```
require_once("vendor/autoload.php");
use cwmoss\doda;

$domain = new doda(__DIR__.'/config/domain-data.yaml');

$country = $domain->get('country_codes.fr'); // "France"

```

the example yaml file

```
contact_options:
    - via email
    - via phone
contact_phone: 555 321654
country_codes: !file cc.json

```

api
---

[](#api)

### constructor()

[](#constructor)

```
new doda($entrypoint_file, (optional)[array_of_callback_functions]);

```

the `entrypoint_file` should either be a yaml file or a cache file.

### get($path, $default=null)

[](#getpath-defaultnull)

`$path` is dot.notated.path to your data or an array of path segments

```
# "country_code.fr" is the same as ['country_code', 'fr']

```

the default value will be returned, if a key in the path does not exist in your data.

### write\_cache()

[](#write_cache)

you can php-serialize a previously parsed file, which then can be used as `entrypoint_file`.

you can compile from command line:

```
php vendor/cwmoss/doda/src/doda.php config/your-domain-data-file.yaml

```

yaml specific
-------------

[](#yaml-specific)

### the `import` key

[](#the-import-key)

your yamlfile can contain the top-level-magic-key `import`. here you can list all the data, you wish to load and then merge with the rest of the file.

```
import:
    - imports/categories.yaml
    - imports/countries.db
    - ../fruits-folder/fruits.php

```

### !file

[](#file)

this yaml tag loads data from a file at the time, you want to access this data (lazy load).

```
country_codes: !file cc.json

```

see `tests/data` folder for more examples

### !fun

[](#fun)

this yaml tag loads data from a function call at the time, you want to access this data (lazy load). the function name should be in the `$functions` array during instantiation.

```
country_codes: !fun load_country_codes

```

see `tests/data` folder for more examples

tests
-----

[](#tests)

run php unit

```
phpunit

```

license
-------

[](#license)

`cwmoss/doda` is released under the MIT public license. See the enclosed `LICENSE` for details.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

1380d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d448396576beaec8f896c46e121a942c2186e9798a4a84d1dba738ffe15bef28?d=identicon)[cwmoss](/maintainers/cwmoss)

---

Top Contributors

[![cwmoss](https://avatars.githubusercontent.com/u/16048828?v=4)](https://github.com/cwmoss "cwmoss (16 commits)")

---

Tags

configurationdomain data

### Embed Badge

![Health badge](/badges/cwmoss-doda/health.svg)

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

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[altis/local-server

Local Server module for Altis

18221.6k3](/packages/altis-local-server)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k13](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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