/**
  * Connect to the NNTP-server.
  *
  * @param optional string $host The adress of the NNTP-server to connect to.
  * @param optional int $port The port to connect to.
  *
  * @return mixed (bool) true on success or (object) pear_error on failure
  * @access public
  * @see Net_NNTP_Client::quit()
  * @see Net_NNTP_Client::authenticate()
  * @see Net_NNTP_Client::connectAuthenticated()
  */
 function connect($host = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_HOST, $port = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_PORT)
 {
     return parent::connect($host, $port);
 }
示例#2
0
 /**
  * Connect to a server.
  *
  * xxx
  * 
  * <b>Usage example:</b>
  * {@example docs/examples/phpdoc/connect.php}
  *
  * @param string	$host	(optional) The hostname og IP-address of the NNTP-server to connect to, defaults to localhost.
  * @param mixed	$encryption	(optional) false|'tls'|'ssl', defaults to false.
  * @param int	$port	(optional) The port number to connect to, defaults to 119 or 563 dependng on $encryption.
  * @param int	$timeout	(optional) 
  *
  * @return mixed <br>
  *  - (bool)	True when posting allowed, otherwise false
  *  - (object)	Pear_Error on failure
  * @access public
  * @see Net_NNTP_Client::disconnect()
  * @see Net_NNTP_Client::authenticate()
  */
 function connect($host = null, $encryption = null, $port = null, $timeout = null)
 {
     // v1.0.x API
     if (is_int($encryption)) {
         trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: connect() !', E_USER_NOTICE);
         $port = $encryption;
         $encryption = null;
     }
     return parent::connect($host, $encryption, $port, $timeout);
 }
示例#3
0
文件: NNTP.php 项目: ddrmoscow/queXS
 /**
  * Connect to the newsserver, and authenticate. If no user/pass is specified, just connect.
  *
  * @param optional string $user The user name to authenticate with
  * @param optional string $pass The password
  * @param optional string $host The adress of the NNTP-server to connect to.
  * @param optional int $port The port to connect to.
  * @param optional string $authmode The authentication mode
  *
  * @return mixed (bool) true on success or (object) pear_error on failure
  * @access public
  * @since 0.3
  * @see Net_NNTP::connect()
  * @see Net_NNTP::authenticate()
  * @see Net_NNTP::quit()
  * @deprecated use connect() and authenticate() instead
  */
 function connectAuthenticated($user = null, $pass = null, $host = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_HOST, $port = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_PORT, $authmode = NET_NNTP_AUTHORIGINAL)
 {
     // Until connect() is changed, connect() is called directly from the parent...
     $R = parent::connect($host, $port);
     if (PEAR::isError($R)) {
         return $R;
     }
     // Authenticate if username is given
     if ($user != null) {
         $R = $this->authenticate($user, $pass, $authmode);
         if (PEAR::isError($R)) {
             return $R;
         }
     }
     return true;
 }