コード例 #1
0
ファイル: example_copy.php プロジェクト: agolp/mongoyaml
<?php

require_once '../MongoYaml.php';
$mongo = new Mongo();
// This example shows a simple way to copy collections from one database to another
$blogloader = new MongoYaml($mongo->blog);
$blogloader->dump('posts')->dump('users');
$testloader = new MongoYaml($mongo->test);
$testloader->load('posts.yml')->load('users.yml');
コード例 #2
0
ファイル: example_fixtures.php プロジェクト: agolp/mongoyaml
<?php

require_once '../MongoYaml.php';
// This example loads the dynamic fixtures from the file 'project.yml'
// into various collections of the 'test' database
$mongo = new Mongo();
$loader = new MongoYaml($mongo->test);
$loader->load('project.yml');