當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。