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


PHP resource::disconnect方法代码示例

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


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

示例1: close

 /**
  * Closes this connection
  *
  * @param boolean|string $connection - If connection is not given, or
  *   FALSE then connection that would be selected for writes would be
  *   closed. In a single-node configuration, that is then the whole
  *   connection, but if you are connected to a replica set, close() will
  *   only close the connection to the primary server.
  *
  * @return bool - Returns if the connection was successfully closed.
  */
 public function close($connection = null)
 {
     if ($this->socket) {
         $this->socket->disconnect();
         $this->protocol = null;
     }
     //TODO: implement $connection handling
 }
开发者ID:taniele,项目名称:mongofill,代码行数:19,代码来源:MongoClient.php

示例2: disconnect

 /**
  * This function close the FTP-connection
  *
  * @access  public
  * @return  mixed Returns true on success, Jaws_Error on failure
  */
 function disconnect()
 {
     $res = $this->_ftp->disconnect();
     if (PEAR::isError($res)) {
         return new Jaws_Error('Error while disconnecting from server ' . $this->_host, __FUNCTION__);
     }
     return true;
 }
开发者ID:uda,项目名称:jaws,代码行数:14,代码来源:FTP.php

示例3:

 /**
  * Destructs the storage object.
  */
 function __destruct()
 {
     $this->foowd->track('smdoc_db->destructor');
     // clean up object cache
     $this->objects->__destruct();
     // close connection
     $this->conn->disconnect();
     $this->foowd->track();
 }
开发者ID:teammember8,项目名称:roundcube,代码行数:12,代码来源:smdoc.env.database.php

示例4: disconnect

 /**
  * Attempt to disconnect from the SMTP server.
  *
  * @return mixed Returns a PEAR_Error with an error message on any
  *               kind of failure, or true on success.
  * @access public
  * @since  1.0
  */
 function disconnect()
 {
     if (PEAR::isError($error = $this->_put('QUIT'))) {
         return $error;
     }
     if (PEAR::isError($error = $this->_parseResponse(221))) {
         return $error;
     }
     if (PEAR::isError($error = $this->_socket->disconnect())) {
         return new PEAR_Error('Failed to disconnect socket: ' . $error->getMessage());
     }
     return true;
 }
开发者ID:bantudevelopment,项目名称:polysmis,代码行数:21,代码来源:SMTP.php

示例5: disconnect

 /**
  * Attempt to disconnect from the SMTP server.
  *
  * @return mixed Returns a PEAR_Error with an error message on any
  *               kind of failure, or true on success.
  * @access public
  */
 function disconnect()
 {
     if (PEAR::isError($this->socket->write("QUIT\r\n"))) {
         return new PEAR_Error('write to socket failed');
     }
     if (!$this->validateResponse('221')) {
         return new PEAR_Error('221 Bye not received');
     }
     if (PEAR::isError($this->socket->disconnect())) {
         return new PEAR_Error('socket disconnect failed');
     }
     return true;
 }
开发者ID:laiello,项目名称:coopcrucial,代码行数:20,代码来源:SMTP.php

示例6: cmdLogout

 /**
  * Attempt to disconnect from the iMAP server.
  *
  * @return array Returns an array containing the response
  *
  * @access public
  * @since  1.0
  */
 function cmdLogout()
 {
     if (!$this->_connected) {
         return new PEAR_Error('not connected!');
     }
     if (PEAR::isError($args = $this->_genericCommand('LOGOUT'))) {
         return $args;
     }
     if (PEAR::isError($this->_socket->disconnect())) {
         return new PEAR_Error('socket disconnect failed');
     }
     return $args;
     // not for now
     //return $this->_genericImapResponseParser($args,$cmdid);
 }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:23,代码来源:IMAPProtocol.php

示例7: cmdLogout

 /**
  * Attempt to disconnect from the iMAP server.
  *
  * @return array Returns an array containing the response
  *
  * @access public
  * @since  1.0
  */
 function cmdLogout()
 {
     if (!$this->_connected) {
         return new PEAR_Error('not connected!');
     }
     $cmdid = $this->_getCmdId();
     if (PEAR::isError($error = $this->_putCMD($cmdid, 'LOGOUT'))) {
         return $error;
     }
     if (PEAR::isError($args = $this->_getRawResponse())) {
         return $args;
     }
     if (PEAR::isError($this->_socket->disconnect())) {
         return new PEAR_Error('socket disconnect failed');
     }
     return $args;
     // not for now
     //return $this->_genericImapResponseParser($args,$cmdid);
 }
开发者ID:drognisep,项目名称:Simple-Groupware,代码行数:27,代码来源:IMAPProtocol.php

