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


PHP object::disconnect方法代码示例

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


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

示例1: testConnection

 /**
  * testConnection
  *
  * @return void
  */
 public function testConnection()
 {
     $this->Couchdb = new CouchdbSource($this->config);
     $this->Couchdb =& ConnectionManager::getDataSource($this->Post->useDbConfig);
     $reconnect = $this->Couchdb->reconnect($this->config);
     $this->assertTrue($reconnect);
     $disconnect = $this->Couchdb->disconnect();
     $this->assertTrue($disconnect);
 }
开发者ID:asadaqain,项目名称:Guide-on-the-Side,代码行数:14,代码来源:couchdb_source.test.php

示例2: disconnect

 /**
  * Disconnect from the dict server
  *
  * @see     Net_Socket::disconnect()
  * @return  mixed  Net_Socket::disconnect()'s return value
  * @author  Ian Eure <ieure@php.net>
  */
 function disconnect()
 {
     if (isset($this->_socket)) {
         return $this->_socket->disconnect();
     }
     return new PEAR_Error('not connected');
 }
开发者ID:sankam-nikolya,项目名称:lptt,代码行数:14,代码来源:Dict.php

示例3: disconnect

 /**
  * properly disconnect from resources
  *
  * @access  public
  */
 function disconnect()
 {
     if ($this->disconnect) {
         $this->dbc->disconnect();
         $this->dbc = null;
     }
 }
开发者ID:BackupTheBerlios,项目名称:hem,代码行数:12,代码来源:MDB2.php

示例4:

 /**
  * PEAR-Deconstructor
  * Call deconstructor of parent,
  * close database connection if open
  */
 function _Cache_DB()
 {
     $this->_Cache();
     if (is_object($this->db)) {
         $this->db->disconnect();
     }
 }
开发者ID:vojtajina,项目名称:sitellite,代码行数:12,代码来源:DB.php

示例5: return

 /**
  * Sends the QUIT command
  *
  * @return bool Success/Failure
  */
 function _cmdQuit()
 {
     $data = $this->_sendCmd('QUIT');
     $this->_state = NET_POP3_STATE_DISCONNECTED;
     $this->_socket->disconnect();
     return (bool) $data;
 }
开发者ID:drognisep,项目名称:Simple-Groupware,代码行数:12,代码来源:POP3.php

示例6: destroy

	/**
	 * destroy
	 * destroy the module
	 *
	 * @access public
	 * @param string $p_sErrorMsg
	 * @return void
	 */
	public function destroy($p_sErrorMsg = '') {
		if (!empty($p_sErrorMsg)) {
			$this->ircClass->privMsg($this->m_aConfig['setup']['channel'], $p_sErrorMsg);
		}

		$this->closeLogfile();

		if (!empty($this->m_aConfig['local']['ip']) && $this->m_bAuthenticated == true) {
			$this->rawPacketSend('logaddress_del '.$this->m_aConfig['local']['ip'].':'.$this->m_aConfig['local']['port']);
		}

		if ($this->timerExists('processResponse')) {
			$this->timerClass->removeTimer('processResponse');
		}
		if ($this->timerExists('doSendQueue')) {
			$this->timerClass->removeTimer('doSendQueue');
		}
		if ($this->timerExists('doReconnect')) {
			$this->timerClass->removeTimer('doReconnect');
		}
		$this->timerClass->removeTimer('parseReadLog');
		$this->timerClass->removeTimer('statusQuery');

		@socket_close($this->m_oRecvSock);
		if (!is_null($this->m_oSendSock)) {
			$this->m_oSendSock->disconnect();
		}

		$this->resetClassVars();
	}
开发者ID:Gulerod,项目名称:php-irc,代码行数:38,代码来源:source_rcon.php

示例7: close

 /**
  * Closes the connection to the database if it is still open and we were
  * the ones that opened it.  It is the caller's responsible to close an
  * existing connection that was passed to us via $conf['db'].
  *
  * @return boolean   True on success, false on failure.
  * @access public     
  */
 function close()
 {
     if ($this->_opened && !$this->_existingConnection) {
         $this->_opened = false;
         return $this->_db->disconnect();
     }
     return $this->_opened === false;
 }
开发者ID:BigBin,项目名称:web_crawler,代码行数:16,代码来源:sql.php

