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


PHP Memcached::__construct方法代码示例

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


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

示例1: __construct

 public function __construct($serverName = null)
 {
     if ($serverName != null) {
         $this->server = $serverName;
     }
     parent::__construct();
 }
开发者ID:jkhaled,项目名称:bms,代码行数:7,代码来源:MyCache.php

示例2:

 function __construct()
 {
     parent::__construct();
     $_conf = Vera_Conf::getConf('memcached');
     $this->_connect($_conf['host'], $_conf['port']);
     self::$conf = $_conf;
 }
开发者ID:HackathonTsubaki,项目名称:Backend,代码行数:7,代码来源:Cache.php

示例3: __construct

 public function __construct()
 {
     parent::__construct('internal.makerspace.se');
     // Do NOT spawn millions of connections...
     if (!count($this->getServerList())) {
         parent::addServer('127.0.0.1', 11211);
     }
 }
开发者ID:johusman,项目名称:internal,代码行数:8,代码来源:Memcache.php

示例4: __construct

 public function __construct(&$system)
 {
     parent::__construct();
     $cfg = explode(':', __CFG::MEMCACHE);
     if ($this->addServer($cfg[0], $cfg[1])) {
         trigger_error('Connect Mcache Server Fail!', E_USER_ERROR);
     }
 }
开发者ID:a195474368,项目名称:ejiawang,代码行数:8,代码来源:mcached.mdl.php

示例5: __construct

 public function __construct($host, $port, $id = 'story_pool')
 {
     parent::__construct($id);
     if (!parent::addServer($host, $port)) {
         throw new Exception("Could not connect memcached server {$host}:{$port}." . "\n" . 'Error code: ' . parent::getResultCode() . "\n" . ' Error message: ' . parent::getResultMessage());
     }
     parent::setOption(Memcached::OPT_BINARY_PROTOCOL, true);
 }
开发者ID:aprikyblue,项目名称:PHP-Conditional-Reverse-Proxy,代码行数:8,代码来源:gateway_memcached.php

示例6: __construct

 /**
  * Construct
  * @param array $options the config options
  */
 public function __construct(array $options = [])
 {
     // call the parent with the cache pool name
     parent::__construct(self::MEMCACHED_POOL);
     // add the memcache server pool
     if (!$this->getServerList() && isset($options['memcached']['server'])) {
         $this->set_server_pool($options['memcached']['server']);
     }
 }
开发者ID:stevevega,项目名称:kima,代码行数:13,代码来源:Memcached.php

示例7: __construct

 public function __construct()
 {
     parent::__construct();
     $cfg = explode(':', __CFG::MEMCACHE);
     if (!$this->addServer($cfg[0], $cfg[1])) {
         trigger_error('Memcache Connect Fail', E_USER_ERROR);
     } else {
         $this->prefix();
     }
 }
开发者ID:a195474368,项目名称:ejiawang,代码行数:10,代码来源:memcached.mdl.php

示例8: __construct

 public function __construct($persistent_id = 'xxam', $server_host = 'localhost', $server_port = 11211, $options = array())
 {
     $this->persistent_id = $persistent_id;
     $this->server_host = $server_host;
     $this->server_port = $server_port;
     $this->options = $options;
     parent::__construct($persistent_id);
     $this->addServer($this->server_host, $this->server_port);
     $this->setOptions($this->options);
 }
开发者ID:julianstricker,项目名称:xxam,代码行数:10,代码来源:MemcachedService.php

示例9: __construct

 public function __construct($config)
 {
     if (!extension_loaded('memcached')) {
         die('Memcached extension that required by Driver memcached is not available.');
     }
     parent::__construct();
     foreach ($config['server'] as $server) {
         $this->addServer($server['host'], $server['port'], $server['persistent']);
     }
 }
开发者ID:finzaiko,项目名称:Panada,代码行数:10,代码来源:Memcached.php

示例10: __construct

 public function __construct($host = Memcached::DEFAULT_HOST, $port = Memcached::DEFAULT_PORT, $buffer = Memcached::DEFAULT_BUFFER)
 {
     if (PinbaClient::isEnabled()) {
         PinbaClient::me()->timerStart('memcached_' . $host . '_' . $port . '_connect', array('memcached_connect' => $host . '_' . $port));
     }
     parent::__construct($host, $port, $buffer);
     if (PinbaClient::isEnabled()) {
         PinbaClient::me()->timerStop('memcached_' . $host . '_' . $port . '_connect');
     }
 }
