<?php
/**
- * Phergie
+ * Phergie
*
* PHP version 5
*
* It is also available through the world-wide-web at this URL:
* http://phergie.org/license
*
- * @category Phergie
+ * @category Phergie
* @package Phergie
* @author Phergie Development Team <team@phergie.org>
* @copyright 2008-2010 Phergie Development Team (http://phergie.org)
*/
/**
- * Connection data processor which polls to handle input in an
+ * Connection data processor which polls to handle input in an
* asynchronous manner. Will also cause the application tick at
* the user-defined wait time.
*
- * @category Phergie
+ * @category Phergie
* @package Phergie
* @author Phergie Development Team <team@phergie.org>
* @license http://phergie.org/license New BSD License
*
* @var int
*/
- protected $sec;
+ protected $sec = 0;
/**
* Length of time to poll for stream activity (microseconds)
*
* @var int
*/
- protected $usec;
+ protected $usec = 200000;
/**
* Length of time to wait between ticks.
protected $lastTick = 0;
/**
- * Overrides the parent class to set the poll time.
+ * Overrides the parent class to set the poll time.
*
* @param Phergie_Bot $bot Main bot class
* @param array $options Processor arguments
}
}
- if (empty($this->sec) && empty($this->usec)) {
+ if (!isset($this->sec) && !isset($this->usec)) {
throw new Phergie_Process_Exception(
'One of the processor options "sec" or "usec" must be specified'
);
}
/**
- * Waits for stream activity and performs event processing on
+ * Waits for stream activity and performs event processing on
* connections with data to read.
*
* @return void
if ($event = $this->driver->getEvent()) {
$this->ui->onEvent($event, $connection);
$this->plugins->setEvent($event);
-
- if (!$this->plugins->preEvent()) {
- continue;
- }
-
+ $this->plugins->preEvent();
$this->plugins->{'on' . ucfirst($event->getType())}();
}
}
/**
- * Obtains and processes incoming events, then sends resulting outgoing
+ * Obtains and processes incoming events, then sends resulting outgoing
* events.
*
* @return void