PHP 클래스 Phergie\Irc\Bot\React\Bot

파일 보기 프로젝트 열기: phergie/phergie-irc-bot-react 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$client Phergie\Irc\Client\React\ClientInterface IRC client in use by the bot
$config array Configuration in use by the bot
$converter Phergie\Irc\Event\ParserConverterInterface Converter for event data from the IRC client's underlying parser
$logger Psr\Log\LoggerInterface Logger in use by the bot, defaults to logger in use by the IRC client
$parser Phergie\Irc\ParserInterface Parser for converting generated IRC commands into event objects
$queueFactory Phergie\Irc\Bot\React\EventQueueFactoryInterface Event queue factory for creating connection-specific event queues

공개 메소드들

메소드 설명
getClient ( ) : Phergie\Irc\Client\React\ClientInterface Returns the IRC client in use by the bot.
getConfig ( ) : array Returns the configuration in use by the bot.
getConverter ( ) : Phergie\Irc\Event\ParserConverterInterface Returns the parser converter for event data in use by the bot.
getEventQueueFactory ( ) : Phergie\Irc\Bot\React\EventQueueFactoryInterface Returns the event queue factory in use by the bot.
getLogger ( ) : Psr\Log\LoggerInterface Returns the logger in use by the bot.
getParser ( ) : Phergie\Irc\ParserInterface Returns the parser for generated event data in use by the bot.
processClientEvent ( string $event, array $message, Phergie\Irc\ConnectionInterface $connection, Phergie\Irc\Client\React\WriteStream $write ) Callback to process client events. Not intended to be called from outside this class.
processOutgoingEvents ( Phergie\Irc\ConnectionInterface $connection, Phergie\Irc\Client\React\WriteStream $write ) Callback to process any queued outgoing events. Not intended to be called from outside thie class.
run ( boolean $autorun = true ) Initiates an event loop for the bot in which it will connect to servers and monitor those connections for events to forward to plugins.
setClient ( Phergie\Irc\Client\React\ClientInterface $client ) Sets the IRC client for the bot to use.
setConfig ( array $config ) Sets the configuration to be used by the bot in its operations.
setConverter ( Phergie\Irc\Event\ParserConverterInterface $converter ) Sets the parser converter for event data in use by the bot.
setEventQueueFactory ( Phergie\Irc\Bot\React\EventQueueFactoryInterface $queueFactory ) Sets the event queue factory for the bot to use.
setLogger ( Psr\Log\LoggerInterface $logger ) Sets the logger in use by the bot.
setParser ( Phergie\Irc\ParserInterface $parser ) Sets the parser for generated event data in use by the bot.

보호된 메소드들

메소드 설명
getConnections ( array $config ) : Phergie\Irc\ConnectionInterface[] Extracts connections from configuration.
getDefaultPluginProcessors ( ) : Phergie\Irc\Bot\React\PluginProcessor\PluginProcessorInterface[] Returns a list of default plugin processors used when none are set via configuration.
getEventSubtype ( Phergie\Irc\Event\EventInterface $event ) : string Returns an event subtype corresponding to a given event object, used to generate event names when emitting events.
getPluginProcessors ( array $config ) Returns a list of processors for plugins.
getPlugins ( array $config ) : Phergie\Irc\Bot\React\PluginInterface[] Extracts plugins from configuration.
processPlugins ( array $plugins, array $processors, SplObjectStorage $processedPlugins = null ) Processes a list of plugins for use.
registerClientSubscribers ( Phergie\Irc\Client\React\ClientInterface $client ) Configures the client to emit events for specific types of messages.
registerPluginSubscribers ( array $plugins ) Registers event callbacks from plugins.
setDependencyOverrides ( array $config ) Sets dependencies from configuration.
validatePluginEvents ( Phergie\Irc\Bot\React\PluginInterface $plugin ) Validates a plugin's event callbacks.

메소드 상세

getClient() 공개 메소드

Returns the IRC client in use by the bot.
public getClient ( ) : Phergie\Irc\Client\React\ClientInterface
리턴 Phergie\Irc\Client\React\ClientInterface

getConfig() 공개 메소드

Returns the configuration in use by the bot.
public getConfig ( ) : array
리턴 array Associative array keyed by setting name

getConnections() 보호된 메소드

Extracts connections from configuration.
protected getConnections ( array $config ) : Phergie\Irc\ConnectionInterface[]
$config array Associative array keyed by setting name
리턴 Phergie\Irc\ConnectionInterface[]

getConverter() 공개 메소드

Returns the parser converter for event data in use by the bot.
public getConverter ( ) : Phergie\Irc\Event\ParserConverterInterface
리턴 Phergie\Irc\Event\ParserConverterInterface

getDefaultPluginProcessors() 보호된 메소드

Returns a list of default plugin processors used when none are set via configuration.
protected getDefaultPluginProcessors ( ) : Phergie\Irc\Bot\React\PluginProcessor\PluginProcessorInterface[]
리턴 Phergie\Irc\Bot\React\PluginProcessor\PluginProcessorInterface[]

getEventQueueFactory() 공개 메소드

Returns the event queue factory in use by the bot.
public getEventQueueFactory ( ) : Phergie\Irc\Bot\React\EventQueueFactoryInterface
리턴 Phergie\Irc\Bot\React\EventQueueFactoryInterface

getEventSubtype() 보호된 메소드

Returns an event subtype corresponding to a given event object, used to generate event names when emitting events.
protected getEventSubtype ( Phergie\Irc\Event\EventInterface $event ) : string
$event Phergie\Irc\Event\EventInterface
리턴 string

