*/ class SetUse extends MindCommand implements program { private $argName= false; private $what= false; public function configure() { $this->setName('use') ->setDescription('Opens the project, or specifies any personal option') ->setRestrict(true) ->setFileName('SetUse') ->setDefinition(Array( new InputArgument('what', InputArgument::REQUIRED, 'What to use, from now on'), new InputArgument('name', InputArgument::REQUIRED, 'specify what you want to use/open') )) ->setHelp(<<what= $input->getArgument('what'); $this->argName= $input->getArgument('name'); $this->runAction(); } public function HTTPExecute() { GLOBAL $_REQ; if(!parent::HTTPExecute()) return false; if(isset($_REQ['data']['what']) && isset($_REQ['data']['name'])) { $this->argName= $_REQ['data']['name']; $this->what= $_REQ['data']['what']; } $this->runAction(); } private function action() { switch($this->what) { case 'project': if(!$projectData= Mind::hasProject($this->argName)) return false; Mind::openProject($projectData); break; } return $this; } public function runAction() { $ret= $this->action(); parent::runAction(); return $ret; } }