Controller Classのクラスパスを取得します。

@param	array	$route		router
@param	string	$namespace	namespace
517330
public static function GetControllerClassPath ($route, $namespace) {
		$class_path = "\\". implode("\\", [$namespace, 'app', 'controllers', $route['controller'], Strings::ToUpperCamelCase($route['controller']) . 'Controller']);
		if (!class_exists($class_path)) {
			$class_path = "\\". implode("\\", [__NAMESPACE__, 'app', 'controllers', 'UnkownController']);
		}
		return $class_path;
	}
1204131
public function dispatch(Route $route)
    {
        do {
            $this->getEventManager()->publish("pre.dispatch", array($route, $this));

            $protoView = $this->_view->cloneThis();
            $controllerClassName = $route->getControllerName() . "Controller";
            $action = $route->getActionName() . "Action";
            $classPath = $this->getControllerPath() . DIRECTORY_SEPARATOR . $controllerClassName . ".php";
            $viewPath = $route->getControllerPath()
                . DIRECTORY_SEPARATOR
                . $route->getActionPath()
                . $protoView->getViewExt();

            if (!file_exists($classPath)) {
                // Use base controller
                $controllerClassName = 'Controller';
            } else {
                require_once $classPath;
            }

            $controller = new $controllerClassName($this);
            $controller->setRouter($this->getRouter());
            $controller->setRequest($this->getRequest());
            $controller->setParams(
                array_merge(
                    array(
                        "dispatcher" => $this,
                        "bootstrap" => $this->getBootstrap()
                    ),
                    $route->getParams()));
            $controller->setRawBody(@file_get_contents('php://input'));

            $controller->setView($protoView->cloneThis());
            $controller->view->controllerPath = $this->getControllerPath();

            if (method_exists($controller, $action)) {
                ob_start();
                $controller->init();
                $controller->$action();
                array_push($this->_viewsQueue, ob_get_contents());
                ob_end_clean();
            } else {
                if (!file_exists($controller->view->getViewPath() . DIRECTORY_SEPARATOR . $viewPath)) {
                    throw new RuntimeException("Page not found {$route->getControllerName()} -> {$route->getActionName()}", 404);
                }
            }

            if ($controller->view->getViewPath()) {
                array_push(
                    $this->_viewsQueue,
                    $controller->getView()->render(
                        (($controller->getViewPath() !== false) ? $controller->getViewPath() : $viewPath))
                );
            }

            $this->getEventManager()->publish("post.dispatch", array($this));
        } while(($route = array_shift($this->_actions)));

        return implode("", $this->_viewsQueue);
    }
1135727
public function call(App $app, string $namespace, string $prefix = "Controller"){
		//is a Controller
		if(is_string($this->callable)){
			$params = explode('#', $this->callable);
			$params[0] = ((isset($namespace) && strpos($params[0], '\\') === false) ? ($namespace.$params[0].$prefix) : $params[0]);
			if(!class_exists($params[0]))
				throw new HttpException(404, 'Class Not Found : '.$params[0]);
			$controller = new $params[0]($app);
			if(!method_exists($controller,$params[1]))
				throw new HttpException(404, 'Function Not Found : '.$params[0].'::'.$params[1]);
			return call_user_func_array(array($controller, $params[1]), $this->matches);
		} else {
			return call_user_func_array($this->callable, $this->matches);
		}
	}
144245
public function collection($namespace)
    {
        if (!class_exists($namespace)) {
            throw new InvalidRouterCollectionException('Route Collection Class $namespace doesn\'t exists');
        }

        $routeCollection = $this->getContainer()->make($namespace);

        return $routeCollection->setRouter($this);
    }
1164320
private function extractController($path, $controller, $initialSpace = '')
    {
        $class = new ReflectionClass($this->controllersNamespace.'\\'.$controller);

        $methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);

        $routables = array_filter($methods, function ($method) {
            return
                $method->class != 'Illuminate\Routing\Controller' &&
                Str::startsWith($method->name, ['any', 'get', 'post', 'put', 'delete', 'patch']);
        });

        $routes = "\n$initialSpace// $controller\n";

        foreach ($routables as $routable) {
            $routes .= $initialSpace.$this->createRoute($routable, $path, $controller);
        }

        return $routes;
    }
