I suggest you use a raw socket for connecting. It gives you more freedom to work with. And it is just more nice.
All that these commands would do is sending stuff like this to the server:
:nick@hostname PRIVMSG #channel :What you would like to say
To send a message to the channel "#channel".
IRC Gateway 関数
導入
IRCG により、同時に接続した数千人のユーザに簡単に XML データを 放送することができます。IRCG は、オンラインゲームや Web チャットのような 強力、拡張可能で対話的なプラットフォームを構築する際に使用することが できます。 IRCG は、放送以外のモードもサポートしており、ヘルパーアプリケーションが 入力されたデータを再編集し、静的なファイルを cHTML (i-mode) ま たは WML (WAP) のような特定の形式で出力することができます。 これらの静的なファイルは、高性能な Web サーバにより配信されます。
v4 の時点では、IRCG は以下のプラットフォームで実行できます。
AIX
FreeBSD
HP-UX
Irix
Linux
Solaris
Tru64
Windows
注意: この拡張モジュールは » PECL レポジトリに移動 されており、以下のバージョン以降 PHP にバンドルされなくなっています。 PHP 5.1.0.
インストール手順
詳細な手順は、» http://www.schumann.cx/ircg/ にあります。 提供されているインストールスクリプトをただちに使用するとよいでしょう。
お勧めはしませんが、IRCG サポートをあなた自身で設定することも可能です。 ircg-config スクリプトへのパスを --with-ircg-config=path/to/irc-config のように設定し、さらに --with-ircg を configure 行に追加します。
実行時設定
設定ディレクティブは定義されていません。
リソース型
定義済み定数
定数は定義されていません。
目次
- ircg_channel_mode — ユーザ用にチャンネルモードフラグを設定する
- ircg_disconnect — サーバへの接続を閉じる
- ircg_eval_ecmascript_params — JS エンコードされたパラメータの一覧をデコードする
- ircg_fetch_error_msg — 直前の IRCG 処理からエラーを返す
- ircg_get_username — 接続用にユーザ名を取得する
- ircg_html_encode — HTML で保存された文字列をエンコードする
- ircg_ignore_add — サーバ上の除外リストにユーザを追加する
- ircg_ignore_del — サーバ上の除外リストからユーザを削除する
- ircg_invite — ユーザをチャンネルに招待する
- ircg_is_conn_alive — 接続ステータスを確認する
- ircg_join — 接続中のサーバ上でチャンネルに接続する
- ircg_kick — サーバ上のチャンネルからユーザを排除する
- ircg_list — チャンネル内のトピック/ユーザの数を取得する
- ircg_lookup_format_messages — フォーマットメッセージセットの存在を調べる
- ircg_lusers — IRC ネットワーク統計
- ircg_msg — サーバ上のチャンネルまたはユーザにメッセージを送信する
- ircg_names — ユーザ名を問い合わせる
- ircg_nick — サーバ上のニックネームを変更する
- ircg_nickname_escape — ニックネームの中の特別な文字が IRC 互換となるようにエンコードする
- ircg_nickname_unescape — エンコードされたニックネームをデコードする
- ircg_notice — サーバ上のユーザに通知を送信する
- ircg_oper — 権限を IRC OPER に昇格させる
- ircg_part — サーバ上のチャンネルから離脱する
- ircg_pconnect — IRC サーバに接続する
- ircg_register_format_messages — フォーマットメッセージセットを登録する
- ircg_set_current — 出力用に現在の接続を設定する
- ircg_set_file — 接続用にログファイルを設定する
- ircg_set_on_die — 接続が終了する際にホスト側で実行されるアクションを設定する
- ircg_topic — サーバ上のチャンネル用にトピックを設定する
- ircg_who — サーバに WHO 情報を問い合わせる
- ircg_whois — ユーザ情報をサーバに問い合わせる
IRC Gateway
30-Nov-2006 05:44
06-May-2006 12:59
If sb need a simple PHP IRC Class:
http://sf.net/projects/irccc
watch out, ircg is shareware as it seems.
Quoting from http://schumann.cx/ircg/ircg4.php :
The IRCG 4 Free Trial does not allow more than 10 concurrent connections
Answer: The IRCG 4 Free Trial is limited to 10 concurrent connections. You can buy an unlimited license by contacting us here.
Poor job, documentation team. Do you like promoting shareware in your manual just because its from a core developer?
12-Nov-2002 02:16
This is an example to show how to connect to a IRC server, how to join a channel, send and receive messages.
<?PHP
/* change it to your own nickname */
$nickname = "myOwnNick";
/* choice your irc server */
$server = "irc.brasirc.net";
/* change to your channel */
$channel = "#linux";
/* do not change it if you do not know what means :-) */
$port = "6667";
/* as ircg cannot resolve hosts, we use PHP internal function to get the IP */
$ip = gethostbyname($server);
/* connection */
$id = ircg_pconnect($nickname,$ip,$port);
/* checking if connected */
if (!ircg_is_conn_alive($id))
{
print "Cannot connect<br>";
exit;
}
/* joining a channel */
if (!ircg_join($id,$channel))
{
print "Cannot join to $chanell<br>";
}
/* getting messages - you must have this in your php file */
ircg_set_current($id);
/* send messages to your channel and you */
ircg_msg($id,$channel,"Hello $channel!!");
ircg_msg($id,$nickname,"This message goes to me!!!");
?>