$argc) { throw new \Exception("사용법 : php app.php 클래스명 [함수명(default:execute) parameters]\n"); } //php 파일명 $phpName = array_shift($argv); //클래스 검사(Autoload) $className = CONTROLLER . array_shift($argv); $class = new $className(); //함수 검사 $functionName = array_shift($argv) ?: "execute"; if (!method_exists($class, $functionName)) { throw new \Exception("클래스[{$className}]에 함수[{$functionName}]는 존재하지 않습니다.\n"); } echo $class->$functionName($argv); } catch (\Exception $e) { echo $e->getMessage(); } //