/** * 选择组合 * @param $gp * @return array */ private function _chooseGroup($gp) { $oimg = new \H2O\coding\Image(); $simdir = $oimg->getTplDir() . 'app' . DS . $gp; $smch = $this->_readDir($simdir); //读取目录 echo 'Please choose your application group:' . PHP_EOL; $i = 1; $aptyp = []; $input = []; foreach ($smch as $k => $p) { echo $i . ':' . $k . PHP_EOL; $aptyp[$i] = $k; $input[] = $i; $i++; } echo "Enter your number:"; $aptn = $this->_getInputRangVal($input); $group = $aptyp[$aptn]; //对应的应用组合 $groupath = $smch[$group]; //对应组合目录 return ['name' => $group, 'path' => $groupath]; }