示例8: _disconnect

 /**
  * Disconnects from the SQL server and cleans up the connection.
  */
 protected function _disconnect()
 {
     if ($this->_connected) {
         $this->_connected = false;
         $this->_db->disconnect();
         $this->_write_db->disconnect();
     }
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:11,代码来源:Sql.php

示例9: testConnection

 /**
  * Test connection.
  *
  * @return void
  */
 public function testConnection()
 {
     $this->CouchDB = new CouchDBSource($this->_config);
     $this->CouchDB = ConnectionManager::getDataSource($this->Post->useDbConfig);
     $reconnect = $this->CouchDB->reconnect($this->_config);
     $this->assertSame($reconnect, true, __d('test_cases', 'Not reconnected'));
     $disconnect = $this->CouchDB->disconnect();
     $this->assertSame($disconnect, true, __d('test_cases', 'Not disconnect'));
 }
开发者ID:riddhisoni1324,项目名称:cakephp_fxchng,代码行数:14,代码来源:CouchDBSourceTest.php

示例10: disconnect

 /**
  * Disconnect and destroy the current SMTP connection.
  *
  * @return boolean True if the SMTP connection no longer exists.
  *
  * @since  1.1.9
  * @access public
  */
 function disconnect()
 {
     /* If we have an SMTP object, disconnect and destroy it. */
     if (is_object($this->_smtp) && $this->_smtp->disconnect()) {
         $this->_smtp = null;
     }
     /* We are disconnected if we no longer have an SMTP object. */
     return $this->_smtp === null;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:17,代码来源:smtp.php

示例11: close

 /**
  * Closes the connection to the database if it is still open and we were
  * the ones that opened it.  It is the caller's responsible to close an
  * existing connection that was passed to us via $conf['db'].
  *
  * @return boolean   True on success, false on failure.
  * @access public
  */
 function close()
 {
     if ($this->_opened && !$this->_existingConnection) {
         $this->_opened = false;
         $this->_db->freePrepared($this->_statement);
         return $this->_db->disconnect();
     }
     return $this->_opened === false;
 }
开发者ID:jamesiarmes,项目名称:php-ups-api,代码行数:17,代码来源:sql.php

示例12: __destruct

 /**
  * Destructor.
  */
 public function __destruct()
 {
     if ($this->dbh_ro) {
         $this->dbh_ro->disconnect();
     }
     if ($this->dbh_rw) {
         $this->dbh_rw->disconnect();
     }
     parent::__destruct();
 }
开发者ID:ericpridham,项目名称:site,代码行数:13,代码来源:db.php

示例13: switch

 /**
  * Closes the connection to an SSH server
  *
  * @access private
  */
 function _close()
 {
     switch ($this->mode) {
         case self::MODE_SSH2:
             $this->ssh->_close_channel(SSH2::CHANNEL_EXEC, true);
             break;
         case self::MODE_SSH1:
             $this->ssh->disconnect();
     }
 }
开发者ID:andytan2624,项目名称:andytan.net,代码行数:15,代码来源:SCP.php

示例14: disconnect

 /**
  * properly disconnect from resources
  *
  * @return bool true on success and false on failure
  *
  * @access public
  */
 function disconnect()
 {
     if ($this->dsn) {
         $result = $this->dbc->disconnect();
         if (PEAR::isError($result)) {
             $this->stack->push(LIVEUSER_ERROR, 'exception', array('reason' => $result->getMessage() . '-' . $result->getUserInfo()));
             return false;
         }
         $this->dbc = false;
     }
     return true;
 }
开发者ID:laiello,项目名称:coopcrucial,代码行数:19,代码来源:SQL.php

示例15: installSchema

 /**
  * Installs table(s)/data schema into database
  *
  * @access  public
  * @param   string  $new_schema     New schema file path/name
  * @param   array   $variables      Schema variables
  * @param   string  $old_schema     Old schema file path/name
  * @param   string  $init_data      Schema is include initialization data
  * @param   string  $create         If the database should be created
  * @return  mixed   True on success and Jaws_Error on failure
  */
 function installSchema($new_schema, $variables = array(), $old_schema = false, $init_data = false, $create = true)
 {
     MDB2::loadFile('Schema');
     $dsn = $this->_dsn;
     unset($dsn['database']);
     // If the database should be created
     $variables['create'] = (int) $create;
     // The database name
     $variables['database'] = $this->_dsn['database'];
     // Prefix of all the tables added
     $variables['table_prefix'] = $this->getPrefix();
     // set default charset
     if (!isset($variables['charset'])) {
         $variables['charset'] = $this->getUnicodeCharset();
     }
     $options = array('debug' => false, 'log_line_break' => '<br />', 'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL ^ MDB2_PORTABILITY_FIX_CASE ^ MDB2_PORTABILITY_RTRIM, 'quote_identifier' => true, 'force_defaults' => false);
     switch ($this->_dsn['phptype']) {
         case 'ibase':
             $options['portability'] = $options['portability'] | MDB2_PORTABILITY_FIX_CASE;
             $options['database_path'] = empty($this->_db_path) ? JAWS_DATA : $this->_db_path;
             break;
         case 'oci8':
             $options['emulate_database'] = false;
             $options['portability'] = $options['portability'] | MDB2_PORTABILITY_FIX_CASE;
             break;
         case 'sqlite':
             $options['database_path'] = empty($this->_db_path) ? JAWS_DATA : $this->_db_path;
             break;
         case 'mssql':
             $options['multibyte_text_field_type'] = $this->Is_FreeTDS_MSSQL_Driver();
             break;
     }
     if ($this->_is_dba) {
         $options['DBA_username'] = $this->_dsn['username'];
         $options['DBA_password'] = $this->_dsn['password'];
     }
     if (!isset($this->schema)) {
         $this->schema =& MDB2_Schema::factory($this->dbc, $options);
         if (MDB2::isError($this->schema)) {
             return $this->schema;
         }
     }
     $method = $init_data === true ? 'writeInitialization' : 'updateDatabase';
     $result = $this->schema->{$method}($new_schema, $old_schema, $variables);
     if (MDB2::isError($result)) {
         $this->schema->disconnect();
         unset($this->schema);
         $GLOBALS['log']->Log(JAWS_ERROR_ERROR, $result->getUserInfo(), 2);
         return new Jaws_Error($result->getMessage(), $result->getCode(), JAWS_ERROR_ERROR, 1);
     }
     return $result;
 }
开发者ID:juniortux,项目名称:jaws,代码行数:63,代码来源:DB.php


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