PEAR   PEAR API Documentation :: Net_SmartIRC

Packages:


Class Net_SmartIRC

main SmartIRC class



Class Variables

$channel (line 327)
Data type: array

Description:
Stores all channels in this array where we are joined, works only if channelsynching is activated.

Eg. for accessing a user, use it like this: (in this example the SmartIRC object is stored in $irc) $irc->channel['#test']->users['meebey']->nick;


Tags:
[ Top ]


$nreplycodes (line 315)
Data type: array

Description:
All numeric IRC replycodes, the index is the numeric replycode.

Tags:
  • Access: - public
  • See: - $SMARTIRC_nreplycodes
[ Top ]


$replycodes (line 306)
Data type: array

Description:
All IRC replycodes, the index is the replycode name.

Tags:
  • Access: - public
  • See: - $SMARTIRC_replycodes
[ Top ]




Class Methods

Net_SmartIRC (line 336)
void constructor Net_SmartIRC ( )

Description:
Constructor. Initiales the messagebuffer and "links" the replycodes from global into properties. Also some PHP runtime settings are configured.

Tags:
  • Access: - public
[ Top ]

ban (line 1155)
void ban ( $channel, [$hostmask = null] )

Parameters:
  •  
string   $channel  
  •  
string   $hostmask  

Description:
bans a hostmask for the given channel or requests the current banlist

The banlist will be requested if no hostmask is specified


Tags:
  • Access: - public
[ Top ]

changeNick (line 1199)
void changeNick ( $newnick )

Parameters:
  •  
string   $newnick  

Description:
changes the own nickname

Trys to set a new nickname, nickcollisions are handled.


Tags:
  • Access: - public
[ Top ]

channel (line 923)
object &channel ( $channelname )

Parameters:
  •  
string   $channelname  

Description:
returns an object reference to the specified channel

If the channel does not exist (because not joint) false will be returned.


Tags:
  • Return: - reference to the channel object
  • Access: - public
[ Top ]

connect (line 731)
void connect ( $address, $port )

Parameters:
  •  
string   $address  
  •  
integer   $port  

Description:
Creates the sockets and connects to the IRC server on the given port.

Tags:
  • Access: - public
[ Top ]

deop (line 1114)
void deop ( $channel, $nickname )

Parameters:
  •  
string   $channel  
  •  
string   $nickname  

Description:
deops an user in the given channel

Tags:
  • Access: - public
[ Top ]

devoice (line 1140)
void devoice ( $channel, $nickname )

Parameters:
  •  
string   $channel  
  •  
string   $nickname  

Description:
devoice a user in the given channel

Tags:
  • Access: - public
[ Top ]

disconnect (line 779)
boolean disconnect ( [$quickdisconnect = false] )

Parameters:
  •  
boolean   $quickdisconnect   default: false

Description:
disconnects from the IRC server nicely with a QUIT or just destroys the socket

disconnects from the IRC server in the given quickness mode. $quickdisconnect: true, just close the socket false, send QUIT and wait $_disconnectime before closing the socket


Tags:
  • Access: - public
[ Top ]

getList (line 1012)
void getList ( [$channelarray = null] )

Parameters:
  •  
mixed   $channelarray  

Description:
gets a list of one ore more channels

Requests a full channellist if $channelarray is not given. (use it with care, usualy its a looooong list)


Tags:
  • Access: - public
[ Top ]

getMotd (line 707)
array getMotd ( )

Description:
returns the motd

Tags:
  • Access: - public
[ Top ]

getTopic (line 1069)
void getTopic ( $channel )

Parameters:
  •  
string   $channel  

Description:
gets the topic of a channel

Tags:
  • Access: - public
[ Top ]

getUsermode (line 718)
string getUsermode ( )

Description:
returns the usermode

Tags:
  • Access: - public
[ Top ]

invite (line 1185)
void invite ( $nickname, $channel )

Parameters:
  •  
string   $nickname  
  •  
string   $channel  

Description:
invites a user to the specified channel

Tags:
  • Access: - public
[ Top ]

isJoined (line 1266)
boolean isJoined ( $channel )

Description:
checks if the class is joined to the specified channel and returns the result

