Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : IRC Gateway Functions : ircg_pconnect

ircg_pconnect

Connect to an IRC server (PHP 4 >= 4.0.4, PHP 5 <= 5.0.5)
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.

Parameters

username

The initial nickname on the server.

server_ip

The IRC server address.

server_ip must be an IP address in numerical form. DNS lookups are expensive and should be done in the context of IRCG. Default to 127.0.0.1.

server_port

The server port number. Default to 6667.

msg_format

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.

ctcp_messages

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.

user_settings

You can define "ident", "password", and "realname" tokens which are sent to the IRC server by setting these in this associative array.

bailout_on_trivial

Return Values

Returns a connection resource handle for further use, or FALSE on error.

Code Examples / Notes » ircg_pconnect

zerocool

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/


Change Language


Follow Navioo On Twitter
ircg_channel_mode
ircg_disconnect
ircg_eval_ecmascript_params
ircg_fetch_error_msg
ircg_get_username
ircg_html_encode
ircg_ignore_add
ircg_ignore_del
ircg_invite
ircg_is_conn_alive
ircg_join
ircg_kick
ircg_list
ircg_lookup_format_messages
ircg_lusers
ircg_msg
ircg_names
ircg_nick
ircg_nickname_escape
ircg_nickname_unescape
ircg_notice
ircg_oper
ircg_part
ircg_pconnect
ircg_register_format_messages
ircg_set_current
ircg_set_file
ircg_set_on_die
ircg_topic
ircg_who
ircg_whois
eXTReMe Tracker