boolean Net_NNTP_Client::connectAuthenticated (
integer $user
= = null
,
integer $pass
= = null
,
string $host = NET_NNTP_PROTOCOL_DEFAULT_HOST
,
integer $port = NET_NNTP_PROTOCOL_DEFAULT_PORT
,
integer $authmode = NET_NNTP_AUTHORIGINAL
)
指定した NNTP サーバに接続し、認証を行います。
This function is deprecated. That means that future versions of this package may not support it anymore.
$user
- 認証のためのユーザ名。
$pass
- 認証のためのパスワード。
$host
- NNTP サーバのホスト名。デフォルトは
NET_NNTP_PROTOCOL_DEFAULT_HOST
$port
- NNTP サーバのポート番号。デフォルトは
NET_NNTP_PROTOCOL_DEFAULT_PORT
$authmode
- 認証方法。デフォルトは
NET_NNTP_AUTHORIGINAL
boolean
-
Returns TRUE on success,
PEAR_Error on failure.
エラー番号 | エラーメッセージ | 原因 | 対応方法 |
---|---|---|---|
NULL |
"Could not connect to NNTP-server $host"
または
"Not connected"
|
接続が確立できませんでした。原因は
|
サーバ名やネットワーク接続の状況を調べます。また、可能なら ファイアウォールの設定も確かめます。 |
0.3 以降
This function can not be called statically.
connectauthenticated() の使用
<?php
require_once 'Net/NNTP/Client.php';
$nntp = new Net_NNTP_Client();
$ret = $nntp->connectAuthenticated('news.php.net');
if( PEAR::isError($ret)) {
// エラー処理
} else {
// 成功
}
?>