当前位置: 首页>>代码示例>>PHP>>正文


PHP CacheEngine类代码示例

本文整理汇总了PHP中CacheEngine的典型用法代码示例。如果您正苦于以下问题:PHP CacheEngine类的具体用法?PHP CacheEngine怎么用?PHP CacheEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CacheEngine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: make_admin_menu

function make_admin_menu()
{
    global $dirs, $futurebb_user, $base_config;
    if (!file_exists(FORUM_ROOT . '/app_config/cache/admin_pages.php')) {
        CacheEngine::CacheAdminPages();
    }
    include FORUM_ROOT . '/app_config/cache/admin_pages.php';
    ?>
	<div class="forum_content leftmenu">
		<h2 class="boxtitle">Administration</h2>
		<ul class="leftnavlist">
		<?php 
    if ($futurebb_user['g_admin_privs']) {
        $p = $admin_pages;
    } else {
        $p = $mod_pages;
    }
    foreach ($p as $key => $val) {
        echo '<li';
        if ($dirs[2] == $key) {
            echo ' class="active"';
        }
        echo '><a href="' . $base_config['baseurl'] . '/admin/' . $key . '">' . htmlspecialchars(translate($val)) . '</a></li>';
    }
    ?>
		</ul>
	</div>
	<?php 
}
开发者ID:Cythral,项目名称:futurebb,代码行数:29,代码来源:admin.php

示例2: init

/**
 * Initialize the Cache Engine
 *
 * Called automatically by the cache frontend
 * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
 *
 * @param array $settings array of setting for the engine
 * @return boolean True if the engine has been successfully initialized, false if not
 * @see CacheEngine::__defaults
 */
	public function init($settings = array()) {
		if (!isset($settings['prefix'])) {
			$settings['prefix'] = Inflector::slug(APP_DIR) . '_';
		}
		$settings += array('engine' => 'Apc');
		parent::init($settings);
		return function_exists('apc_dec');
	}
开发者ID:hungnt88,项目名称:5stars-1,代码行数:18,代码来源:ApcEngine.php

示例3: init

 /**
  * Initialize the Cache Engine
  *
  * Called automatically by the cache frontend
  * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
  *
  * @param array $settings array of setting for the engine
  * @return bool True if the engine has been successfully initialized, false if not
  * @see CacheEngine::__defaults
  */
 public function init($settings = array())
 {
     if (!isset($settings['prefix'])) {
         $settings['prefix'] = Inflector::slug(APP_DIR) . '_';
     }
     $settings += array('engine' => 'Apc');
     parent::init($settings);
     if (function_exists('apcu_dec')) {
         $this->_apcExtension = 'apcu';
         return true;
     }
     return function_exists('apc_dec');
 }
开发者ID:mgoo,项目名称:MovieServer,代码行数:23,代码来源:ApcEngine.php

示例4: init

 /**
  * Initialize the Cache Engine
  *
  * Called automatically by the cache frontend
  * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
  *
  * @param array $settings array of setting for the engine
  * @return boolean True if the engine has been successfully initialized, false if not
  */
 public function init($settings = array())
 {
     if (!class_exists('Memcache')) {
         return false;
     }
     if (!isset($settings['prefix'])) {
         $settings['prefix'] = Inflector::slug(APP_DIR) . '_';
     }
     $settings += array('engine' => 'Memcache', 'servers' => array('127.0.0.1'), 'compress' => false, 'persistent' => true);
     parent::init($settings);
     if ($this->settings['compress']) {
         $this->settings['compress'] = MEMCACHE_COMPRESSED;
     }
     if (is_string($this->settings['servers'])) {
         $this->settings['servers'] = array($this->settings['servers']);
     }
     if (!isset($this->_Memcache)) {
         $return = false;
         $this->_Memcache = new Memcache();
         foreach ($this->settings['servers'] as $server) {
             list($host, $port) = $this->_parseServerString($server);
             if ($this->_Memcache->addServer($host, $port, $this->settings['persistent'])) {
                 $return = true;
             }
         }
         return $return;
     }
     return true;
 }
开发者ID:4Queen,项目名称:php-buildpack,代码行数:38,代码来源:MemcacheEngine.php