Tags:
  • Access: - public
[ Top ]

join (line 940)
void join ( $channelarray, [$key = null] )

Parameters:
  •  
mixed   $channelarray  
  •  
string   $key  

Description:
Joins one or more IRC channels with an optional key.

Tags:
  • Access: - public
[ Top ]

kick (line 987)
void kick ( $channel, $nicknamearray, [$reason = null] )

Parameters:
  •  
string   $channel  
  •  
mixed   $nicknamearray  
  •  
string   $reason  

Description:
Kicks one or more user from an IRC channel with an optional reason.

Tags:
  • Access: - public
[ Top ]

listen (line 1284)
boolean listen ( )

Description:
goes into receive mode

Goes into receive and idle mode. Only call this if you want to "spawn" the bot. No further lines of PHP code will be processed after this call, only the bot methods!


Tags:
  • Access: - public
[ Top ]

listenFor (line 1305)
array listenFor ( $messagetype )

Parameters:
  •  
integer   $messagetype   see in the documentation 'Message Types'

Description:
waits for a special message type and puts the answer in $result

Creates a special actionhandler for that given TYPE and returns the answer. This will only receive the requested type, immediately quit and disconnect from the IRC server. Made for showing IRC statistics on your homepage, or other IRC related information.


Tags:
  • Return: - answer from the IRC server for this $messagetype
  • Access: - public
[ Top ]

log (line 668)
void log ( $level, $entry )

Parameters:
  •  
integer   $level   bit constants (SMARTIRC_DEBUG_*)
  •  
string   $entry   the new log entry

Description:
adds an entry to the log

Adds an entry to the log with Linux style log format. Possible $level constants (can also be combined with "|"s) SMARTIRC_DEBUG_NOTICE SMARTIRC_DEBUG_CONNECTION SMARTIRC_DEBUG_SOCKET SMARTIRC_DEBUG_IRCMESSAGES SMARTIRC_DEBUG_MESSAGETYPES SMARTIRC_DEBUG_ACTIONHANDLER SMARTIRC_DEBUG_TIMEHANDLER SMARTIRC_DEBUG_MESSAGEHANDLER


Tags:
[ Top ]

login (line 852)
void login ( $nick, $realname, [$usermode = 0], [$username = null], [$password = null] )

Parameters:
  •  
string   $nick  
  •  
string   $realname  
  •  
integer   $usermode  
  •  
string   $username  
  •  
string   $password  

Description:
login and register nickname on the IRC network

Registers the nickname and user information on the IRC network.


Tags:
  • Access: - public
[ Top ]

message (line 891)
boolean message ( $type, $destination, $message )

Parameters:
  •  
integer   $type   specifies the type, like QUERY/ACTION or CTCP see 'Message Types'
  •  
string   $destination   can be a user or channel
  •  
string   $message   the message

Description:
sends a new message

Sends a message to a channel or user.


Tags:
  • Access: - public
  • See: - DOCUMENTATION
[ Top ]

mode (line 1084)
void mode ( $target, [$newmode = null] )

Parameters:
  •  
string   $target   the target, can be an user (only yourself) or a channel
  •  
string   $newmode   the new mode like +mt

Description:
sets or gets the mode of an user or channel

Changes/requests the mode of the given target.


Tags:
  • Access: - public
[ Top ]

names (line 1035)
void names ( [$channelarray = null] )

Parameters:
  •  
mixed   $channelarray  

Description:
requests all nicknames of one or more channels

The requested nickname list also includes op and voice state


Tags:
  • Access: - public
[ Top ]

op (line 1101)
void op ( $channel, $nickname )

Parameters:
  •  
string   $channel  
  •  
string   $nickname  

Description:
ops an user in the given channel

Tags:
  • Access: - public
[ Top ]

part (line 963)
void part ( $channelarray, [$reason = null] )

Parameters:
  •  
mixed   $channelarray  
  •  
string   $reason  

Description:
parts from one or more IRC channels with an optional reason

Tags:
  • Access: - public
[ Top ]

quit (line 1248)
void quit ( [$quitmessage = null] )

Parameters:
  •  
string   $quitmessage   optional quitmessage

Description:
sends QUIT to IRC server and disconnects

