Example #1
0
 public function __call($method, $args)
 {
     global $bot;
     if ($this->{$method} instanceof Closure) {
         try {
             $bot->debug("PHP_Fork child::command ('{$method}' on '{$this->getName()}')");
             return call_user_func_array($this->{$method}, $args);
         } catch (PHP_ForkException $e) {
             $bot->debug("PHP_Fork child::error ('{$method}' on '{$this->getName()}') : '" . $e->getMessage() . "'");
             return false;
         }
     } else {
         try {
             $bot->debug("PHP_Fork parent::command ('{$method}' on '{$this->getName()}')");
             return parent::__call($method, $args);
         } catch (PHP_ForkException $e) {
             $bot->debug("PHP_Fork parent::error ('{$method}' on '{$this->getName()}') : '" . $e->getMessage() . "'");
             return false;
         }
     }
 }
Example #2
0
 function stop()
 {
     $this->setVariable('status', self::IDLE);
     parent::stop();
 }