1365714
public function addPath(string $path, string $namespace = self::DEFAULT_NAMESPACE)
    {
        // invalidate the cache
        $this->cache = $this->errorCache = [];

        $this->paths[$namespace][] = rtrim($path, '/\\');
    }
1091320
public function map(Router $router)
    {
        $router->group(['namespace' => $this->namespace], function (Router $router) {
            /*
             * Admin routes
             */
            $router->resource('admin/menus.menulinks', 'AdminController');
            $router->post(
                'admin/menulinks/sort',
                ['as' => 'admin.menulinks.sort', 'uses' => 'AdminController@sort']
            );

            /*
             * API routes
             */
            $router->resource('api/menulinks', 'ApiController');
        });
    }
897616
protected function loadConfigurationFiles($path, $namespace)
	{
		foreach ($this->getConfigurationFiles($path) as $key => $file)
		{
			$configs = require $file;
			$this->setConfigsInNamespace($configs, $key, $namespace);
		}
	}
548374
private static function _getController($uri, $namespace) {
        $dir = realpath(APP_PATH . '/../' . $namespace) . DIRECTORY_SEPARATOR;

        if (!is_dir($dir . $uri)) {
            $uriParts = explode('/', $uri, 2);
            if (is_dir($dir . $uriParts[0])) {
                return self::_getController($uriParts[1], $namespace . $uriParts[0] . '\\');
            } elseif (is_file($dir . $uriParts[0] . '.php')) {
                $uri = $uriParts[0];
            }
        } else {
            $namespace = $namespace . '\\' . str_replace('/', '\\', $uri);
            $uri = '';
        }

        if (substr($namespace, -1) == '\\') {
            $namespace = substr($namespace, 0, strlen($namespace) - 1);
        }
        if (!$uri) {
            $uri = self::getNamespaceDefaultClass($namespace, 'App\\'); // Sets the default class
        }

        return self::fixNamespace($namespace . '\\' . $uri);
    }
121470
public static function delete(string $name, string $namespace = '*'): void
    {
        self::initialize();
        if (isset($_SESSION[$namespace][$name])) {
            unset($_SESSION[$namespace][$name]);
            if (count($_SESSION[$namespace]) === 0) {
                unset($_SESSION[$namespace]);
            }
        }
    }
253169
public function findControllerNamespace($namespace)
	{
	    $prefixs = $this->getControllerNamespaces();
	    
	    $expr          = preg_replace_callback('{([^:]+|)}', function ($matches) {
	        return preg_quote($matches[1]) . '[^:]*';
	    }, $namespace);
	    
	    $find_names = preg_grep('{^' . $expr . '}', $prefixs);
        
	    if (empty($find_names)) {
	        $message = sprintf('There are no controllers defined in the "%s" namespace.', $namespace);
            
	        if ($alternatives = $this->findAlternatives($namespace, $prefixs)) {
                if (1 == count($alternatives)) {
                    $message .= "\n\nDid you mean this?\n    ";
                } else {
                    $message .= "\n\nDid you mean one of these?\n    ";
                }
                
                $message .= implode("\n    ", $alternatives);
            }
            
            throw new \InvalidArgumentException($message);
        }
        
        $exact = in_array($namespace, $find_names, true);
        if (count($find_names) > 1 && !$exact) {
            throw new \InvalidArgumentException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions(array_values($find_names))));
        }
        
        return $exact ? $namespace : reset($find_names);
	}
290283
public function register_router_controller($router, $params, $controller)
    {
        if (!is_array($params)) {
            $params = array($params);
        }
        $route = $params[0];
        $method = isset($params[1]) ? $params[1] : 'GET|POST';
        $name = isset($params[2]) ? $params[2] : $controller;
        if (in_array($name, $this->controllers_routes)) {
            $name = null;
        } else {
            $this->controllers_routes[] = $name;
        }
        $this->controllers_url_routes[] = $controller . ' ' . $route . ' [' . $method . ']';
        if(!isset(self::$routes[$name])) {
            $router->map($method, $route, array($this, $controller), $name);
            self::$routes[$name] = true;
        } else {
            $router->map($method, $route, array($this, $controller));

        }
    }