Tags:
  • Access: - public
[ Top ]

reconnect (line 821)
void reconnect ( )

Description:
reconnects to the IRC server with the same login info, it also rejoins the channels

Tags:
  • Access: - public
[ Top ]

registerActionhandler (line 1329)
integer registerActionhandler ( $handlertype, $regexhandler, &$object, $methodname )

Parameters:
  •  
integer   $handlertype   bits constants, see in this documentation Message Types
  •  
string   $regexhandler   the message that has to be in the IRC message in regex syntax
  •  
object   $object   a reference to the objects of the method
  •  
string   $methodname   the methodname that will be called when the handler happens

Description:
registers a new actionhandler and returns the assigned id

Registers an actionhandler in Net_SmartIRC for calling it later. The actionhandler id is needed for unregistering the actionhandler.


Tags:
  • Return: - assigned actionhandler id
  • Access: - public
  • See: - example.php
[ Top ]

registerTimehandler (line 1414)
integer registerTimehandler ( $interval, &$object, $methodname )

Parameters:
  •  
integer   $interval   interval time in milliseconds
  •  
object   $object   a reference to the objects of the method
  •  
string   $methodname   the methodname that will be called when the handler happens

Description:
registers a timehandler and returns the assigned id

Registers a timehandler in Net_SmartIRC, which will be called in the specified interval. The timehandler id is needed for unregistering the timehandler.


Tags:
  • Return: - assigned timehandler id
  • Access: - public
  • See: - example7.php
[ Top ]

setAutoReconnect (line 553)
void setAutoReconnect ( $boolean )

Parameters:
  •  
boolean   $boolean  

Description:
enables/disables autoreconnecting

Tags:
  • Access: - public
[ Top ]

setAutoRetry (line 568)
void setAutoRetry ( $boolean )

Parameters:
  •  
boolean   $boolean  

Description:
enables/disables autoretry for connecting to a server

Tags:
  • Access: - public
[ Top ]

setBenchmark (line 410)
void setBenchmark ( $boolean )

Parameters:
  •  
boolean   $boolean  

Description:
enables/disables the benchmark engine

Tags:
  • Access: - public
[ Top ]

setChannelSynching (line 425)
void setChannelSynching ( $boolean )

Parameters:
  •  
boolean   $boolean  

Description:
enables/disables channel synching

Tags:
  • Access: - public
[ Top ]

setCtcpVersion (line 440)
void setCtcpVersion ( $versionstring )

Parameters:
  •  
string   $versionstring  

Description:
sets the CTCP version reply string

Tags:
  • Access: - public
[ Top ]

setDebug (line 398)
void setDebug ( $level )

Parameters:
  •  
integer   $level  

Description:
sets the level of debug messages

Sets the debug level (bitwise), useful for testing/developing your code. A full list of avialable debug levels see 'Debug Levels'. Default: SMARTIRC_DEBUG_NOTICE


Tags:
  • Access: - public
  • See: - DOCUMENTATION
[ Top ]

setDisconnecttime (line 500)
void setDisconnecttime ( $milliseconds )

Parameters:
  •  
integer   $milliseconds  

Description:
sets the delaytime before closing the socket when disconnect

Tags:
  • Access: - public
[ Top ]

setLogdestination (line 460)
void setLogdestination ( $type )

Parameters:
  •  
integer   $type   must be on of the constants

Description:
sets the destination of all log messages

Sets the destination of log messages. $type can be: SMARTIRC_FILE for saving the log into a file SMARTIRC_STDOUT for echoing the log to stdout SMARTIRC_SYSLOG for sending the log to the syslog Default: SMARTIRC_STDOUT


Tags:
[ Top ]

setLogfile (line 488)
void setLogfile ( $file )

Parameters:
  •  
string   $file  

Description:
sets the file for the log if the destination is set to file

Sets the logfile, if logdestination is set to SMARTIRC_FILE. This should be only used with full path!


Tags:
  • Access: - public
[ Top ]

setReceivedelay (line 519)
void setReceivedelay ( $milliseconds )

Parameters:
  •  
integer   $milliseconds  

Description:
sets the delay for receiving data from the IRC server

