cvs: pear /Net_SMTP SMTP.php

From: Date: Fri, 10 Jan 2003 21:01:15 +0000
Subject: cvs: pear /Net_SMTP SMTP.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-8180@lists.php.net to get a copy of this message
jon Fri Jan 10 16:01:15 2003 EDT Modified files: /pear/Net_SMTP SMTP.php Log: Move the connect() and disconnect() methods down below the private network-handling methods. Index: pear/Net_SMTP/SMTP.php diff -u pear/Net_SMTP/SMTP.php:1.16 pear/Net_SMTP/SMTP.php:1.17 --- pear/Net_SMTP/SMTP.php:1.16 Fri Jan 10 15:53:56 2003 +++ pear/Net_SMTP/SMTP.php Fri Jan 10 16:01:12 2003 @@ -116,51 +116,6 @@ } /** - * Attempt to connect to 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 connect() - { - if (PEAR::isError($this->_socket->connect($this->host, $this->port))) { - return new PEAR_Error('unable to open socket'); - } - - if (PEAR::isError($error = $this->_parseResponse(220))) { - return $error; - } - if (!$this->identifySender()) { - return new PEAR_Error('unable to identify smtp server'); - } - - return true; - } - - /** - * 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($error = $this->_put('QUIT'))) { - return $error; - } - if (PEAR::isError($error = $this->_parseResponse(221))) { - return $error; - } - if (PEAR::isError($this->_socket->disconnect())) { - return new PEAR_Error('socket disconnect failed'); - } - - return true; - } - - /** * Send the given string of data to the server. * * @param string $data The string of data to send. @@ -284,6 +239,51 @@ function getResponse() { return array($this->_code, join("\n", $this->_arguments)); + } + + /** + * Attempt to connect to 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 connect() + { + if (PEAR::isError($this->_socket->connect($this->host, $this->port))) { + return new PEAR_Error('unable to open socket'); + } + + if (PEAR::isError($error = $this->_parseResponse(220))) { + return $error; + } + if (!$this->identifySender()) { + return new PEAR_Error('unable to identify smtp server'); + } + + return true; + } + + /** + * 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($error = $this->_put('QUIT'))) { + return $error; + } + if (PEAR::isError($error = $this->_parseResponse(221))) { + return $error; + } + if (PEAR::isError($this->_socket->disconnect())) { + return new PEAR_Error('socket disconnect failed'); + } + + return true; } /**

« previous php.pear.cvs (#8180) next »