public function run(Application $app) { $this->trigger(self::EVENT_BEFORE_RUN); if (count($this->_afterCallbacks) > 0) { $this->runCommandInForeground($app); } else { $this->runCommandInBackground($app); } $this->trigger(self::EVENT_AFTER_RUN); }