Weak hands cannot be planted, meager skills have no foundation. Shallow wisdom is futile, how can one hope for a good name?扰扰从役倦，屑屑身事微。少壮轻年月，迟暮惜光辉。
<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php
namespace DebugLogConfigTool;




class Router
{
    /**
     * All registered routes.
     *
     * @var array
     */
    public $routes = [
        'GET' => [],
        'POST' => []
    ];
    public $routeNames = [];
    
    /**
     * Load a user's routes file.
     *
     * @param string $file
     */
    public static function load($file)
    {
        $router = new static;
        
        include DLCT_PLUGIN_DIR.$file;
        
        return $router;
    }
    
    /**
     * Register a GET route.
     *
     * @param string $uri
     * @param string $controller
     */
    public function get($uri, $controller)
    {
        $this->routeNames[] = $uri;
        $this->routes['GET'][$uri] = $controller;
    }
    
    /**
     * Register a POST route.
     *
     * @param string $uri
     * @param string $controller
     */
    public function post($uri, $controller)
    {
        $this->routeNames[] = $uri;
        $this->routes['POST'][$uri] = $controller;
    }
    
    /**
     * Load the requested URI's associated controller method.
     *
     * @param string $uri
     * @param string $requestType
     */
    public function direct($uri, $requestType)
    {
        if (!$uri) {
            return ['ok' => false, 'reason' => 'empty_action'];
        }

        $validRoutes = in_array($uri, $this->routeNames, true);

        if (isset($this->routes[$requestType]) && array_key_exists($uri, $this->routes[$requestType]) && $validRoutes) {
            $action = explode('@', $this->routes[$requestType][$uri]);
            return $this->callAction(...$action);
        }

        return ['ok' => false, 'reason' => 'unknown_route', 'route' => $uri, 'method' => $requestType];
    }
    
    /**
     * Load and call th