public final function execute($namespace, $task, $cliParams = array()) { //special case for init-project if ("{$namespace}:{$task}" !== 'core:init-project' && "{$namespace}:{$task}" !== 'core:help') { if (!file_exists(sgContext::getInstance()->getRootDir() . '/config/ProjectConfiguration.class.php')) { sgCLI::error("Task \"{$namespace}:{$task}\" can only be executed in a project directory."); return false; } } if ($params = $this->parseParams($namespace, $task, $cliParams)) { $executeMethod = sgToolkit::camelCase("execute {$namespace} {$task}"); $this->{$executeMethod}($params['arguments'], $params['options']); return true; } return false; }