示例8: __smtp

 /**
  * Sends out email via SMTP
  *
  * @return bool Success
  * @access private
  */
 private function __smtp()
 {
     App::import('Core', array('CakeSocket'));
     $this->__smtpConnection = new CakeSocket(array_merge(array('protocol' => 'smtp'), $this->smtpOptions));
     if (!$this->__smtpConnection->connect()) {
         $this->smtpError = $this->__smtpConnection->lastError();
         return false;
     } elseif (!$this->__smtpSend(null, '220')) {
         return false;
     }
     $httpHost = env('HTTP_HOST');
     if (isset($this->smtpOptions['client'])) {
         $host = $this->smtpOptions['client'];
     } elseif (!empty($httpHost)) {
         $host = $httpHost;
     } else {
         $host = 'localhost';
     }
     if (!$this->__smtpSend("HELO {$host}", '250')) {
         return false;
     }
     if (isset($this->smtpOptions['username']) && isset($this->smtpOptions['password'])) {
         $authRequired = $this->__smtpSend('AUTH LOGIN', '334|503');
         if ($authRequired == '334') {
             if (!$this->__smtpSend(base64_encode($this->smtpOptions['username']), '334')) {
                 return false;
             }
             if (!$this->__smtpSend(base64_encode($this->smtpOptions['password']), '235')) {
                 return false;
             }
         } elseif ($authRequired != '503') {
             return false;
         }
     }
     if (!$this->__smtpSend('MAIL FROM: ' . $this->__formatAddress($this->from, true))) {
         return false;
     }
     if (!$this->__smtpSend('RCPT TO: ' . $this->__formatAddress($this->to, true))) {
         return false;
     }
     foreach ($this->cc as $cc) {
         if (!$this->__smtpSend('RCPT TO: ' . $this->__formatAddress($cc, true))) {
             return false;
         }
     }
     foreach ($this->bcc as $bcc) {
         if (!$this->__smtpSend('RCPT TO: ' . $this->__formatAddress($bcc, true))) {
             return false;
         }
     }
     if (!$this->__smtpSend('DATA', '354')) {
         return false;
     }
     $header = implode("\r\n", $this->__header);
     $message = implode("\r\n", $this->__message);
     if (!$this->__smtpSend($header . "\r\n\r\n" . $message . "\r\n\r\n\r\n.")) {
         return false;
     }
     $this->__smtpSend('QUIT', false);
     $this->__smtpConnection->disconnect();
     return true;
 }
开发者ID:robksawyer,项目名称:cakephp2x,代码行数:68,代码来源:email.php

示例9: disconnect

 /**
  * Attempt to disconnect from the SMTP server.
  *
  * @throws PEAR_Exception
  */
 public function disconnect()
 {
     //if (PEAR::isError($error = $this->_put('QUIT'))) {
     if (($error = $this->_put('QUIT')) === false) {
         return $error;
     }
     //if (PEAR::isError($error = $this->_parseResponse(221))) {
     if (($error = $this->_parseResponse(221)) === false) {
         return $error;
     }
     //if (PEAR::isError($error = $this->_socket->disconnect())) {
     if (($error = $this->_socket->disconnect()) === false) {
         return Net_SMTP::raiseError('Failed to disconnect socket: ' . $error->getMessage());
     }
     return true;
 }
开发者ID:alanturing1,项目名称:Z-Push-contrib,代码行数:21,代码来源:SMTP.php

示例10:

 /**
  * Logs out of the server and terminates the connection.
  *
  * @param boolean $sendLogoutCMD Whether to send LOGOUT command before
  *                               disconnecting.
  *
  * @return boolean  True on success, PEAR_Error otherwise.
  */
 function _cmdLogout($sendLogoutCMD = true)
 {
     if (NET_SIEVE_STATE_DISCONNECTED == $this->_state) {
         return PEAR::raiseError('Not currently connected', 1);
     }
     if ($sendLogoutCMD) {
         if (PEAR::isError($res = $this->_doCmd('LOGOUT'))) {
             return $res;
         }
     }
     $this->_sock->disconnect();
     $this->_state = NET_SIEVE_STATE_DISCONNECTED;
     return true;
 }
开发者ID:cjvaz,项目名称:expressomail,代码行数:22,代码来源:Sieve.php

示例11: cmdQuit

 /**
  * Close connection to the server
  *
  * @access public
  */
 function cmdQuit()
 {
     // Tell the server to close the connection
     $response = $this->_sendCommand('QUIT');
     if (PEAR::isError($response)) {
         return $response;
     }
     switch ($response) {
         case 205:
             // RFC977: 'closing connection - goodbye!'
             // If socket is still open, close it.
             if ($this->isConnected()) {
                 $this->_socket->disconnect();
             }
             return true;
             break;
         default:
             return PEAR::throwError('Unidentified response code', $response, $this->currentStatusResponse());
     }
 }
开发者ID:Esleelkartea,项目名称:kz-adeada-talleres-electricos-,代码行数:25,代码来源:Client.php

示例12: close

 /**
  * Close the file and forget the filehandle
  */
 function close()
 {
     $this->dbh->disconnect();
     $this->dbh = false;
 }
开发者ID:jin255ff,项目名称:company_website,代码行数:8,代码来源:abook_database.php

示例13: disconnect

 protected function disconnect()
 {
     $this->objConnection->disconnect();
     unset($this->objConnection);
 }
开发者ID:unmaintained-stuff,项目名称:tl_smhextended,代码行数:5,代码来源:SMHExtended.php

示例14: disconnect

 /**
  * Attempt to disconnect from the SMTP server.
  *
  * @throws PEAR_Exception
  */
 public function disconnect()
 {
     try {
         $this->_put('QUIT');
         $this->_parseResponse(221);
         $this->_socket->disconnect();
     } catch (Net_Socket2_Exception $e) {
         // Already disconnected? Silence!
     }
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:16,代码来源:SMTP2.php

示例15: disconnect

 /**
  * Desconnects from SMSC/SMS gateway gracefully
  * @access public
  * @return boolean Always TRUE
  */
 public function disconnect()
 {
     if ($this->state == ESS_BIND_TX || $this->state == ESS_BIND_RX) {
         l('ESME sending UNBIND command...');
         $this->sock->send($this->form_pdu(UNBIND));
         $pdu = $this->sock->pdu_wait_for(UNBIND | ACK, $this->sqn);
         $res = $this->parse_pdu_header(substr($pdu, 0, 16));
         if ($res['stat'] !== 0) {
             l('UNBIND failed: ' . $res['stat'] . '.', L_WARN);
         } else {
             l('UNBIND done.');
         }
     }
     $this->state = ESS_DISCONNECTED;
     $this->sock->disconnect();
     return true;
 }
开发者ID:prayas-sapkota,项目名称:phpesme,代码行数:22,代码来源:nimf_esme.php


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