getLogger() 공개 메소드

Returns the logger in use by the bot.
public getLogger ( ) : Psr\Log\LoggerInterface
리턴 Psr\Log\LoggerInterface

getParser() 공개 메소드

Returns the parser for generated event data in use by the bot.
public getParser ( ) : Phergie\Irc\ParserInterface
리턴 Phergie\Irc\ParserInterface

getPluginProcessors() 보호된 메소드

Returns a list of processors for plugins.
protected getPluginProcessors ( array $config )
$config array Associative array keyed by setting name

getPlugins() 보호된 메소드

Extracts plugins from configuration.
protected getPlugins ( array $config ) : Phergie\Irc\Bot\React\PluginInterface[]
$config array Associative array keyed by setting name
리턴 Phergie\Irc\Bot\React\PluginInterface[]

processClientEvent() 공개 메소드

Callback to process client events. Not intended to be called from outside this class.
public processClientEvent ( string $event, array $message, Phergie\Irc\ConnectionInterface $connection, Phergie\Irc\Client\React\WriteStream $write )
$event string Received client event
$message array Parsed message
$connection Phergie\Irc\ConnectionInterface Connection on which the event occurred
$write Phergie\Irc\Client\React\WriteStream Stream used to send commands to the server

processOutgoingEvents() 공개 메소드

Callback to process any queued outgoing events. Not intended to be called from outside thie class.
public processOutgoingEvents ( Phergie\Irc\ConnectionInterface $connection, Phergie\Irc\Client\React\WriteStream $write )
$connection Phergie\Irc\ConnectionInterface Connection on which the event occurred
$write Phergie\Irc\Client\React\WriteStream Stream used to send commands to the server

processPlugins() 보호된 메소드

Processes a list of plugins for use.
protected processPlugins ( array $plugins, array $processors, SplObjectStorage $processedPlugins = null )
$plugins array
$processors array
$processedPlugins SplObjectStorage

registerClientSubscribers() 보호된 메소드

Configures the client to emit events for specific types of messages.
protected registerClientSubscribers ( Phergie\Irc\Client\React\ClientInterface $client )
$client Phergie\Irc\Client\React\ClientInterface Client for which to configure events

registerPluginSubscribers() 보호된 메소드

Registers event callbacks from plugins.
protected registerPluginSubscribers ( array $plugins )
$plugins array Plugins from which to get callbacks

run() 공개 메소드

Initiates an event loop for the bot in which it will connect to servers and monitor those connections for events to forward to plugins.
public run ( boolean $autorun = true )
$autorun boolean

setClient() 공개 메소드

Sets the IRC client for the bot to use.
public setClient ( Phergie\Irc\Client\React\ClientInterface $client )
$client Phergie\Irc\Client\React\ClientInterface

setConfig() 공개 메소드

See config.sample.php for an example configuration file.
public setConfig ( array $config )
$config array Associative array keyed by setting name

setConverter() 공개 메소드

Sets the parser converter for event data in use by the bot.
public setConverter ( Phergie\Irc\Event\ParserConverterInterface $converter )
$converter Phergie\Irc\Event\ParserConverterInterface

setDependencyOverrides() 보호된 메소드

Sets dependencies from configuration.
protected setDependencyOverrides ( array $config )
$config array

setEventQueueFactory() 공개 메소드

Sets the event queue factory for the bot to use.
public setEventQueueFactory ( Phergie\Irc\Bot\React\EventQueueFactoryInterface $queueFactory )
$queueFactory Phergie\Irc\Bot\React\EventQueueFactoryInterface

setLogger() 공개 메소드

Sets the logger in use by the bot.
public setLogger ( Psr\Log\LoggerInterface $logger )
$logger Psr\Log\LoggerInterface

setParser() 공개 메소드

Sets the parser for generated event data in use by the bot.
public setParser ( Phergie\Irc\ParserInterface $parser )
$parser Phergie\Irc\ParserInterface

validatePluginEvents() 보호된 메소드

Validates a plugin's event callbacks.
protected validatePluginEvents ( Phergie\Irc\Bot\React\PluginInterface $plugin )
$plugin Phergie\Irc\Bot\React\PluginInterface

프로퍼티 상세

$client 보호되어 있는 프로퍼티

IRC client in use by the bot
protected ClientInterface,Phergie\Irc\Client\React $client
리턴 Phergie\Irc\Client\React\ClientInterface

$config 보호되어 있는 프로퍼티

Configuration in use by the bot
protected array $config
리턴 array

$converter 보호되어 있는 프로퍼티

Converter for event data from the IRC client's underlying parser
protected ParserConverterInterface,Phergie\Irc\Event $converter
리턴 Phergie\Irc\Event\ParserConverterInterface

$logger 보호되어 있는 프로퍼티

Logger in use by the bot, defaults to logger in use by the IRC client
protected LoggerInterface,Psr\Log $logger
리턴 Psr\Log\LoggerInterface

$parser 보호되어 있는 프로퍼티

Parser for converting generated IRC commands into event objects
protected ParserInterface,Phergie\Irc $parser
리턴 Phergie\Irc\ParserInterface

$queueFactory 보호되어 있는 프로퍼티

Event queue factory for creating connection-specific event queues
protected EventQueueFactoryInterface,Phergie\Irc\Bot\React $queueFactory
리턴 Phergie\Irc\Bot\React\EventQueueFactoryInterface