dreamsxin/cphalcon — pull request #311 by dreamsxin (2014-11-21 02:00:07+00:00)
Title: Add class Phalcon\Mvc\Model\Metadata\Mongo and Cache

Add class `Phalcon\Mvc\Model\Metadata\Mongo`
Add class `Phalcon\Mvc\Model\Metadata\Cache`

```php
$di->set('modelsMetadata', function(){
return new Phalcon\Mvc\Model\Metadata\Mongo(array(
'mongo' => new MongoClient(),
'db' => 'phalcon_test',
'collection' => 'caches',
'lifetime' => 60,
));
});
```
```php
$di->set('cache', function(){
$frontCache = new Phalcon\Cache\Frontend\Output(array(
'lifetime' => 60
));

$cache = new Phalcon\Cache\Backend\Mongo($frontCache, array(
'server' => 'mongodb://localhost',
'db' => 'phalcon_test',
'collection' => 'caches'
));

return $cache;
});

$di->set('modelsMetadata', function(){
return new Phalcon\Mvc\Model\Metadata\Cache();
});
```