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


PHP Object::connect方法代码示例

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


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

示例1: run

 public function run()
 {
     $options = C("SESSION_OPTIONS");
     $this->memcache = new Memcache();
     $this->memcache->connect($options['host'], $options['port'], 2.5);
     session_set_save_handler(array(&$this, "open"), array(&$this, "close"), array(&$this, "read"), array(&$this, "write"), array(&$this, "destroy"), array(&$this, "gc"));
 }
开发者ID:jyht,项目名称:v5,代码行数:7,代码来源:SessionMemcache.class.php

示例2: connect

 public function connect()
 {
     $config = C('session.redis');
     $this->redis = new Redis();
     $this->redis->connect($config['host'], $config['port']);
     if (!empty($config['password'])) {
         $this->redis->auth($config['password']);
     }
     $this->redis->select((int) $config['database']);
 }
开发者ID:houdunwang,项目名称:hdphp,代码行数:10,代码来源:RedisHandler.php

示例3: C

 function __construct()
 {
     $config = C("SESSION_REDIS");
     $this->redis = new Redis();
     $this->redis->connect($config['host'], $config['port'], 2.5);
     if (!empty($config['password'])) {
         $this->redis->auth($config['password']);
     }
     $this->redis->select((int) $config['Db']);
 }
开发者ID:sxau-web-team,项目名称:wish-web,代码行数:10,代码来源:SessionRedis.class.php

示例4: start

 /**
  * @see	\herosphp\session\interfaces\ISession::start().
  */
 public static function start($config = NULL)
 {
     self::$handler = new \Redis();
     self::$handler->connect($config['host'], $config['port']);
     self::$config = $config;
     if (!$config['gc_maxlifetime']) {
         self::$config['gc_maxlifetime'] = ini_get('session.gc_maxlifetime');
     }
     session_set_save_handler(array(__CLASS__, 'open'), array(__CLASS__, 'close'), array(__CLASS__, 'read'), array(__CLASS__, 'write'), array(__CLASS__, 'destroy'), array(__CLASS__, 'gc'));
     session_start();
 }
开发者ID:yangjian102621,项目名称:herosphp,代码行数:14,代码来源:RedisSession.class.php

示例5: make

 public function make()
 {
     $config = C('session.redis');
     $this->redis = new Redis();
     $this->redis->connect($config['host'], $config['port']);
     if (!empty($config['password'])) {
         $this->redis->auth($config['password']);
     }
     $this->redis->select((int) $config['database']);
     session_set_save_handler(array(&$this, "open"), array(&$this, "close"), array(&$this, "read"), array(&$this, "write"), array(&$this, "destroy"), array(&$this, "gc"));
 }
开发者ID:ChenHuaPHP,项目名称:ZOLshop,代码行数:11,代码来源:Redis.php

示例6: C

 function __construct()
 {
     $config = C("SESSION_REDIS");
     $this->redis = new Redis();
     $this->redis->connect($config['host'], $config['port'], 2.5);
     if (!empty($config['password'])) {
         $this->redis->auth($config['password']);
     }
     $this->redis->select((int) $config['db']);
     session_set_save_handler(array(&$this, "open"), array(&$this, "close"), array(&$this, "read"), array(&$this, "write"), array(&$this, "destroy"), array(&$this, "gc"));
 }
开发者ID:hdbaiyu,项目名称:HDPHP,代码行数:11,代码来源:SessionRedis.class.php

示例7: start

 /**
  * @see	\herosphp\session\interfaces\ISession::start().
  */
 public static function start($config = NULL)
 {
     if (!$config) {
         if (APP_DEBUG) {
             E("config should be pass to app");
         }
     }
     self::$handler = new \Memcache();
     self::$handler->connect($config['host'], $config['port']) or E("could not to connect the memcache server!");
     self::$config = $config;
     if (!$config['gc_maxlifetime']) {
         self::$config['gc_maxlifetime'] = ini_get('session.gc_maxlifetime');
     }
     session_set_save_handler(array(__CLASS__, 'open'), array(__CLASS__, 'close'), array(__CLASS__, 'read'), array(__CLASS__, 'write'), array(__CLASS__, 'destroy'), array(__CLASS__, 'gc'));
     session_start();
 }
开发者ID:cqmyg,项目名称:herosphp2,代码行数:19,代码来源:MemSession.class.php

示例8: __construct

 public function __construct($samebugKey)
 {
     /** Set up Samebug Application Key
      * @var string $samebugKey
      */
     $this->samebugKey = $samebugKey;
     /** Set up connector class and create a new instance.
      * @var string $connectorClass
      */
     $connectorClass = "Samebug\\{$this->connectorType}";
     /** Set up the connection.
      * @var \Samebug\SamebugRecorderConnectorCurl $connector
      */
     $this->connector = new $connectorClass();
     $this->connector->setHost($this->connectorHost);
     $this->connector->setPlatform(self::SAMEBUG_PLATFORM);
     $this->connector->setProtocolVersion(self::SAMEBUG_PROTOCOL_VERSION);
     $this->connector->setKey($samebugKey);
     $this->connector->connect();
 }
开发者ID:samebug,项目名称:samebug-notifier-php,代码行数:20,代码来源:SamebugRecorder.php

示例9: serviceConnect

 /**
  * Connect the Behavior to a new URL
  *
  * @param string $url The URL to connect to.
  * @param array $options Options Array for the new connection. 
  * @return bool success
  **/
 function serviceConnect(&$Model, $url, $options = array())
 {
     $options = array_merge($this->__settings[$Model->name], $options);
     $path = $this->_setPath($url);
     $options['host'] = $path['host'];
     if ($this->Socket === null) {
         $this->Socket = new CakeSocket($options);
     } else {
         if ($this->Socket->connected && $this->__settings[$Model->name]['persistent'] == false) {
             $this->serviceDisconnect($Model);
         }
         $this->Socket->config = $options;
     }
     $this->__setInfo(array('connection' => $options, 'host' => $path['host'], 'path' => $path['path']));
     return $this->Socket->connect();
 }
开发者ID:barraemme,项目名称:waterwall,代码行数:23,代码来源:webservice.php

示例10: connect

 /**
  * Connect to database
  *
  * Try to connect to the database provided by LumineConfiguration object.<br />
  * If its already connect, use the current connection
  * @return void
  * @access Public
  */
 function connect()
 {
     LumineLog::logger(1, 'Método <strong>connect</strong> invocado por ' . get_class($this), __FILE__, __LINE__);
     if ($this->oTable == null) {
         LumineLog::logger(3, 'Entidade não encontrada: ' . get_class($this), __FILE__, __LINE__);
         exit;
     }
     if ($this->conn == null) {
         $this->conn =& $this->oTable->config->conn;
     }
     if ($this->conn->IsConnected() == false) {
         LumineLog::logger(1, 'Criando uma nova conexão em ' . get_class($this), __FILE__, __LINE__);
         $c = $this->oTable->config->config;
         $this->conn->connect($c['host'], $c['user'], $c['password'], $c['database']);
     } else {
         LumineLog::logger(1, 'Usando conexão cacheada', __FILE__, __LINE__);
     }
 }
开发者ID:adamlogic,项目名称:jquery-old-svn-repo,代码行数:26,代码来源:LumineBase_back.php

示例11: C

 function __construct()
 {
     $config = C("SESSION_MEMCACHE");
     $this->memcache = new Memcache();
     $this->memcache->connect($config['host'], $config['port'], 2.5);
 }
开发者ID:sxau-web-team,项目名称:wish-web,代码行数:6,代码来源:SessionMemcache.class.php


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