jmflava / mongo-morph
There is no license information available for the latest version (v0.5) of this package.
A PHP object that can flatten MongoDB data or restore flattened data to MongoDb format.
v0.5
2013-04-17 15:40 UTC
Requires
- php: >=5.4.6
This package is not auto-updated.
Last update: 2025-01-12 05:50:54 UTC
README
MongoMorph is a PHP object that can flatten MongoDB data or restore flattened data to MongoDb format. You may find it useful if you want to interface with your Mongo database via flat files.
Implementation Example
The most typical use case of MongoMorph is to use it within a command, which could look like the following:
// Code to spin up a new Mongo connection...
$db = $mongo->selectDb('your-db-here');
$mongoMorph = new Jmflava\MongoMorph\MongoMorph($db, __DIR__ . '/path/to/morph/dir');
if ($argv[1] === 'backup') {
$mongoMorph->backup();
} elseif ($argv[1] === 'restore') {
$mongoMorph->restore();
}