/** * (non-PHPdoc) * @see MageUC_Console_Task::validate() */ public function validate() { if (!@(include_once 'PHP/PMD/TextUI/Command.php')) { throw new MageUC_Console_Exception('PHP Mess Detector is required.'); } return parent::validate(); }
/** * (non-PHPdoc) * @see MageUC_Console_Task::validate() */ public function validate() { if (!@(include_once 'PHPUnit/Autoload.php')) { throw new MageUC_Console_Exception('PHPUnit is required.'); } return parent::validate(); }
/** * (non-PHPdoc) * @see MageUC_Console_Task::validate() */ public function validate() { if (!@(include_once 'PHP/CodeSniffer.php')) { throw new MageUC_Console_Exception('PHP_CodeSniffer is required.'); } return parent::validate(); }
/** * Run the console * * @param array $args command line arguments * @return void */ protected function _run($args) { $taskClass = $this->_getTaskClassFromArgs($args[1]); if (!class_exists($taskClass)) { throw new MageUC_Console_Exception('Unknown task : ' . $taskClass . PHP_EOL); } unset($args[0]); unset($args[1]); $this->_taskInstance = new $taskClass(); $this->_taskInstance->setArguments($this->prepareArgs($args)); if ($this->_taskInstance->validate()) { ob_start(); $this->_taskInstance->execute(); ob_flush(); } else { throw new MageUC_Console_Exception('Invalide arguments for task : ' . $taskClass . PHP_EOL); } }