开发者ID:rero26,项目名称:onphp-framework,代码行数:10,代码来源:PinbedMemcached.class.php

示例11: __construct

 /**
  * @inheritdoc
  * @codeCoverageIgnore
  */
 public function __construct($prefix = '', $host = 'localhost', $port = 11211, $persistent_id = null)
 {
     parent::__construct($persistent_id);
     $this->host = $host;
     $this->port = 11211;
     $this->addServer($this->host, $this->port);
     $this->prefix = $prefix;
     if (empty($prefix)) {
         $this->prefix = (string) rand(100, 999);
     }
 }
开发者ID:jonafrank,项目名称:memcached-manager,代码行数:15,代码来源:MemcachedHandler.php

示例12:

 /**
  * KitMemcached Constructor
  * @param                    $key_prefix
  * @param MemcachedConnector $connector
  * @internal param bool        $safemode
  * @return \Kit\DB\Memcached\Memcached
  */
 function __construct($key_prefix, MemcachedConnector $connector)
 {
     // Construct parent
     parent::__construct();
     // Set param prefix
     self::$_prefix = crc32($key_prefix);
     // Inst: Object Connector class
     self::$_instConnector = $connector;
     // Void: Apply Connector container to base Memcached
     $this->applyConnector($this, self::$_instConnector);
     // set the key prefix.
     $this->setOptions(array(self::OPT_PREFIX_KEY => self::$_prefix));
 }
开发者ID:t4g,项目名称:kit-memcached,代码行数:20,代码来源:Memcached.php

示例13: die

 /**
  * Конструктор. Подключается к серваку мемкэша
  * 
  */
 function __construct()
 {
     parent::__construct();
     if (!($server = $GLOBALS['memcachedSessionServer'])) {
         // В /classes/config.php добавляем:
         // $memcachedSessionServer = 'localhost';
         if (!($server = $GLOBALS['memcachedServers'][0])) {
             die('Не найдены сервера Memcached');
         }
     }
     $this->bIsConnected = $this->addServer($server, 11211);
     $this->setOption(self::OPT_PREFIX_KEY, SERVER);
     $this->_log = new log('sessions/error-%d%m%Y.log', 'a');
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:18,代码来源:session_Memcached.php

示例14:

 function __construct($persistent_id = null)
 {
     if (is_null($persistent_id)) {
         parent::__construct();
         $this->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
         if (!count($this->getServerList())) {
             $this->addServers(\config\Conf::$memcachedserver);
         }
     } else {
         parent::__construct($persistent_id);
         $this->setOption(\Memcached::OPT_PREFIX_KEY, $persistent_id);
         $this->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
         if (!count($this->getServerList())) {
             $this->addServers(\config\Conf::$memcachedserver);
         }
     }
 }
开发者ID:CamTosh,项目名称:Mediastorrent,代码行数:17,代码来源:Memcached.php

示例15: __construct

 public function __construct($persistentId = '-')
 {
     parent::__construct($persistentId);
     $serverList = $this->getServerList();
     if (empty($serverList)) {
         $this->setOption(\Memcached::OPT_PREFIX_KEY, 'sndsgd-');
         $this->setOption(\Memcached::OPT_RECV_TIMEOUT, 1000);
         $this->setOption(\Memcached::OPT_SEND_TIMEOUT, 1000);
         $this->setOption(\Memcached::OPT_TCP_NODELAY, true);
         $this->setOption(\Memcached::OPT_SERVER_FAILURE_LIMIT, 50);
         $this->setOption(\Memcached::OPT_CONNECT_TIMEOUT, 500);
         $this->setOption(\Memcached::OPT_RETRY_TIMEOUT, 300);
         $this->setOption(\Memcached::OPT_REMOVE_FAILED_SERVERS, true);
         $this->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
         $this->addServer('127.0.0.1', 11211, 1);
     }
 }
开发者ID:GenomeUS,项目名称:sndsgd-util,代码行数:17,代码来源:Memcached.php


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