本文整理汇总了PHP中opcache_get_configuration函数的典型用法代码示例。如果您正苦于以下问题:PHP opcache_get_configuration函数的具体用法?PHP opcache_get_configuration怎么用?PHP opcache_get_configuration使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了opcache_get_configuration函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*/
public function __construct()
{
if (extension_loaded('Zend OPcache')) {
$this->_opCacheStats = opcache_get_status();
$this->_opCacheConfig = opcache_get_configuration();
}
}
示例2: collect
/**
* {@inheritDoc}
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
{
// This is needed to support the PHP 5.5 opcache as well as the old ZendOptimizer+-extension.
if (function_exists('opcache_get_status')) {
$status = opcache_get_status();
$config = opcache_get_configuration();
$version = $config['version']['opcache_product_name'] . ' ' . $config['version']['version'];
$stats = $status['opcache_statistics'];
$hitrate = $stats['opcache_hit_rate'];
} elseif (function_exists('accelerator_get_status')) {
$status = accelerator_get_status();
$config = accelerator_get_configuration();
$version = $config['version']['accelerator_product_name'] . ' ' . $config['version']['version'];
$stats = $status['accelerator_statistics'];
$hitrate = $stats['accelerator_hit_rate'];
}
$filelist = array();
if ($this->showFilelist) {
foreach ($status['scripts'] as $key => $data) {
$filelist[$key] = $data;
$filelist[$key]['name'] = basename($key);
}
}
// unset unneeded filelist to lower memory-usage
unset($status['scripts']);
$this->data = array('version' => $version, 'ini' => $config['directives'], 'filelist' => $filelist, 'status' => $status, 'stats' => $stats, 'hitrate' => $hitrate);
}
示例3: shutdown
public function shutdown($context, &$storage)
{
if ($this->shutdownCalled) {
return;
}
$this->shutdownCalled = true;
$status = opcache_get_status();
$config = opcache_get_configuration();
$storage['opMemoryUsage'][] = $status['memory_usage'];
$storage['opInternedStringsUsage'][] = $status['interned_strings_usage'];
$storage['opStatistics'][] = $status['opcache_statistics'];
$storage['opDirectives'][] = $config['directives'];
$storage['opVersion'][] = $config['version'];
$storage['opBlacklist'][] = $config['blacklist'];
$scripts = $status['scripts'];
array_walk($scripts, function (&$item, $key) {
$item = array_merge(array('name' => basename($item['full_path'])), array('Full Path' => $item['full_path']), $item);
$item['memory Consumption'] = round($item['memory_consumption'] / 1024) . " KB ({$item['memory_consumption']} B)";
$item['Last Used'] = $item['last_used'];
$item['Last Used Timestamp'] = $item['last_used_timestamp'];
$item['created'] = date("D M j G:i:s Y", $item['timestamp']);
$item['created Timestamp'] = $item['timestamp'];
unset($item['full_path']);
unset($item['memory_consumption']);
unset($item['last_used']);
unset($item['last_used_timestamp']);
unset($item['timestamp']);
});
$storage['opcacheScripts'] = $scripts;
}
示例4: configuration
/**
* Get OpCache configuration
* @param void
* @access public
* @return array
*/
public function configuration()
{
$config = null;
if (function_exists('opcache_get_configuration')) {
$config = opcache_get_configuration();
}
return $config;
}
示例5: __construct
public function __construct(Config $config)
{
if (function_exists('opcache_get_configuration')) {
$opcacheSettings = opcache_get_configuration();
if ($opcacheSettings['directives']['opcache.enable'] !== false) {
throw new \RuntimeException('ArraySeriesCache doesn\'t work with OPCache enabled.');
}
}
$this->config = $config;
}
示例6: __construct
public function __construct()
{
if (!extension_loaded('Zend OPcache')) {
$this->_opcacheEnabled = false;
} else {
$this->_opcacheEnabled = true;
}
if ($this->_opcacheEnabled) {
$this->_configuration = opcache_get_configuration();
$this->_status = opcache_get_status();
}
}
示例7: check
/**
* @return common_configuration_Report
*/
public function check()
{
$error = null;
if (!function_exists('opcache_get_configuration')) {
$error = 'You can install OPcache extension to improve performance';
} else {
$configuration = opcache_get_configuration();
if (!$configuration['directives']['opcache.enable']) {
$error = 'You can enable OPcache extension to improve performance';
}
}
$report = new common_configuration_Report(null !== $error ? common_configuration_Report::INVALID : common_configuration_Report::VALID, null !== $error ? $error : 'OPcache is installed', $this);
return $report;
}
示例8: init
/**
* Init JaguarEngine
* @param Integer $mode The engine mode
* @access Public
* @return Boolean
*/
public static function init(int $mode = 0) : bool
{
// Remove headers
header_remove('X-Powered-By');
header_remove('Server');
/**
* Mode Setup
*/
self::$mode = $mode;
// Development Setup
if (self::$mode === self::MODE_DEVELOPMENT) {
// Enable the error reporting
error_reporting(-1);
ini_set('display_errors', 'on');
// Disable the OPCACHE plugin
$opVars = opcache_get_configuration();
if ($opVars['directives']['opcache.enable'] == true) {
opcache_reset();
}
}
// Production Setup
if (self::$mode === self::MODE_PRODUCTION) {
// Disable error reporting
error_reporting(0);
ini_set('display_errors', 'off');
}
// Initialisation
self::setDefines();
self::addFiles();
self::setupEventSystem();
// Setup error handling
set_exception_handler(array('JEError', 'handleException'));
set_error_handler(array('JEError', 'handleError'));
register_shutdown_function(array('JEError', 'handleFatal'));
// Register tests
if (self::getFlag(self::FLAG_USE_VALIDATOR)) {
JEValidate::register('email', new JETestEmail());
JEValidate::register('id', new JETestID());
}
return true;
}
示例9: getServerVersions
/**
* Get a list of versions that are currently installed on the server.
*
* @package Admin
* @param string[] $checkFor
*/
function getServerVersions($checkFor)
{
global $txt, $memcached, $modSettings;
$db = database();
loadLanguage('Admin');
$versions = array();
// Is GD available? If it is, we should show version information for it too.
if (in_array('gd', $checkFor) && function_exists('gd_info')) {
$temp = gd_info();
$versions['gd'] = array('title' => $txt['support_versions_gd'], 'version' => $temp['GD Version']);
}
// Why not have a look at ImageMagick? If it is, we should show version information for it too.
if (in_array('imagick', $checkFor) && class_exists('Imagick')) {
$temp = new Imagick();
$temp2 = $temp->getVersion();
$versions['imagick'] = array('title' => $txt['support_versions_imagick'], 'version' => $temp2['versionString']);
}
// Now lets check for the Database.
if (in_array('db_server', $checkFor)) {
$conn = $db->connection();
if (empty($conn)) {
trigger_error('getServerVersions(): you need to be connected to the database in order to get its server version', E_USER_NOTICE);
} else {
$versions['db_server'] = array('title' => sprintf($txt['support_versions_db'], $db->db_title()), 'version' => '');
$versions['db_server']['version'] = $db->db_server_version();
}
}
// If we're using memcache we need the server info.
if (empty($memcached) && function_exists('memcache_get') && isset($modSettings['cache_memcached']) && trim($modSettings['cache_memcached']) != '') {
require_once SUBSDIR . '/Cache.subs.php';
get_memcached_server();
} else {
if (($key = array_search('memcache', $checkFor)) !== false) {
unset($checkFor[$key]);
}
}
// Check to see if we have any accelerators installed...
if (in_array('mmcache', $checkFor) && defined('MMCACHE_VERSION')) {
$versions['mmcache'] = array('title' => 'Turck MMCache', 'version' => MMCACHE_VERSION);
}
if (in_array('eaccelerator', $checkFor) && defined('EACCELERATOR_VERSION')) {
$versions['eaccelerator'] = array('title' => 'eAccelerator', 'version' => EACCELERATOR_VERSION);
}
if (in_array('zend', $checkFor) && function_exists('zend_shm_cache_store')) {
$versions['zend'] = array('title' => 'Zend SHM Accelerator', 'version' => zend_version());
}
if (in_array('apc', $checkFor) && extension_loaded('apc')) {
$versions['apc'] = array('title' => 'Alternative PHP Cache', 'version' => phpversion('apc'));
}
if (in_array('memcache', $checkFor) && function_exists('memcache_set')) {
$versions['memcache'] = array('title' => 'Memcached', 'version' => empty($memcached) ? '???' : memcache_get_version($memcached));
}
if (in_array('xcache', $checkFor) && function_exists('xcache_set')) {
$versions['xcache'] = array('title' => 'XCache', 'version' => XCACHE_VERSION);
}
if (in_array('opcache', $checkFor) && extension_loaded('Zend OPcache')) {
$opcache_config = @opcache_get_configuration();
if (!empty($opcache_config['directives']['opcache.enable'])) {
$versions['opcache'] = array('title' => $opcache_config['version']['opcache_product_name'], 'version' => $opcache_config['version']['version']);
}
}
// PHP Version
if (in_array('php', $checkFor)) {
$versions['php'] = array('title' => 'PHP', 'version' => PHP_VERSION . ' (' . php_sapi_name() . ')', 'more' => '?action=admin;area=serversettings;sa=phpinfo');
}
// Server info
if (in_array('server', $checkFor)) {
$req = request();
$versions['server'] = array('title' => $txt['support_versions_server'], 'version' => $req->server_software());
// Compute some system info, if we can
$versions['server_name'] = array('title' => $txt['support_versions'], 'version' => php_uname());
$loading = detectServerLoad();
if ($loading !== false) {
$versions['server_load'] = array('title' => $txt['load_balancing_settings'], 'version' => $loading);
}
}
return $versions;
}
示例10: setConfiguration
/**
* @param array $Configuration
*/
public function setConfiguration($Configuration)
{
if (function_exists('opcache_get_status')) {
$this->Status = opcache_get_status();
}
if (function_exists('opcache_get_configuration')) {
$this->Config = opcache_get_configuration();
}
}
示例11: getConfig
public function getConfig()
{
return opcache_get_configuration();
}
示例12: action_cacheSettings_display
/**
* Cache settings editing and submission.
*
* This method handles the display, allows to edit, and saves the result
* for _cacheSettings form.
*/
public function action_cacheSettings_display()
{
global $context, $scripturl, $txt, $cache_accelerator, $modSettings;
// Initialize the form
$this->_initCacheSettingsForm();
// Some javascript to enable / disable certain settings if the option is not selected
addInlineJavascript('
var cache_type = document.getElementById(\'cache_accelerator\');
createEventListener(cache_type);
cache_type.addEventListener("change", toggleCache);
toggleCache();', true);
$context['settings_message'] = $txt['caching_information'];
// Let them know if they may have problems
if ($cache_accelerator === 'filebased' && !empty($modSettings['cache_enable']) && extension_loaded('Zend OPcache')) {
// The opcache will cache the filebased user data files, updating them based on opcache.revalidate_freq
// which can cause delays (or prevent) the invalidation of file cache files
$opcache_config = @opcache_get_configuration();
if (!empty($opcache_config['directives']['opcache.enable'])) {
$context['settings_message'] = $txt['cache_conflict'];
}
}
// Saving again?
if (isset($_GET['save'])) {
call_integration_hook('integrate_save_cache_settings');
$this->_cacheSettingsForm->save();
// we need to save the $cache_enable to $modSettings as well
updatesettings(array('cache_enable' => (int) $_POST['cache_enable']));
// exit so we reload our new settings on the page
redirectexit('action=admin;area=serversettings;sa=cache;' . $context['session_var'] . '=' . $context['session_id']);
}
loadLanguage('Maintenance');
createToken('admin-maint');
Template_Layers::getInstance()->add('clean_cache_button');
$context['post_url'] = $scripturl . '?action=admin;area=serversettings;sa=cache;save';
$context['settings_title'] = $txt['caching_settings'];
// Prepare the template.
createToken('admin-ssc');
// Prepare settings for display in the template.
$this->_cacheSettingsForm->prepare_file();
}
示例13: showSettings
/**
* Show settings of the module
*
* @global object $objTemplate
* @global array $_ARRAYLANG
*/
function showSettings()
{
global $objTemplate, $_ARRAYLANG;
$this->objTpl->loadTemplateFile('settings.html');
$this->objTpl->setVariable(array('TXT_CACHE_GENERAL' => $_ARRAYLANG['TXT_SETTINGS_MENU_CACHE'], 'TXT_CACHE_STATS' => $_ARRAYLANG['TXT_CACHE_STATS'], 'TXT_CACHE_CONTREXX_CACHING' => $_ARRAYLANG['TXT_CACHE_CONTREXX_CACHING'], 'TXT_CACHE_USERCACHE' => $_ARRAYLANG['TXT_CACHE_USERCACHE'], 'TXT_CACHE_OPCACHE' => $_ARRAYLANG['TXT_CACHE_OPCACHE'], 'TXT_CACHE_PROXYCACHE' => $_ARRAYLANG['TXT_CACHE_PROXYCACHE'], 'TXT_CACHE_EMPTY' => $_ARRAYLANG['TXT_CACHE_EMPTY'], 'TXT_CACHE_STATS' => $_ARRAYLANG['TXT_CACHE_STATS'], 'TXT_CACHE_APC' => $_ARRAYLANG['TXT_CACHE_APC'], 'TXT_CACHE_ZEND_OPCACHE' => $_ARRAYLANG['TXT_CACHE_ZEND_OPCACHE'], 'TXT_CACHE_XCACHE' => $_ARRAYLANG['TXT_CACHE_XCACHE'], 'TXT_CACHE_MEMCACHE' => $_ARRAYLANG['TXT_CACHE_MEMCACHE'], 'TXT_CACHE_MEMCACHED' => $_ARRAYLANG['TXT_CACHE_MEMCACHED'], 'TXT_CACHE_FILESYSTEM' => $_ARRAYLANG['TXT_CACHE_FILESYSTEM'], 'TXT_CACHE_APC_ACTIVE_INFO' => $_ARRAYLANG['TXT_CACHE_APC_ACTIVE_INFO'], 'TXT_CACHE_APC_CONFIG_INFO' => $_ARRAYLANG['TXT_CACHE_APC_CONFIG_INFO'], 'TXT_CACHE_ZEND_OPCACHE_ACTIVE_INFO' => $_ARRAYLANG['TXT_CACHE_ZEND_OPCACHE_ACTIVE_INFO'], 'TXT_CACHE_ZEND_OPCACHE_CONFIG_INFO' => $_ARRAYLANG['TXT_CACHE_ZEND_OPCACHE_CONFIG_INFO'], 'TXT_CACHE_XCACHE_ACTIVE_INFO' => $_ARRAYLANG['TXT_CACHE_XCACHE_ACTIVE_INFO'], 'TXT_CACHE_XCACHE_CONFIG_INFO' => $_ARRAYLANG['TXT_CACHE_XCACHE_CONFIG_INFO'], 'TXT_CACHE_MEMCACHE_ACTIVE_INFO' => $_ARRAYLANG['TXT_CACHE_MEMCACHE_ACTIVE_INFO'], 'TXT_CACHE_MEMCACHE_CONFIG_INFO' => $_ARRAYLANG['TXT_CACHE_MEMCACHE_CONFIG_INFO'], 'TXT_CACHE_MEMCACHED_ACTIVE_INFO' => $_ARRAYLANG['TXT_CACHE_MEMCACHED_ACTIVE_INFO'], 'TXT_CACHE_MEMCACHED_CONFIG_INFO' => $_ARRAYLANG['TXT_CACHE_MEMCACHED_CONFIG_INFO'], 'TXT_CACHE_ENGINE' => $_ARRAYLANG['TXT_CACHE_ENGINE'], 'TXT_CACHE_INSTALLATION_STATE' => $_ARRAYLANG['TXT_CACHE_INSTALLATION_STATE'], 'TXT_CACHE_ACTIVE_STATE' => $_ARRAYLANG['TXT_CACHE_ACTIVE_STATE'], 'TXT_CACHE_CONFIGURATION_STATE' => $_ARRAYLANG['TXT_CACHE_CONFIGURATION_STATE'], 'TXT_SETTINGS_SAVE' => $_ARRAYLANG['TXT_SAVE'], 'TXT_SETTINGS_ON' => $_ARRAYLANG['TXT_ACTIVATED'], 'TXT_SETTINGS_OFF' => $_ARRAYLANG['TXT_DEACTIVATED'], 'TXT_SETTINGS_STATUS' => $_ARRAYLANG['TXT_CACHE_SETTINGS_STATUS'], 'TXT_SETTINGS_STATUS_HELP' => $_ARRAYLANG['TXT_CACHE_SETTINGS_STATUS_HELP'], 'TXT_SETTINGS_EXPIRATION' => $_ARRAYLANG['TXT_CACHE_SETTINGS_EXPIRATION'], 'TXT_SETTINGS_EXPIRATION_HELP' => $_ARRAYLANG['TXT_CACHE_SETTINGS_EXPIRATION_HELP'], 'TXT_EMPTY_BUTTON' => $_ARRAYLANG['TXT_CACHE_EMPTY'], 'TXT_EMPTY_DESC' => $_ARRAYLANG['TXT_CACHE_EMPTY_DESC'], 'TXT_EMPTY_DESC_APC' => $_ARRAYLANG['TXT_CACHE_EMPTY_DESC_FILES_AND_ENRIES'], 'TXT_EMPTY_DESC_ZEND_OP' => $_ARRAYLANG['TXT_CACHE_EMPTY_DESC_FILES'], 'TXT_EMPTY_DESC_MEMCACHE' => $_ARRAYLANG['TXT_CACHE_EMPTY_DESC_MEMCACHE'], 'TXT_EMPTY_DESC_XCACHE' => $_ARRAYLANG['TXT_CACHE_EMPTY_DESC_FILES_AND_ENRIES'], 'TXT_STATS_FILES' => $_ARRAYLANG['TXT_CACHE_STATS_FILES'], 'TXT_STATS_FOLDERSIZE' => $_ARRAYLANG['TXT_CACHE_STATS_FOLDERSIZE'], 'TXT_STATS_CHACHE_SITE_COUNT' => $_ARRAYLANG['TXT_STATS_CHACHE_SITE_COUNT'], 'TXT_STATS_CHACHE_ENTRIES_COUNT' => $_ARRAYLANG['TXT_STATS_CHACHE_ENTRIES_COUNT'], 'TXT_STATS_CACHE_SIZE' => $_ARRAYLANG['TXT_STATS_CACHE_SIZE'], 'TXT_DEACTIVATED' => $_ARRAYLANG['TXT_DEACTIVATED'], 'TXT_DISPLAY_CONFIGURATION' => $_ARRAYLANG['TXT_DISPLAY_CONFIGURATION'], 'TXT_HIDE_CONFIGURATION' => $_ARRAYLANG['TXT_HIDE_CONFIGURATION']));
$this->objTpl->setVariable($_ARRAYLANG);
if ($this->objSettings->isWritable()) {
$this->objTpl->parse('cache_submit_button');
} else {
$this->objTpl->hideBlock('cache_submit_button');
$objTemplate->SetVariable('CONTENT_STATUS_MESSAGE', implode("<br />\n", $this->objSettings->strErrMessage));
}
// parse op cache engines
$this->parseOPCacheEngines();
// parse user cache engines
$this->parseUserCacheEngines();
$this->parseMemcacheSettings();
$this->parseMemcachedSettings();
$this->parseReverseProxySettings();
$this->parseSsiProcessorSettings();
$intFoldersizePages = 0;
$intFoldersizeEntries = 0;
$intFilesPages = 0;
$intFilesEntries = 0;
$handleFolder = opendir($this->strCachePath);
if ($handleFolder) {
while ($strFile = readdir($handleFolder)) {
if ($strFile != '.' && $strFile != '..') {
if (is_dir($this->strCachePath . '/' . $strFile)) {
$intFoldersizeEntries += filesize($this->strCachePath . $strFile);
++$intFilesEntries;
} elseif ($strFile !== '.htaccess') {
$intFoldersizePages += filesize($this->strCachePath . $strFile);
++$intFilesPages;
}
}
}
$intFoldersizeEntries = filesize($this->strCachePath) - $intFoldersizePages - filesize($this->strCachePath . '.htaccess');
closedir($handleFolder);
}
if ($this->isInstalled(self::CACHE_ENGINE_APC) && $this->isConfigured(self::CACHE_ENGINE_APC) && ($this->opCacheEngine == self::CACHE_ENGINE_APC || $this->userCacheEngine == self::CACHE_ENGINE_APC)) {
$this->objTpl->touchBlock('apcCachingStats');
$apcSmaInfo = \apc_sma_info();
$apcCacheInfo = \apc_cache_info();
} else {
$this->objTpl->hideBlock('apcCachingStats');
}
if ($this->isInstalled(self::CACHE_ENGINE_ZEND_OPCACHE) && $this->isConfigured(self::CACHE_ENGINE_ZEND_OPCACHE) && $this->opCacheEngine == self::CACHE_ENGINE_ZEND_OPCACHE && $this->getOpCacheActive()) {
$this->objTpl->touchBlock('zendOpCachingStats');
$opCacheConfig = \opcache_get_configuration();
$opCacheStatus = \opcache_get_status();
} else {
$this->objTpl->hideBlock('zendOpCachingStats');
}
if ($this->isInstalled(self::CACHE_ENGINE_MEMCACHE) && $this->isConfigured(self::CACHE_ENGINE_MEMCACHE) && $this->userCacheEngine == self::CACHE_ENGINE_MEMCACHE && $this->getUserCacheActive()) {
$this->objTpl->touchBlock('memcacheCachingStats');
$memcacheStats = $this->memcache->getStats();
} else {
$this->objTpl->hideBlock('memcacheCachingStats');
}
if ($this->isInstalled(self::CACHE_ENGINE_MEMCACHED) && $this->isConfigured(self::CACHE_ENGINE_MEMCACHED) && $this->userCacheEngine == self::CACHE_ENGINE_MEMCACHED && $this->getUserCacheActive()) {
$this->objTpl->touchBlock('memcachedCachingStats');
$memcachedStats = $this->memcached->getStats();
} else {
$this->objTpl->hideBlock('memcachedCachingStats');
}
if ($this->isInstalled(self::CACHE_ENGINE_XCACHE) && $this->isConfigured(self::CACHE_ENGINE_XCACHE) && ($this->opCacheEngine == self::CACHE_ENGINE_XCACHE || $this->userCacheEngine == self::CACHE_ENGINE_XCACHE)) {
$this->objTpl->touchBlock('xCacheCachingStats');
} else {
$this->objTpl->hideBlock('xCacheCachingStats');
}
if ($this->userCacheEngine == self::CACHE_ENGINE_FILESYSTEM && $this->getUserCacheActive()) {
$this->objTpl->touchBlock('FileSystemCachingStats');
} else {
$this->objTpl->hideBlock('FileSystemCachingStats');
}
$apcSizeCount = isset($apcCacheInfo['nhits']) ? $apcCacheInfo['nhits'] : 0;
$apcEntriesCount = 0;
if (isset($apcCacheInfo)) {
foreach ($apcCacheInfo['cache_list'] as $entity) {
if (false !== strpos($entity['key'], $this->getCachePrefix())) {
$apcEntriesCount++;
}
}
}
$apcMaxSizeKb = isset($apcSmaInfo['num_seg']) && isset($apcSmaInfo['seg_size']) ? $apcSmaInfo['num_seg'] * $apcSmaInfo['seg_size'] / 1024 : 0;
$apcSizeKb = isset($apcCacheInfo['mem_size']) ? $apcCacheInfo['mem_size'] / 1024 : 0;
$opcacheSizeCount = !isset($opCacheStatus) || $opCacheStatus == false ? 0 : $opCacheStatus['opcache_statistics']['num_cached_scripts'];
$opcacheSizeKb = (!isset($opCacheStatus) || $opCacheStatus == false ? 0 : $opCacheStatus['memory_usage']['used_memory']) / (1024 * 1024);
$opcacheMaxSizeKb = isset($opCacheConfig['directives']['opcache.memory_consumption']) ? $opCacheConfig['directives']['opcache.memory_consumption'] / (1024 * 1024) : 0;
$memcacheEntriesCount = isset($memcacheStats['curr_items']) ? $memcacheStats['curr_items'] : 0;
$memcacheSizeMb = isset($memcacheStats['bytes']) ? $memcacheStats['bytes'] / (1024 * 1024) : 0;
$memcacheMaxSizeMb = isset($memcacheStats['limit_maxbytes']) ? $memcacheStats['limit_maxbytes'] / (1024 * 1024) : 0;
$memcacheConfiguration = $this->getMemcacheConfiguration();
//.........这里部分代码省略.........
示例14: opcache_invalidate
*
*/
// common include
include '/srv/http/app/config/config.php';
opcache_invalidate('/srv/http/command/cachectl.php');
// insect GET['action']
if (isset($_GET['action'])) {
switch ($_GET['action']) {
case 'prime':
OpCacheCtl('prime', '/srv/http/', $redis);
break;
case 'primeall':
OpCacheCtl('primeall', '/srv/http/');
break;
case 'reset':
OpCacheCtl('reset', '/srv/http/');
opcache_reset();
runelog('cacheCTL RESET');
echo "PHP OPCACHE CLEARED";
break;
case 'debug':
// opcache_reset();
echo "<pre>";
echo "OPcache status:\n";
print_r(opcache_get_status());
echo "OPcache configuration:\n";
print_r(opcache_get_configuration());
echo "</pre>";
break;
}
}
示例15: render_dashboard_widget
function render_dashboard_widget()
{
$this->data['config'] = opcache_get_configuration();
$this->data['status'] = opcache_get_status(false);
$this->load_view('widgets/dashboard.php', $this->data);
}