668305
protected function loadBackendRoutesFrom(string $path, ?string $namespace = '', array $attributes = []): void
    {
        $foundation = $this->app->make('orchestra.app');
        $attributes = $this->resolveRouteGroupAttributes($namespace, $attributes);

        $foundation->namespaced(null, $attributes, $this->getRouteLoader($path));
    }
197607
protected function getRouteInformation(Route $route, $filter, $namespace): ?array
    {
        $uri = $route->uri();
        $host = $route->domain();
        $name = $route->getName();
        $laroute = $route->getAction('laroute');

        switch ($filter) {
            case 'all':
                if ($laroute === false) {
                    return null;
                }
                break;
            case 'only':
                if ($laroute !== true) {
                    return null;
                }
                break;
        }

        return compact('host', 'uri', 'name');
    }
244722
public function fileController($route, $class, $method = "")
    {
        $file = "../OxApp/controllers/" . $class . "Controller.php";
        $file = str_replace("\\", "/", $file);
        if (is_readable($file) === false) {
            throw new \Exception($file . ' Controller Not Found');
        } else {
            $class .= "Controller";
            try {
                $this->useMethod($class, $method);
                Router::$route = $route;
                Router::$controller = $class;
                Router::$routeCounts += 1;
            } catch (\RuntimeException $e) {
                throw new \Exception($e);
            }
        }
    }
290113
private function callController(Route $route, array $args)
    {
        $callback = $route->getController();

        $args = array_merge($route->getArgs(), $args);

        // keep route for error
        if (!$this->currentRoute) {
            $this->currentRoute = $route;
            $this->args = $args;
        }

        // simple function
        if (is_callable($callback) && is_object($callback)) {
            return call_user_func_array($callback, [$args]);
        }

        // controller
        preg_match('`([A-Za-z_0-9\\\\<>]+)(?:::)?([A-Za-z_0-9_<>]+)?`', $callback, $find);

        $class = $this->replaceDynamicArgs($find[1], $route, $args);
        $method = isset($find[2]) ? $this->replaceDynamicArgs($find[2], $route, $args) : null;

        // replace class dynamic args
        if (!class_exists($class)) {
            throw new \BadMethodCallException(sprintf(
                "Can't load class '%s' on route '%s'",
                $class,
                $route->getName()
            ));
        }

        $controller = new $class();

        if (is_null($method)) {
            $method = 'get';

            if (self::request()->isAjax() && method_exists($controller, 'ajax')) {
                $method = 'ajax';
            } elseif (self::request()->getMethod() == 'POST' && method_exists($controller, 'post')) {
                $method = 'post';
            }
        }

        $ordererArgs = $this->mapArguments($controller, $method, $args);

        $event = new TimerEvent('router.mainController');
        $event->setData([
            'controller' => $class,
            'method' => $method,
            'data' => $ordererArgs,
        ]);

        try {
            $return = null;
            if (method_exists($controller, 'init')) {
                $return = call_user_func_array(
                    [$controller, 'init'],
                    $this->mapArguments($controller, 'init', $args)
                );
            }

            if (is_null($return)) {
                $return = call_user_func_array([$controller, $method], $ordererArgs);
            }
        } catch (HttpStatusCode $exception) {
            $return = $exception->getResponse();

            if (!$return) {
                $return = self::returnError($exception->getCode());
            }
        }

        self::emit($event);

        return $return;
    }
749863
public function register_namespace( $namespace, $paths )
    {
        if ( isset( $this->namespaces[ $namespace ] ) )
        {
            $this->namespaces[ $namespace ] = array_merge(
                $this->namespaces[ $namespace ],
                (array) $paths
            );
        } 
        else 
        {
            $this->namespaces[ $namespace ] = (array) $paths;
            
            // Register PSR_0 as the first autoload filter for every namespace
            $this->register_autoload_filter( $namespace, array( $this, "PSR_0" ) );
        }
    }