本文整理汇总了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);
}
示例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');
}
示例3: disconnect
/**
* properly disconnect from resources
*
* @access public
*/
function disconnect()
{
if ($this->disconnect) {
$this->dbc->disconnect();
$this->dbc = null;
}
}
示例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();
}
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
}
示例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'));
}
示例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;
}
示例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;
}
示例12: __destruct
/**
* Destructor.
*/
public function __destruct()
{
if ($this->dbh_ro) {
$this->dbh_ro->disconnect();
}
if ($this->dbh_rw) {
$this->dbh_rw->disconnect();
}
parent::__destruct();
}
示例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();
}
}
示例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;
}
示例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;
}