示例5: init

 /**
  * Initialize the Cache Engine
  *
  * Called automatically by the cache frontend
  * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
  *
  * @param array $setting array of setting for the engine
  * @return boolean True if the engine has been successfully initialized, false if not
  * @access public
  */
 function init($settings = array())
 {
     if (!class_exists('Memcache')) {
         return false;
     }
     parent::init($settings);
     $defaults = array('servers' => array('127.0.0.1'), 'compress' => false);
     $this->settings = array_merge($this->settings, $defaults, $settings);
     if ($this->settings['compress']) {
         $this->settings['compress'] = MEMCACHE_COMPRESSED;
     }
     if (!is_array($this->settings['servers'])) {
         $this->settings['servers'] = array($this->settings['servers']);
     }
     $this->__Memcache =& new Memcache();
     foreach ($this->settings['servers'] as $server) {
         $parts = explode(':', $server);
         $host = $parts[0];
         $port = 11211;
         if (isset($parts[1])) {
             $port = $parts[1];
         }
         if ($this->__Memcache->addServer($host, $port)) {
             return true;
         }
     }
     return false;
 }
开发者ID:kaz0636,项目名称:openflp,代码行数:38,代码来源:memcache.php

示例6: init

	/**
	 * Initialize the Cache Engine
	 *
	 * Called automatically by the cache frontend
	 * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
	 *
	 * @param array $setting array of setting for the engine
	 * @return boolean True if the engine has been successfully initialized, false if not
	 * @access public
	 */
	function init($settings) {
		parent::init(array_merge(array(
			'engine' => 'Xcache', 'prefix' => Inflector::slug(APP_DIR) . '_', 'PHP_AUTH_USER' => 'user', 'PHP_AUTH_PW' => 'password'
			), $settings)
			);
			return function_exists('xcache_info');
	}
开发者ID:ralmeida,项目名称:FoundFree.org,代码行数:17,代码来源:xcache.php

示例7: init

 /**
  * Initialize the Cache Engine
  *
  * Called automatically by the cache frontend
  * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
  *
  * @param array $setting array of setting for the engine
  * @return boolean True if the engine has been successfully initialized, false if not
  * @access public
  */
 function init($settings = array())
 {
     if (!class_exists('Memcache')) {
         return false;
     }
     parent::init(array_merge(array('engine' => 'Memcache', 'prefix' => Inflector::slug(APP_DIR) . '_', 'servers' => array('127.0.0.1'), 'compress' => false), $settings));
     if ($this->settings['compress']) {
         $this->settings['compress'] = MEMCACHE_COMPRESSED;
     }
     if (!is_array($this->settings['servers'])) {
         $this->settings['servers'] = array($this->settings['servers']);
     }
     if (!isset($this->__Memcache)) {
         $return = false;
         $this->__Memcache =& new Memcache();
         foreach ($this->settings['servers'] as $server) {
             $parts = explode(':', $server);
             $host = $parts[0];
             $port = 11211;
             if (isset($parts[1])) {
                 $port = $parts[1];
             }
             if ($this->__Memcache->addServer($host, $port)) {
                 $return = true;
             }
         }
         return $return;
     }
     return true;
 }
开发者ID:maverick2041,项目名称:wpkgexpress,代码行数:40,代码来源:memcache.php

示例8: init

	/**
	 * Initialize the cache engine
	 *
	 * Called automatically by the cache frontend
	 *
	 * @param array $params Associative array of parameters for the engine
	 * @return boolean true if the engine has been succesfully initialized, false if not
	 * @access public
	 */
	function init($settings = array()) {
		if (!function_exists('eaccelerator_put')) {
			return false;
		}
          return parent::init(array_merge(array('engine' => 'Eaccelerator', 'prefix' => Inflector::slug(APP_DIR) . '_'), $settings));

	}
开发者ID:nard,项目名称:Pushchat-Server,代码行数:16,代码来源:eaccelerator.php

示例9: init

 public function init($settings = array())
 {
     $settings += array('engine' => 'DbTable', 'storage' => 'cache_db', 'prefix' => '', 'duration' => false, 'serialize' => true);
     parent::init($settings);
     $this->model = new DbCache(false, $this->settings['storage']);
     return true;
 }
开发者ID:Mirocow,项目名称:gpz,代码行数:7,代码来源:DbTableEngine.php

示例10: init

 /**
  * Initialize the Cache Engine
  *
  * Called automatically by the cache frontend
  * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
  *
  * @param array $setting array of setting for the engine
  * @return boolean True if the engine has been successfully initialized, false if not
  * @access public
  */
 function init($settings)
 {
     parent::init($settings);
     $defaults = array('PHP_AUTH_USER' => 'cake', 'PHP_AUTH_PW' => 'cake');
     $this->settings = am($this->settings, $defaults, $settings);
     return function_exists('xcache_info');
 }
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:17,代码来源:xcache.php