Sets the delaytime between messages that are received, this reduces your CPU load. Don't set this too low (min 100ms). Default: 100


Tags:
  • Access: - public
[ Top ]

setReceiveTimeout (line 586)
void setReceiveTimeout ( $seconds )

Parameters:
  •  
integer   $seconds  

Description:
sets the receive timeout

If the timeout occurs, the connection will be reinitialized Default: 300 seconds


Tags:
  • Access: - public
[ Top ]

setSenddelay (line 538)
void setSenddelay ( $milliseconds )

Parameters:
  •  
integer   $milliseconds  

Description:
sets the delay for sending data to the IRC server

Sets the delaytime between messages that are sent, because IRC servers doesn't like floods. This will avoid sending your messages too fast to the IRC server. Default: 250


Tags:
  • Access: - public
[ Top ]

setTopic (line 1057)
void setTopic ( $channel, $newtopic )

Parameters:
  •  
string   $channel  
  •  
string   $newtopic  

Description:
sets a new topic of a channel

Tags:
  • Access: - public
[ Top ]

setTransmitTimeout (line 604)
void setTransmitTimeout ( $seconds )

Parameters:
  •  
integer   $seconds  

Description:
sets the transmit timeout

If the timeout occurs, the connection will be reinitialized Default: 300 seconds


Tags:
  • Access: - public
[ Top ]

setUseSockets (line 364)
void setUseSockets ( $boolean )

Parameters:
  •  
bool   $boolean  

Description:
enables/disables the usage of real sockets

Enables/disables the usage of real sockets instead of fsocks (works only if your PHP build has loaded the PHP socket extension) Default: false


Tags:
  • Access: - public
[ Top ]

showBenchmark (line 643)
void showBenchmark ( )

Description:
shows the benchmark result

Tags:
  • Access: - public
[ Top ]

startBenchmark (line 618)
void startBenchmark ( )

Description:
starts the benchmark (sets the counters)

Tags:
  • Access: - public
[ Top ]

stopBenchmark (line 629)
void stopBenchmark ( )

Description:
stops the benchmark and displays the result

Tags:
  • Access: - public
[ Top ]

unban (line 1172)
void unban ( $channel, $hostmask )

Parameters:
  •  
string   $channel  
  •  
string   $hostmask  

Description:
unbans a hostmask on the given channel

Tags:
  • Access: - public
[ Top ]

unregisterActionhandler (line 1354)
boolean unregisterActionhandler ( $handlertype, $regexhandler, &$object, $methodname )

Parameters:
  •  
integer   $handlertype  
  •  
string   $regexhandler  
  •  
object   $object  
  •  
string   $methodname  

Description:
unregisters an existing actionhandler

Tags:
  • Access: - public
[ Top ]

unregisterActionid (line 1383)
boolean unregisterActionid ( $id )

Parameters:
  •  
integer   $id  

Description:
unregisters an existing actionhandler via the id

Tags:
  • Access: - public
[ Top ]

unregisterTimeid (line 1442)
boolean unregisterTimeid ( $id )

Parameters:
  •  
integer   $id  

Description:
unregisters an existing timehandler via the id

Tags:
[ Top ]

voice (line 1127)
void voice ( $channel, $nickname )

Parameters:
  •  
string   $channel  
  •  
string   $nickname  

Description:
voice a user in the given channel

Tags:
  • Access: - public
[ Top ]

who (line 1211)
void who ( $target )

Parameters:
  •  
string   $target  

Description:
requests a 'WHO' from the specified target

Tags:
  • Access: - public
[ Top ]

whois (line 1223)
void whois ( $target )

Parameters:
  •  
string   $target  

Description:
requests a 'WHOIS' from the specified target

Tags:
  • Access: - public
[ Top ]

whowas (line 1236)
void whowas ( $target )

Parameters:
  •  
string   $target  

Description:
requests a 'WHOWAS' from the specified target (if he left the IRC network)

Tags:
  • Access: - public
[ Top ]



Documentation generated on Fri, 17 Jan 2003 01:12:53 +0100 by phpDocumentor 1.2.0beta1c
HTML layout done by Christian Dickmann and originally inspired by PHPEdit