PEAR   PEAR API Documentation :: Net_SmartIRC Package Homepage |  Download ApiDoc  

Packages:



Class Net_SmartIRC_base

main SmartIRC class



Child classes:
Net_SmartIRC_irccommands
main SmartIRC class

Class Variables

$channel (line 331)
Data type: array

Description:
Stores all channels in this array where we are joined, works only if channelsyncing 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 318)
Data type: array

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

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


$replycodes (line 309)
Data type: array

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

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




Class Methods

connect (line 822)
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 ]

disconnect (line 890)
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 ]

getMotd (line 798)
array getMotd ( )

Description:
Returns the full motd.

Tags:
  • Access: - public
[ Top ]

getUsermode (line 809)
string getUsermode ( )

Description:
Returns the usermode.

Tags:
  • Access: - public
[ Top ]

isBanned (line 1108)
boolean isBanned ( $channel, $hostmask )

Parameters:
  •  
string   $channel  
  •  
string   $hostmask  

Description:
Checks if the hostmask is on the specified channel banned and returns the result.

ChannelSyncing is required for this.


Tags:
[ Top ]

isError (line 2191)
void isError ( $object )

[ Top ]

isJoined (line 1020)
boolean isJoined ( $channel, [$nickname = null] )

Parameters:
  •  
string   $channel  
  •  
string   $nickname  

Description:
checks if we or the given user is joined to the specified channel and returns the result ChannelSyncing is required for this.

Tags:
[ Top ]

isOpped (line 1048)
boolean isOpped ( $channel, [$nickname = null] )

Parameters:
  •  
string   $channel  
  •  
string   $nickname  

Description:
Checks if we or the given user is opped on the specified channel and returns the result.

ChannelSyncing is required for this.


Tags:
[ Top ]

isVoiced (line 1078)
boolean isVoiced ( $channel, [$nickname = null] )

Parameters:
  •  
string   $channel  
  •  
string   $nickname  

Description:
Checks if we or the given user is voiced on the specified channel and returns the result.

ChannelSyncing is required for this.


Tags:
[ Top ]

listen (line 1135)
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 1156)
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 735)
void log ( $level, $entry, [$file = null], [$line = null] )

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_NONE SMARTIRC_DEBUG_NOTICE SMARTIRC_DEBUG_CONNECTION SMARTIRC_DEBUG_SOCKET SMARTIRC_DEBUG_IRCMESSAGES SMARTIRC_DEBUG_MESSAGETYPES SMARTIRC_DEBUG_ACTIONHANDLER SMARTIRC_DEBUG_TIMEHANDLER SMARTIRC_DEBUG_MESSAGEHANDLER SMARTIRC_DEBUG_CHANNELSYNCING SMARTIRC_DEBUG_MODULES SMARTIRC_DEBUG_USERSYNCING SMARTIRC_DEBUG_ALL


Tags:
[ Top ]

login (line 981)
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 ]

Net_SmartIRC (line 340)
void 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 ]

reconnect (line 940)
void reconnect ( )

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

Tags:
  • Access: - public
[ Top ]

registerActionhandler (line 1184)
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 1292)
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 608)
void setAutoReconnect ( $boolean )

Parameters:
  •  
boolean   $boolean  

Description:
Enables/disables autoreconnecting.

Tags:
  • Access: - public
[ Top ]

setAutoRetry (line 624)
void setAutoRetry ( $boolean )

Parameters:
  •  
boolean   $boolean  

Description:
Enables/disables autoretry for connecting to a server.

Tags:
  • Access: - public
[ Top ]

setBenchmark (line 439)
void setBenchmark ( $boolean )

Parameters:
  •  
boolean   $boolean  

Description:
Enables/disables the benchmark engine.

Tags:
  • Access: - public
[ Top ]

setChannelSynching (line 456)
void setChannelSynching ( $boolean )

Parameters:
  •  
boolean   $boolean  

Description:
Deprecated, use setChannelSyncing() instead!

Tags:
  • Access: - public
  • Deprecated: - 
[ Top ]

setChannelSyncing (line 472)
void setChannelSyncing ( $boolean )

Parameters:
  •  
boolean   $boolean  

Description:
Enables/disables channel syncing.

Channel syncing means, all users on all channel we are joined are tracked in the channel array. This makes it very handy for botcoding.


Tags:
  • Access: - public
[ Top ]

setCtcpVersion (line 494)
void setCtcpVersion ( $versionstring )

Parameters:
  •  
string   $versionstring  

Description:
Sets the CTCP version reply string.

Tags:
  • Access: - public
[ Top ]

setDebug (line 427)
void setDebug ( $level )

Parameters:
  •  
integer   $level  

Description:
Sets the level of debug messages.

Sets the debug level (bitwise), useful for testing/developing your code. Here the list of all possible debug levels: SMARTIRC_DEBUG_NONE SMARTIRC_DEBUG_NOTICE SMARTIRC_DEBUG_CONNECTION SMARTIRC_DEBUG_SOCKET SMARTIRC_DEBUG_IRCMESSAGES SMARTIRC_DEBUG_MESSAGETYPES SMARTIRC_DEBUG_ACTIONHANDLER SMARTIRC_DEBUG_TIMEHANDLER SMARTIRC_DEBUG_MESSAGEHANDLER SMARTIRC_DEBUG_CHANNELSYNCING SMARTIRC_DEBUG_MODULES SMARTIRC_DEBUG_USERSYNCING SMARTIRC_DEBUG_ALL

Default: SMARTIRC_DEBUG_NOTICE


Tags:
[ Top ]

setDisconnecttime (line 552)
void setDisconnecttime ( $milliseconds )

Parameters:
  •  
integer   $milliseconds  

Description:
Sets the delaytime before closing the socket when disconnect.

Tags:
  • Access: - public
[ Top ]

setLogdestination (line 514)
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 540)
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 572)
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 643)
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 592)
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 ]

setTransmitTimeout (line 662)
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 378)
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 705)
void showBenchmark ( )

Description:
Shows the benchmark result.

Tags:
  • Access: - public
[ Top ]

startBenchmark (line 677)
void startBenchmark ( )

Description:
Starts the benchmark (sets the counters).

Tags:
  • Access: - public
[ Top ]

stopBenchmark (line 689)
void stopBenchmark ( )

Description:
Stops the benchmark and displays the result.

Tags:
  • Access: - public
[ Top ]

throwError (line 2195)
void &throwError ( $message )

[ Top ]

unregisterActionhandler (line 1216)
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 1257)
boolean unregisterActionid ( $id )

Parameters:
  •  
integer   $id  

Description:
unregisters an existing actionhandler via the id

Tags:
  • Access: - public
[ Top ]

unregisterTimeid (line 1321)
boolean unregisterTimeid ( $id )

Parameters:
  •  
integer   $id  

Description:
unregisters an existing timehandler via the id

Tags:
[ Top ]



Documentation generated on Wed, 23 Jul 2003 19:59:12 +0200 by phpDocumentor 1.2.0beta1c
HTML layout done by Christian Dickmann and originally inspired by PHPEdit