PHPackages                             trismegiste/mikromongo - 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. trismegiste/mikromongo

AbandonedLibrary

trismegiste/mikromongo
======================

Freeze your objects to zero kelvin

26PHP

Since Nov 8Pushed 12y ago1 watchersCompare

[ Source](https://github.com/Trismegiste/Mikromongo)[ Packagist](https://packagist.org/packages/trismegiste/mikromongo)[ RSS](/packages/trismegiste-mikromongo/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

ZeroKelvin
==========

[](#zerokelvin)

Yet another object serializer except this one can deal with recursion

What
----

[](#what)

It is an object serializer/unserializer. There are many, but this one can :

- deal with internal php object
- deal with recursion (I mean a pointer to an object, embedded in another place)
- extract private properties of a parent class
- create an object no matter the constructor is
- Absolutly no contraints on how objects are designed

Examples
--------

[](#examples)

### Object to arrays

[](#object-to-arrays)

```
$transform = new \Trismegiste\ZeroKelvin\Transformer(new \Trismegiste\ZeroKelvin\UuidFactory());
$product = new LightSaber('red');
$product->setOwner(new Owner('vader'));
$dump = $transform->toArray($product);
print_r($dump);
// ouputs
[
    [
        '@classname' => 'tests\\functional\\LightSaber',
        'owner' => [ '@ref' => 'dc969571-bf05-420f-a466-1d971dbd9c7b'],
        '@uuid' => '5b0294f7-65dd-4b17-bcbf-cd1923983649',
        'color' => 'red'
    ],
    [
        '@classname' => 'tests\\functional\\Owner',
        '@uuid' => 'dc969571-bf05-420f-a466-1d971dbd9c7b',
        'name' => 'vader'
    ]
]
```

### Arrays to object

[](#arrays-to-object)

```
$transform = new \Trismegiste\ZeroKelvin\Transformer(new \Trismegiste\ZeroKelvin\UuidFactory());
$dump = [
    [
        '@classname' => 'tests\\functional\\LightSaber',
        'owner' => [ '@ref' => 'dc969571-bf05-420f-a466-1d971dbd9c7b'],
        '@uuid' => '5b0294f7-65dd-4b17-bcbf-cd1923983649',
        'color' => 'red'
    ],
    [
        '@classname' => 'tests\\functional\\Owner',
        '@uuid' => 'dc969571-bf05-420f-a466-1d971dbd9c7b',
        'name' => 'vader'
    ]
];
$product = $transform->fromArray($dump);
print_r($product);
// ouputs
tests\functional\LightSaber Object
(
    [color:protected] => red
    [owner:protected] => tests\functional\Owner Object
        (
            [name:protected] => vader
        )
)
```

See the [full test](https://github.com/Trismegiste/ZeroKelvin/tree/master/tests/functional/DumperExampleTest.php#L39)

How
---

[](#how)

Based on php serialization. Serialize() and unserialize() are the only magic functions that could come up with recursion AND hidden properties declared as private in a parent class. Var\_dump cannot deal with recursion, var\_export cannot export SplObjectStorage and using reflection to recursively introspect parent classes of an object is a pain in the ass.

So I came up with this lib. Later, I have added a repository service to store those dumps into MongoDb.

Why
---

[](#why)

It was a foolish attempt to make an ODM for MongoDb but I think it is unwise to use it for that purpose :

- there is too much noise into objects
- this is damn slow
- no real error handling if objects would be updated in database
- queries should be awful
- updates are not possible

Anyway, this lib could be useful for tests and debug, fast prototyping, simple app in CLI or some specific use cases like an asynchronous event queue. I have to mention that entity loading from MongoDb are made in only two passes even with complex tree structures with high depth.

Extending this lib
------------------

[](#extending-this-lib)

You can easily change the field name and the generation of primary keys by implementing UniqueGenerator interface.

You also can add your own repository (for XML files, CouchDB...) by implementing RepositoryInterface

What this library cannot do ?
-----------------------------

[](#what-this-library-cannot-do-)

This lib cannot handle references on scalar and array. It should be possible but the dumped array would carry too much noise (index, foreign key...) to be really useful.

This lib also cannot store properly custom serialization (implementation of the Serializable php interface). Anyway those objects are stored "as is" so you can restore them without problem.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/64cc99ca21a090b2454784670e4ac49db17794d6861078eeceebdbe302365c3f?d=identicon)[trismegiste](/maintainers/trismegiste)

---

Top Contributors

[![Trismegiste](https://avatars.githubusercontent.com/u/1260026?v=4)](https://github.com/Trismegiste "Trismegiste (28 commits)")

### Embed Badge

![Health badge](/badges/trismegiste-mikromongo/health.svg)

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

PHPackages © 2026

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