* Admin: add used caching provider and APCu stats to "PHP Information"

This commit is contained in:
Ralf Becker 2016-07-08 12:09:37 +02:00
parent 5f3f550bd3
commit 1687476928
3 changed files with 1199 additions and 0 deletions

1166
admin/apcu.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,8 @@
* @version $Id$ * @version $Id$
*/ */
use EGroupware\Api;
$GLOBALS['egw_info']['flags'] = array( $GLOBALS['egw_info']['flags'] = array(
'noheader' => True, 'noheader' => True,
'nonavbar' => True, 'nonavbar' => True,
@ -20,4 +22,22 @@ if ($GLOBALS['egw']->acl->check('info_access',1,'admin'))
$GLOBALS['egw']->redirect_link('/index.php'); $GLOBALS['egw']->redirect_link('/index.php');
} }
$cache_provider = Api\Cache::getProvider();
$cache_info = '<table><tbody><tr>';
$cache_info .= '<td class="e">EGroupware caching provider</td><td class="v">'.Api\Cache::getProvider();
if ($cache_provider == 'EGroupware\\Api\\Cache\\Apcu')
{
$cache_info .= ' <a href="'.htmlspecialchars(Api\Egw::link('/admin/apcu.php')).'">View APCu stats</a>';
}
$cache_info .= '</td></tr></tbody></table>'."\n";
ob_start();
phpinfo(); phpinfo();
$phpinfo = ob_get_clean();
$info = str_ireplace('<body><div class="center">', '<body><div class="center">'."\n".$cache_info, $phpinfo);
if ($info == $phpinfo)
{
echo $cache_info;
}
echo $info;

View File

@ -559,6 +559,19 @@ class Cache
return $providers[$level]; return $providers[$level];
} }
/**
* Get class-name of caching provider
*
* @param string $level
* @return string class-name of provider
*/
public static function getProvider($level=self::INSTANCE)
{
$provider = self::get_provider($level);
return get_class($provider);
}
/** /**
* Get a system configuration, even if in setup and it's not read * Get a system configuration, even if in setup and it's not read
* *