Created
December 27, 2015 15:58
-
-
Save xboston/578e91bb581f5e7d4864 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$di['modelsMetadata'] = function () use ($config) { | |
if (PH_NOCACHE) { | |
$cache = new \Phalcon\Mvc\Model\Metadata\Memory(); | |
} else { | |
$cache = new \Phalcon\Mvc\Model\Metadata\Redis( | |
[ | |
'lifetime' => 86400, | |
'persistent' => false, | |
'host' => $config->redis->host, | |
'prefix' => 'meta:' . $config->redis->prefix, | |
'port' => $config->redis->port, | |
'index' => $config->redis->cache_db, | |
] | |
); | |
} | |
return $cache; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment