app/library/Services.php: minor cleanup
This commit is contained in:
parent
102e6cc613
commit
2097c3a657
1 changed files with 4 additions and 8 deletions
|
|
@ -167,23 +167,19 @@ class Services extends DiDefault
|
||||||
protected function _initSharedModelsMetadata()
|
protected function _initSharedModelsMetadata()
|
||||||
{
|
{
|
||||||
$config = $this->get('config');
|
$config = $this->get('config');
|
||||||
|
|
||||||
// Use adapter and options from config if defined.
|
// Use adapter and options from config if defined.
|
||||||
if (isset($config->cache->metadata)) {
|
if (isset($config->cache->metadata)) {
|
||||||
|
|
||||||
$mdConfig = $config->cache->metadata->toArray();
|
$mdConfig = $config->cache->metadata->toArray();
|
||||||
$options = $mdConfig['options'];
|
$options = $mdConfig['options'];
|
||||||
$adapter = $mdConfig['adapter'];
|
$adapter = $mdConfig['adapter'];
|
||||||
|
|
||||||
$class = 'Phalcon\Mvc\Model\MetaData\\' . $adapter;
|
$class = 'Phalcon\Mvc\Model\MetaData\\' . $adapter;
|
||||||
|
return new $class($options);
|
||||||
$metadata = new $class($options);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, default to Memory.
|
// Otherwise, default to Memory.
|
||||||
else {
|
return new \Phalcon\Mvc\Model\MetaData\Memory();
|
||||||
$metadata = new \Phalcon\Mvc\Model\MetaData\Memory();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $metadata;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function _initSession()
|
protected function _initSession()
|
||||||
|
|
|
||||||
Reference in a new issue