]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Irc/extlib/phergie/Phergie/Process/Standard.php
Revert "Merged in Phergie changes"
[quix0rs-gnu-social.git] / plugins / Irc / extlib / phergie / Phergie / Process / Standard.php
1 <?php
2 /**
3  * Phergie 
4  *
5  * PHP version 5
6  *
7  * LICENSE
8  *
9  * This source file is subject to the new BSD license that is bundled
10  * with this package in the file LICENSE.
11  * It is also available through the world-wide-web at this URL:
12  * http://phergie.org/license
13  *
14  * @category  Phergie 
15  * @package   Phergie
16  * @author    Phergie Development Team <team@phergie.org>
17  * @copyright 2008-2010 Phergie Development Team (http://phergie.org)
18  * @license   http://phergie.org/license New BSD License
19  * @link      http://pear.phergie.org/package/Phergie
20  */
21
22 /**
23  * Connection data processor which reads all connections looking
24  * for a response.
25  *
26  * @category Phergie 
27  * @package  Phergie
28  * @author   Phergie Development Team <team@phergie.org>
29  * @license  http://phergie.org/license New BSD License
30  * @link     http://pear.phergie.org/package/Phergie
31  */
32 class Phergie_Process_Standard extends Phergie_Process_Abstract
33 {
34     /**
35      * Obtains and processes incoming events, then sends resulting outgoing 
36      * events.
37      *
38      * @return void
39      */
40     public function handleEvents()
41     {
42         foreach ($this->connections as $connection) {
43             $this->driver->setConnection($connection);
44             $this->plugins->setConnection($connection);
45             $this->plugins->onTick();
46
47             if ($event = $this->driver->getEvent()) {
48                 $this->ui->onEvent($event, $connection);
49                 $this->plugins->setEvent($event);
50
51                 if (!$this->plugins->preEvent()) {
52                     continue;
53                 }
54
55                 $this->plugins->{'on' . ucfirst($event->getType())}();
56             }
57
58             $this->processEvents($connection);
59         }
60     }
61 }