This is an old revision of the document!
Abstract class factory which creates the concrete phpFreeChat_Server objects. Examples: IRC, XMPP, File … It also factorizes a static reference to the current phpFreeChat instance.
The concretes phpFreeChat_Server classes roles are to provide the glue between phpfreechat and the server's specificities.
Handles the network communications between phpfreechat and the real IRC server somewhere on the Internet.
phpFreeChat_Command_IRC) and pushes it to the corresponding command queue (phpFreeChat_CommandQueue_Server2Client).
Abstract class factory which creates the concrete phpFreeChat_Client objects. Currently, the only available client is Web but we can imagine other kind of clients in the future. It also factorizes a static reference to the current phpFreeChat instance.
The concretes phpFreeChat_Client classes roles are to provide the glue between phpfreechat and the client's specificities.
Handles the network communications between phpfreechat and the web client.
Server2Client queue and send it to the browser using the JSON format.Client2Server queue.It is a queue that contains the phpfreechat commands. Commands in the queue are ordered with simple priorities: 0 for low, 1 for medium, 2 for high and 3 for critical.
phpFreeChat instance manage two queue instances: Server2Client and Client2Server.
$command1 = phpFreeChat_Command::factory('IRC','PING'); $command2 = phpFreeChat_Command::factory('IRC','JOIN #pfc'); $queue = new phpFreeChat_CommandQueue_Client2Server(); $queue->push($command1); // medium priority command (default) $queue->push($command2, 3); // critical priority command $o1 = $queue->pop(); // $o1 contains $command2 $o2 = $queue->pop(); // $o2 contains $command1
This queue is used to store commands coming from the phpFreeChat_Server_… instance and for the phpFreeChat_Client_… instance.
This queue is used to store commands coming from the phpFreeChat_Client_… instance and for the phpFreeChat_Server_… instance.
Abstract class factory used to create concrete phpFreeChat_Command_… objects. Examples: IRC, XMPP, File … It also factorizes a static reference to the current phpFreeChat instance.
$command = phpFreeChat_Command::factory('IRC','JOIN #pfc');
The command creation process will automatically link wanted command proxies (described in the global parameters) to the given command.
Abstract class factory used to create concrete phpFreeChat_Command_IRC… commands. Examples: PING, PONG, PRIVMSG, JOIN …
$command = phpFreeChat_Command_IRC::factory('JOIN #pfc');
Implements the JOIN command for the IRC protocol on phpfreechat.
$command = new phpFreeChat_Command_IRC_JOIN('#pfc');
Abstract class factory used to create concrete phpFreeChat_Command_Proxy… objects. Examples: Log, CountUser, …
$logproxy = phpFreeChat_Command_Proxy::factory('IRC','Log'); ... $countproxy = phpFreeChat_Command_Proxy::factory('IRC','CountProxy');
A concrete command proxy that will log the chat communications into a given container (File, BDD …)
This command proxy is inherited from the Log proxy. It provide the same role as the parent Log proxy but adapted to the IRC driver. This class will contains IRC specific code to reformat the IRC communications to a generic format excepted by the Log proxy.