PHP: ircg_pconnect - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ircg_register_format_messages ircg_part

Last updated: Fri, 26 Jan 2007

view this page in

# ircg_pconnect

(PHP 4 >= 4.0.4, PHP 5 <= 5.0.4)

ircg_pconnect -- Connect to an IRC server

## Description

resource ircg_pconnect ( string username [, string server_ip [, int server_port [, string msg_format [, array ctcp_messages [, array user_settings [, bool bailout_on_trivial]]]]]] )

ircg_pconnect() will try to establish a connection to an IRC server and return a connection resource handle for further use.

The only mandatory parameter is `username`, this will set your initial nickname on the server. `server_ip` and `server_port` are optional and default to `127.0.0.1` and `6667`.

> Замечание: For now parameter `server_ip` will not do any hostname lookups and will only accept IP addresses in numerical form. DNS lookups are expensive and should be done in the context of IRCG.

You can customize the output of IRC messages and events by selecting a format message set previously created with ircg_register_format_messages() by specifying the set's name in `msg_format`.

If you want to handle CTCP messages such as ACTION (/me), you need to define a mapping from CTCP type (e.g. ACTION) to a custom format string. Do this by passing an associative array as `ctcp_messages`. The keys of the array are the CTCP type and the respective value is the format message.

You can define "ident", "password", and "realname" tokens which are sent to the IRC server by setting these in an associative array. Pass that array as `user_settings`.

See also: ircg_disconnect(), ircg_is_conn_alive(), ircg_register_format_messages().

add a note User Contributed Notes
ircg_pconnect
zerocool at planetquake dot com
09-Aug-2001 01:46
`Remember, to use these functions one must compile ircg support into PHP. If you get a fatal error stating that ircg_pconnect is undefined, this is why. See :
http://schumann.cx/ircg/`
add a note
ircg_register_format_messages ircg_part

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST