*/ protected function handleDispatcherResponse($routeInfo) { switch ($routeInfo[0]) { case Dispatcher::NOT_FOUND: throw new NotFoundHttpException; case Dispatcher::METHOD_NOT_ALLOWED: throw new MethodNotAllowedHttpException($routeInfo[1]); case Dispatcher::FOUND: return $this->handleFoundRoute($routeInfo); } if (isset($this->router->getRoutes()[$method.$pathInfo])) { return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]); } return $this->handleDispatcherResponse( $this->createDispatcher()->dispatch($method, $pathInfo) ); }); } catch (Throwable $e) { return $this->prepareResponse($this->sendExceptionToHandler($e)); } ->send($this->make('request')) ->through($middleware) ->then($then); } return $then($this->make('request')); } /** * Prepare the response for sending. * } return $this->handleDispatcherResponse( $this->createDispatcher()->dispatch($method, $pathInfo) ); }); } catch (Throwable $e) { return $this->prepareResponse($this->sendExceptionToHandler($e)); } } } } public function directDispatch($request = null) { return parent::dispatch($request); }} try { $this->boot(); $response = $dingoRequest->handle($this['request'], function($request) { // 当api路由找不到时 return $this->directDispatch($request); }); // 统一http响应状态码 $statusCode = $response->getStatusCode(); if ($statusCode != 200 && $statusCode != 401) { $response->setStatusCode(200); $this->exception->report($exception); return $this->exception->handle($exception); } return $next($request); } /** * Send the request through the Dingo router. * try { $this->boot(); $response = $dingoRequest->handle($this['request'], function($request) { // 当api路由找不到时 return $this->directDispatch($request); }); // 统一http响应状态码 $statusCode = $response->getStatusCode(); if ($statusCode != 200 && $statusCode != 401) { $response->setStatusCode(200); } * @param \Symfony\Component\HttpFoundation\Request|null $request * @return void */ public function run($request = null) { $response = $this->dispatch($request); if ($response instanceof SymfonyResponse) { $response->send(); } else { echo (string) $response;| the client's browser allowing them to enjoy the creative| and wonderful application we have prepared for them.|*/$app->run();// 结束分析# $xhprof_data = xhprof_disable();# $XHPROF_ROOT = realpath(dirname(__FILE__) .'/..');# include_once $XHPROF_ROOT . "/xhprof/xhprof_lib/utils/xhprof_lib.php";|
NotFoundHttpException
|
|---|
Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
at /www/wwwroot/ecshopx-api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:233
at Laravel\Lumen\Application->handleDispatcherResponse()
(/www/wwwroot/ecshopx-api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:173)
at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}()
(/www/wwwroot/ecshopx-api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:429)
at Laravel\Lumen\Application->sendThroughPipeline()
(/www/wwwroot/ecshopx-api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:175)
at Laravel\Lumen\Application->dispatch()
(/www/wwwroot/ecshopx-api/app/AppKernel.php:73)
at AppKernel->directDispatch()
(/www/wwwroot/ecshopx-api/app/AppKernel.php:55)
at AppKernel->{closure}()
(/www/wwwroot/ecshopx-api/vendor/dingo/api/src/Http/Middleware/Request.php:111)
at Dingo\Api\Http\Middleware\Request->handle()
(/www/wwwroot/ecshopx-api/app/AppKernel.php:56)
at AppKernel->dispatch()
(/www/wwwroot/ecshopx-api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112)
at Laravel\Lumen\Application->run()
(/www/wwwroot/ecshopx-api/public/index.php:31)
|