本文整理匯總了PHP中C::memory方法的典型用法代碼示例。如果您正苦於以下問題:PHP C::memory方法的具體用法?PHP C::memory怎麽用?PHP C::memory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類C
的用法示例。
在下文中一共展示了C::memory方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: memory
function memory($cmd, $key = '', $value = '', $ttl = 0, $prefix = '')
{
if ($cmd == 'check') {
return C::memory()->enable ? C::memory()->type : '';
} elseif (C::memory()->enable && in_array($cmd, array('set', 'get', 'rm', 'inc', 'dec'))) {
if (defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) {
if (is_array($key)) {
foreach ($key as $k) {
C::memory()->debug[$cmd][] = ($cmd == 'get' || $cmd == 'rm' ? $value : '') . $prefix . $k;
}
} else {
C::memory()->debug[$cmd][] = ($cmd == 'get' || $cmd == 'rm' ? $value : '') . $prefix . $key;
}
}
switch ($cmd) {
case 'set':
return C::memory()->set($key, $value, $ttl, $prefix);
break;
case 'get':
return C::memory()->get($key, $value);
break;
case 'rm':
return C::memory()->rm($key, $value);
break;
case 'inc':
return C::memory()->inc($key, $value ? $value : 1);
break;
case 'dec':
return C::memory()->dec($key, $value ? $value : -1);
break;
}
}
return null;
}
示例2: second
, Processed in <?php
echo $_G['debuginfo']['time'];
?>
second(s), <?php
echo $_G['debuginfo']['queries'];
?>
queries
<?php
if ($_G['gzipcompress']) {
?>
, Gzip On<?php
}
if (C::memory()->type) {
?>
, <?php
echo ucwords(C::memory()->type);
?>
On<?php
}
?>
.
<?php
}
?>
</span>
</p>
</div>
<div id="frt">
<p>Powered by <strong><a href="http://www.discuz.net" target="_blank">Discuz!</a></strong> <em><?php
echo $_G['setting']['version'];
?>
示例3: if
<div id="flk" class="y">
<p>
<?php if($_G['setting']['site_qq']) { ?><a href="http://wpa.qq.com/msgrd?V=3&Uin=<?php echo $_G['setting']['site_qq'];?>&Site=<?php echo $_G['setting']['bbname'];?>&Menu=yes&from=discuz" target="_blank" title="QQ"><img src="<?php echo IMGDIR;?>/site_qq.jpg" alt="QQ" /></a><span class="pipe">|</span><?php } if(is_array($_G['setting']['footernavs'])) foreach($_G['setting']['footernavs'] as $nav) { if($nav['available'] && ($nav['type'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1)) ||
!$nav['type'] && ($nav['id'] == 'stat' && $_G['group']['allowstatdata'] || $nav['id'] == 'report' && $_G['uid'] || $nav['id'] == 'archiver' || $nav['id'] == 'mobile' || $nav['id'] == 'darkroom'))) { ?><?php echo $nav['code'];?><span class="pipe">|</span><?php } } ?>
<strong><a href="<?php echo $_G['setting']['siteurl'];?>" target="_blank"><?php echo $_G['setting']['sitename'];?></a></strong>
<?php if($_G['setting']['icp']) { ?>( <a href="http://www.miitbeian.gov.cn/" target="_blank"><?php echo $_G['setting']['icp'];?></a> )<?php } ?>
<?php if(!empty($_G['setting']['pluginhooks']['global_footerlink'])) echo $_G['setting']['pluginhooks']['global_footerlink'];?>
<?php if($_G['setting']['statcode']) { ?><?php echo $_G['setting']['statcode'];?><?php } ?>
</p>
<p class="xs0">
GMT<?php echo $_G['timenow']['offset'];?>, <?php echo $_G['timenow']['time'];?>
<span id="debuginfo">
<?php if(debuginfo()) { ?>, Processed in <?php echo $_G['debuginfo']['time'];?> second(s), <?php echo $_G['debuginfo']['queries'];?> queries
<?php if($_G['gzipcompress']) { ?>, Gzip On<?php } if(C::memory()->type) { ?>, <?php echo ucwords(C::memory()->type); ?> On<?php } ?>.
<?php } ?>
</span>
</p>
</div>
<div id="frt">
<p>技術支持 <strong>北京偉澤四方科技有限公司</strong> </p>
<p class="xs0">© 2015 <a href="http://www.bjwlkjc.com" target="_blank">北京未來之家網.</a></p>
<p>Powered by <strong><a href="http://www.discuz.net" target="_blank">Discuz!</a></strong> <em><?php echo $_G['setting']['version'];?></em><?php if(!empty($_G['setting']['boardlicensed'])) { ?> <a href="http://license.comsenz.com/?pid=1&host=<?php echo $_SERVER['HTTP_HOST'];?>" target="_blank">Licensed</a><?php } ?></p>
<p class="xs0"><a href="http://www.wekei.cn" target="_blank"></a></p>
</div><?php updatesession();?><?php if($_G['uid'] && $_G['group']['allowinvisible']) { ?>
<script type="text/javascript">
var invisiblestatus = '<?php if($_G['session']['invisible']) { ?>隱身<?php } else { ?>在線<?php } ?>';
var loginstatusobj = $('loginstatusid');
if(loginstatusobj != undefined && loginstatusobj != null) loginstatusobj.innerHTML = invisiblestatus;
示例4: array
$xcache = array('Xcache', $cache_extension['xcache'] ? cplang('setting_memory_php_enable') : cplang('setting_memory_php_disable'), $cache_config['xcache'] ? cplang('open') : cplang('closed'), $cache_type == 'xcache' ? $do_clear_link : '--');
$ea = array('eAccelerator', $cache_extension['eaccelerator'] ? cplang('setting_memory_php_enable') : cplang('setting_memory_php_disable'), $cache_config['eaccelerator'] ? cplang('open') : cplang('closed'), $cache_type == 'eaccelerator' ? $do_clear_link : '--');
$wincache = array('wincache', $cache_extension['wincache'] ? cplang('setting_memory_php_enable') : cplang('setting_memory_php_disable'), $cache_config['wincache'] ? cplang('open') : cplang('closed'), $cache_type == 'wincache' ? $do_clear_link : '--');
showtablerow('', array('width="100"', 'width="120"', 'width="120"'), $redis);
showtablerow('', '', $memcache);
showtablerow('', '', $apc);
showtablerow('', '', $xcache);
showtablerow('', '', $ea);
showtablerow('', '', $wincache);
showtablefooter();
if (!isset($setting['memory'])) {
C::t('common_setting')->update('memory', '');
$setting['memory'] = '';
}
if ($do == 'clear') {
C::memory()->clear();
}
$setting['memory'] = dunserialize($setting['memory']);
showtableheader('setting_memory_function', 'fixpadding');
showsubtitle(array('setting_memory_func', 'setting_memory_func_enable', 'setting_memory_func_ttl', ''));
foreach (getmemorycachekeys() as $skey) {
$ttl = isset($setting['memory'][$skey]) ? intval($setting['memory'][$skey]) : '';
showtablerow('', array('width="120"', 'width="120"', 'width="120"', ''), array(cplang('setting_memory_func_' . $skey), '<input type="checkbox" class="checkbox" name="settingnew[memory][' . $skey . '][enable]" ' . ($ttl !== '' ? 'checked' : '') . ' value="1">', '<input type="text" class="txt" name="settingnew[memory][' . $skey . '][ttl]" value="' . $ttl . '">', cplang('setting_memory_func_' . $skey . '_comment')));
}
} elseif ($operation == 'memorydata') {
$cache_keys = getmemorycachekeys();
if (submitcheck('memorydatasubmit')) {
$flag = 0;
foreach ($cache_keys as $k) {
if ($id = $_GET[$k . '_id']) {
if ($k == 'common_member') {
示例5: if
<?php } ?>Copyright <br /> © 2001-2013 <a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a></p>
</div>
<div id="frt">
<p>
<?php if($_G['setting']['site_qq']) { ?><a href="http://wpa.qq.com/msgrd?V=3&Uin=<?php echo $_G['setting']['site_qq'];?>&Site=<?php echo $_G['setting']['bbname'];?>&Menu=yes&from=discuz" target="_blank" title="QQ"><img src="<?php echo IMGDIR;?>/site_qq.jpg" alt="QQ" /></a><span class="pipe">|</span><?php } if(is_array($_G['setting']['footernavs'])) foreach($_G['setting']['footernavs'] as $nav) { if($nav['available'] && ($nav['type'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1)) ||
!$nav['type'] && ($nav['id'] == 'stat' && $_G['group']['allowstatdata'] || $nav['id'] == 'report' && $_G['uid'] || $nav['id'] == 'archiver' || $nav['id'] == 'mobile' || $nav['id'] == 'darkroom'))) { ?><?php echo $nav['code'];?><span class="pipe">|</span><?php } } ?>
<a href="<?php echo $_G['setting']['siteurl'];?>" target="_blank"><?php echo $_G['setting']['sitename'];?></a>
<?php if($_G['setting']['icp']) { ?>( <a href="http://www.miitbeian.gov.cn/" target="_blank"><?php echo $_G['setting']['icp'];?></a> )<?php } ?>
<?php if(!empty($_G['setting']['pluginhooks']['global_footerlink'])) echo $_G['setting']['pluginhooks']['global_footerlink'];?>
<?php if($_G['setting']['statcode']) { ?><?php echo $_G['setting']['statcode'];?><?php } ?>
</p><p>GMT<?php echo $_G['timenow']['offset'];?>, <?php echo $_G['timenow']['time'];?>
<?php if(debuginfo()) { ?>, Processed in <?php echo $_G['debuginfo']['time'];?> second(s), <?php echo $_G['debuginfo']['queries'];?> queries<?php if($_G['gzipcompress']) { ?>, Gzip On<?php } if(C::memory()->type) { ?>, <?php echo ucwords(C::memory()->type); ?> On<?php } ?>.<?php } ?></p>
</div><?php updatesession();?><?php if($_G['uid'] && $_G['group']['allowinvisible']) { ?>
<script type="text/javascript">
var invisiblestatus = '<?php if($_G['session']['invisible']) { ?>隱身<?php } else { ?>在線<?php } ?>';
var loginstatusobj = $('loginstatusid');
if(loginstatusobj != undefined && loginstatusobj != null) loginstatusobj.innerHTML = invisiblestatus;
</script>
<?php } ?>
</div>
</div>
</div>
<!--bottombg結束-->
<?php } ?>
<?php if(!$_G['setting']['bbclosed']) { ?>
<?php if($_G['uid'] && !isset($_G['cookie']['checkpm'])) { ?>