示例11: init

 /**
  * Initialize the Cache Engine
  *
  * Called automatically by the cache frontend
  * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
  *
  * @param array $settings array of setting for the engine
  * @return bool True if the engine has been successfully initialized, false if not
  */
 public function init($settings = [])
 {
     if (!class_exists('Memcached')) {
         return false;
     }
     if (!isset($settings['prefix'])) {
         $settings['prefix'] = Inflector::slug(APP_DIR) . '_';
     }
     $settings += ['engine' => 'Memcached', 'servers' => ['127.0.0.1'], 'compress' => false, 'persistent' => true];
     parent::init($settings);
     $this->_keys .= $this->settings['prefix'];
     if (!is_array($this->settings['servers'])) {
         $this->settings['servers'] = [$this->settings['servers']];
     }
     if (!isset($this->_Memcached)) {
         $return = false;
         $this->_Memcached = new Memcached($this->settings['persistent'] ? 'mc' : null);
         $this->_setOptions();
         if (!count($this->_Memcached->getServerList())) {
             $servers = [];
             foreach ($this->settings['servers'] as $server) {
                 $servers[] = $this->_parseServerString($server);
             }
             if ($this->_Memcached->addServers($servers)) {
                 $return = true;
             }
         }
         if (!$this->_Memcached->get($this->_keys)) {
             $this->_Memcached->set($this->_keys, '');
         }
         return $return;
     }
     return true;
 }
开发者ID:ByMyHandsOnly,项目名称:BMHO_Web,代码行数:43,代码来源:MemcachedEngine.php

示例12: init

 function init($settings = array())
 {
     parent::init(array_merge(array('engine' => 'SuperStack', 'prefix' => Inflector::slug(APP_DIR) . '_'), $settings));
     foreach ($settings['stack'] as $key => $stack) {
         Cache::config($key, $stack);
     }
     return true;
 }
开发者ID:voidet,项目名称:super_stack,代码行数:8,代码来源:super_stack.php

示例13: init

 /**
  * Initialize the Cache Engine
  *
  * Called automatically by the cache frontend
  * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
  *
  * @param array $settings array of setting for the engine
  * @return bool True if the engine has been successfully initialized, false if not
  */
 public function init($settings = array())
 {
     if (php_sapi_name() !== 'cli') {
         parent::init(array_merge(array('engine' => 'Xcache', 'prefix' => Inflector::slug(APP_DIR) . '_', 'PHP_AUTH_USER' => 'user', 'PHP_AUTH_PW' => 'password'), $settings));
         return function_exists('xcache_info');
     }
     return false;
 }
开发者ID:keetamhoang,项目名称:lotdephong,代码行数:17,代码来源:XcacheEngine.php

示例14: init

 /**
  * Initialize the Cache Engine
  *
  * Called automatically by the cache frontend
  * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
  *
  * @param array $settings array of setting for the engine
  * @return boolean True if the engine has been successfully initialized, false if not
  */
 public function init($settings = array())
 {
     if (!class_exists('Redis')) {
         return false;
     }
     parent::init(array_merge(array('engine' => 'Redis', 'prefix' => null, 'server' => '127.0.0.1', 'port' => 6379, 'password' => false, 'timeout' => 0, 'persistent' => true), $settings));
     return $this->_connect();
 }
开发者ID:cc2i,项目名称:calibrephp,代码行数:17,代码来源:RedisEngine.php

示例15: init

 /**
  * Initialize the Cache Engine
  *
  * Called automatically by the cache frontend
  * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
  *
  * @param array $settings array of setting for the engine
  * @return bool True if the engine has been successfully initialized, false if not
  */
 public function init($settings = array())
 {
     if (!class_exists('Redis')) {
         return false;
     }
     parent::init(array_merge(array('engine' => 'Redis', 'prefix' => Inflector::slug(APP_DIR) . '_', 'server' => '127.0.0.1', 'database' => 0, 'port' => 6379, 'password' => false, 'timeout' => 0, 'persistent' => true, 'unix_socket' => false), $settings));
     return $this->_connect();
 }
开发者ID:yuuicchan0912,项目名称:sample1,代码行数:17,代码来源:RedisEngine.php


注:本文中的CacheEngine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。