mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
Add doctrine cache info
This commit is contained in:
@@ -248,27 +248,27 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
*/
|
*/
|
||||||
protected function get_cache_info(Application $app)
|
protected function get_cache_info(Application $app)
|
||||||
{
|
{
|
||||||
$mainCache = $app['Core']['Cache'];
|
$em = $app['Core']['EM'];
|
||||||
$opCodeCache = $app['Core']['OpcodeCache'];
|
$caches = array(
|
||||||
|
'main' => $app['Core']['Cache'],
|
||||||
|
'op_code' => $app['Core']['OpcodeCache'],
|
||||||
|
'doctrine_metadatas' => $em->getConfiguration()->getMetadataCacheImpl(),
|
||||||
|
'doctrine_query' => $em->getConfiguration()->getQueryCacheImpl(),
|
||||||
|
'doctrine_result' => $em->getConfiguration()->getResultCacheImpl(),
|
||||||
|
);
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
|
||||||
if ($mainCache instanceof \Alchemy\Phrasea\Cache\Cache) {
|
foreach ($caches as $name => $service) {
|
||||||
$ret['cache']['main'] = array(
|
if ($service instanceof \Alchemy\Phrasea\Cache\Cache) {
|
||||||
'type' => $mainCache->getName(),
|
$ret['cache'][$name] = array(
|
||||||
'stats' => $mainCache->getStats()
|
'type' => $service->getName(),
|
||||||
|
'online' => $service->isOnline(),
|
||||||
|
'stats' => $service->getStats(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$ret['cache']['main'] = null;
|
$ret['cache'][$name] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opCodeCache instanceof \Alchemy\Phrasea\Cache\Cache) {
|
|
||||||
$ret['cache']['op_code'] = array(
|
|
||||||
'type' => $opCodeCache->getName(),
|
|
||||||
'stats' => $opCodeCache->getStats()
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$ret['cache']['op_code'] = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
|
Reference in New Issue
Block a user