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()
|
||||
{
|
||||
$config = $this->get('config');
|
||||
|
||||
// Use adapter and options from config if defined.
|
||||
if (isset($config->cache->metadata)) {
|
||||
|
||||
$mdConfig = $config->cache->metadata->toArray();
|
||||
$options = $mdConfig['options'];
|
||||
$adapter = $mdConfig['adapter'];
|
||||
|
||||
$class = 'Phalcon\Mvc\Model\MetaData\\' . $adapter;
|
||||
|
||||
$metadata = new $class($options);
|
||||
return new $class($options);
|
||||
}
|
||||
|
||||
// Otherwise, default to Memory.
|
||||
else {
|
||||
$metadata = new \Phalcon\Mvc\Model\MetaData\Memory();
|
||||
}
|
||||
|
||||
return $metadata;
|
||||
return new \Phalcon\Mvc\Model\MetaData\Memory();
|
||||
}
|
||||
|
||||
protected function _initSession()
|
||||
|
|
|
|||
Reference in a new issue