src/Core/Rest.php
function run()
    {
        $match = false;
        $params = array();
        $process_closure = null;
        if (!empty($this->custom_router_config[$this->request_type])) {
            $custom_routers = $this->custom_router_config[$this->request_type];
            if (!empty($custom_routers['high']) && isset($custom_routers['high'][$this->request_string])) {
                $match = true;
                $process_closure = $custom_routers['high'][$this->request_string];
            } elseif (!empty($custom_routers['current'])) {
                $match = $this->matchProcess($custom_routers['current'], $process_closure, $params);
            } elseif (!empty($custom_routers['global'])) {
                $match = $this->matchProcess($custom_routers['global'], $process_closure, $params);
            }
        }

        if ($match && $process_closure !== null) {
            $this->response($process_closure, $params);
        } else {
            $closure_container = $this->delegate->getClosureContainer();
            if ($closure_container->has('mismatching')) {
                $closure_container->run('mismatching');
            } else {
                throw new CoreException('Not match uri');
            }
        }
    }
function run()
    {
        $match = false;
        $params = array();
        $process_closure = null;
        if (!empty($this->custom_router_config[$this->request_type])) {
            $custom_routers = $this->custom_router_config[$this->request_type];
            if (!empty($custom_routers['high']) && isset($custom_routers['high'][$this->request_string])) {
                $match = true;
                $process_closure = $custom_routers['high'][$this->request_string];
            } elseif (!empty($custom_routers['current'])) {
                $match = $this->matchProcess($custom_routers['current'], $process_closure, $params);
            } elseif (!empty($custom_routers['global'])) {
                $match = $this->matchProcess($custom_routers['global'], $process_closure, $params);
            }
        }

        if ($match && $process_closure !== null) {
            $this->response($process_closure, $params);
        } else {
            $closure_container = $this->delegate->getClosureContainer();
            if ($closure_container->has('mismatching')) {
                $closure_container->run('mismatching');
            } else {
                throw new CoreException('Not match uri');
            }
        }
    }
处理请求

@throws CoreException