Skip to content

Instantly share code, notes, and snippets.

@xboston
Created December 27, 2015 15:58
Show Gist options
  • Save xboston/578e91bb581f5e7d4864 to your computer and use it in GitHub Desktop.
Save xboston/578e91bb581f5e7d4864 to your computer and use it in GitHub Desktop.
$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