直接上代码
-      private function getControllers($type = 1){
-         $file = opendir(__DIR__);
-         $controllers = array();
-         if($file){
-             while(($f1 = readdir($file)) !== false){
-                 if($f1 != "." && $f1 != ".." && !is_dir($f1)){
-                     $controller_names = basename($f1,'.php');
-                     if($type == 2){
-                         $temp_array = $this->getMethods($controller_names);
-                         $controllers[$controller_names] = $temp_array;
-                     }else{
-                         $temp_array = $controller_names;
-                         $controllers[] = $temp_array;
-                     }
-                 }
-             }
-         }
-         closedir($file);
-         return $controllers;
-     }
-     /**
-      * 使用反射机制映射出对应类的方法名 去除继承的方法以及私有方法
-      * @param $controller
-      * @return array
-      */
-     private function getMethods($controller)
-     {
-         $controller = __NAMESPACE__.DIRECTORY_SEPARATOR.$controller;
-         $method = array();
-         $class = new \ReflectionObject(new $controller());
-         //获取父类的方法
-         foreach ($class->getParentClass()->getMethods() as $v){
-             if(!$v->isPrivate()) $method[] = $v->getName();
-         }
-         $true_methods = array();
-         //去除继承的方法
-         foreach ($class->getMethods() as $v){
-             if(!$v->isPrivate()) {
-                 if(!in_array($v->getName(),$method)){
-                     $true_methods[] = $v->getName();
-                 }
-             }
-         }
-         return $true_methods;
-     }