/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/qinglong
/framework
/Foundation
/Exception
/Handler.php
], $e -> getStatusCode(), $e -> getHeaders());
}
}
return $this -> convertExceptionToResponse($e);
}
/**
* laravel exception 转换为 qinglong exception
*
* @param Exception $exception
* @return Exception
*/
public function convertToQinglongException(Exception $exception)
{
if ($exception instanceof CommonException) {
return $exception;
} else {
if ($exception instanceof NotFoundHttpException) {
$exception = new HttpNotfoundException($exception -> getMessage(), 0, $exception);
} elseif ($exception instanceof QueryException) {
$exception = new DatabaseException($exception -> getMessage(), 0, $exception);
} else {
$exception = new ServerRunException($exception -> getMessage(), 0, $exception);
}
return $exception;
}
}
/**
* Determine if the exception is in the "do not report" list.
*
* @param \Exception $exception
* @return bool
*/
protected function shouldntReport(Exception $exception)
{
if ($exception instanceof CommonException) {
return !$exception -> needReport || parent ::shouldntReport($exception);
} else {
Arguments
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/qinglong
/framework
/Routing
/Pipeline.php
$e = $this -> convertToQinglongException($e);
return $this -> handleException($passable, $e);
} catch (Throwable $e) {
$e = $this -> convertToQinglongException($e = new FatalThrowableError($e));
return $this -> handleException($passable, $e);
}
};
};
}
/**
* laravel exception转换为qinglong exception
*
* @param Exception $exception
* @return Exception
*/
protected function convertToQinglongException(Exception $exception)
{
if (method_exists(app(ExceptionHandler::class), 'convertToQinglongException')) {
$exception = app(ExceptionHandler::class) -> convertToQinglongException($exception);
}
return $exception;
}
}
Arguments
NotFoundHttpException {#111
-statusCode: 404
-headers: []
#message: ""
#code: 0
#file: "/home/yfdisk/wwwroot/dev.taojibao.cn/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php"
#line: 179
}
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/qinglong
/framework
/Routing
/Pipeline.php
use Symfony\Component\Debug\Exception\FatalThrowableError;
use Illuminate\Routing\Pipeline as LaravelRoutingPipeline;
use Illuminate\Contracts\Debug\ExceptionHandler;
class Pipeline extends LaravelRoutingPipeline
{
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
try {
return $destination($passable);
} catch (Exception $e) {
$e = $this -> convertToQinglongException($e);
return $this -> handleException($passable, $e);
} catch (Throwable $e) {
$e = $this -> convertToQinglongException($e = new FatalThrowableError($e));
return $this -> handleException($passable, $e);
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent ::carry();
Arguments
NotFoundHttpException {#111
-statusCode: 404
-headers: []
#message: ""
#code: 0
#file: "/home/yfdisk/wwwroot/dev.taojibao.cn/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php"
#line: 179
}
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/RouteCollection.php
// First, we will see if we can find a matching route for this current request
// method. If we can, great, we can just return it so that it can be called
// by the consumer. Otherwise we will check for routes with another verb.
$route = $this->matchAgainstRoutes($routes, $request);
if (! is_null($route)) {
return $route->bind($request);
}
// If no route was found we will now check if a matching route is specified by
// another HTTP verb. If it is we will need to throw a MethodNotAllowed and
// inform the user agent of which HTTP verb it should use for this route.
$others = $this->checkForAlternateVerbs($request);
if (count($others) > 0) {
return $this->getRouteForMethods($request, $others);
}
throw new NotFoundHttpException;
}
/**
* Determine if a route in the array matches the request.
*
* @param array $routes
* @param \Illuminate\Http\Request $request
* @param bool $includingMethod
* @return \Illuminate\Routing\Route|null
*/
protected function matchAgainstRoutes(array $routes, $request, $includingMethod = true)
{
[$fallbacks, $routes] = collect($routes)->partition(function ($route) {
return $route->isFallback;
});
return $routes->merge($fallbacks)->first(function ($value) use ($request, $includingMethod) {
return $value->matches($request, $includingMethod);
});
}
Arguments
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
/**
* Dispatch the request to a route and return the response.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
public function dispatchToRoute(Request $request)
{
return $this->runRoute($request, $this->findRoute($request));
}
/**
* Find the route matching a given request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Routing\Route
*/
protected function findRoute($request)
{
$this->current = $route = $this->routes->match($request);
$this->container->instance(Route::class, $route);
return $route;
}
/**
* Return the response for the given route.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Routing\Route $route
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
protected function runRoute(Request $request, Route $route)
{
$request->setRouteResolver(function () use ($route) {
return $route;
});
$this->events->dispatch(new Events\RouteMatched($route, $request));
Arguments
Request {#49
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: ParameterBag {#51}
+request: ParameterBag {#57}
+query: ParameterBag {#57}
+server: ServerBag {#53}
+files: FileBag {#54}
+cookies: ParameterBag {#52}
+headers: HeaderBag {#55}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/"
requestUri: "/"
baseUrl: ""
basePath: ""
format: "html"
}
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/qinglong
/framework
/Routing
/Router.php
protected function actionReferencesController($action)
{
if (!$action instanceof \Closure) {
return
(is_string($action) && strpos($action, 'view::') !== 0)
|| (isset($action['uses']) && is_string($action['uses']));
}
return false;
}
/**
* Find the route matching a given request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Routing\Route
*/
protected function findRoute($request)
{
$route = parent ::findRoute($request);
//绑定路由参数数据
$this -> routeHelper = app(RouteHelper::class);
$parameters = $this -> routeHelper -> getMatchedRuleParamData();
$this -> current -> parameters = $parameters;
return $route;
}
}
Arguments
Request {#49
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: ParameterBag {#51}
+request: ParameterBag {#57}
+query: ParameterBag {#57}
+server: ServerBag {#53}
+files: FileBag {#54}
+cookies: ParameterBag {#52}
+headers: HeaderBag {#55}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/"
requestUri: "/"
baseUrl: ""
basePath: ""
format: "html"
}
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
public function dispatch(Request $request)
{
$this->currentRequest = $request;
return $this->dispatchToRoute($request);
}
/**
* Dispatch the request to a route and return the response.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
public function dispatchToRoute(Request $request)
{
return $this->runRoute($request, $this->findRoute($request));
}
/**
* Find the route matching a given request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Routing\Route
*/
protected function findRoute($request)
{
$this->current = $route = $this->routes->match($request);
$this->container->instance(Route::class, $route);
return $route;
}
/**
* Return the response for the given route.
*
Arguments
Request {#49
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: ParameterBag {#51}
+request: ParameterBag {#57}
+query: ParameterBag {#57}
+server: ServerBag {#53}
+files: FileBag {#54}
+cookies: ParameterBag {#52}
+headers: HeaderBag {#55}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/"
requestUri: "/"
baseUrl: ""
basePath: ""
format: "html"
}
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
public function respondWithRoute($name)
{
$route = tap($this->routes->getByName($name))->bind($this->currentRequest);
return $this->runRoute($this->currentRequest, $route);
}
/**
* Dispatch the request to the application.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
public function dispatch(Request $request)
{
$this->currentRequest = $request;
return $this->dispatchToRoute($request);
}
/**
* Dispatch the request to a route and return the response.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
public function dispatchToRoute(Request $request)
{
return $this->runRoute($request, $this->findRoute($request));
}
/**
* Find the route matching a given request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Routing\Route
*/
protected function findRoute($request)
Arguments
Request {#49
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: ParameterBag {#51}
+request: ParameterBag {#57}
+query: ParameterBag {#57}
+server: ServerBag {#53}
+files: FileBag {#54}
+cookies: ParameterBag {#52}
+headers: HeaderBag {#55}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/"
requestUri: "/"
baseUrl: ""
basePath: ""
format: "html"
}
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Kernel.php
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
* Get the route dispatcher callback.
*
* @return \Closure
*/
protected function dispatchToRouter()
{
return function ($request) {
$this->app->instance('request', $request);
return $this->router->dispatch($request);
};
}
/**
* Call the terminate method on any terminable middleware.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Response $response
* @return void
*/
public function terminate($request, $response)
{
$this->terminateMiddleware($request, $response);
$this->app->terminate();
}
/**
* Call the terminate method on any terminable middleware.
*
Arguments
Request {#49
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: ParameterBag {#51}
+request: ParameterBag {#57}
+query: ParameterBag {#57}
+server: ServerBag {#53}
+files: FileBag {#54}
+cookies: ParameterBag {#52}
+headers: HeaderBag {#55}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/"
requestUri: "/"
baseUrl: ""
basePath: ""
format: "html"
}
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/qinglong
/framework
/Routing
/Pipeline.php
use Throwable;
use Exception;
use Symfony\Component\Debug\Exception\FatalThrowableError;
use Illuminate\Routing\Pipeline as LaravelRoutingPipeline;
use Illuminate\Contracts\Debug\ExceptionHandler;
class Pipeline extends LaravelRoutingPipeline
{
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
try {
return $destination($passable);
} catch (Exception $e) {
$e = $this -> convertToQinglongException($e);
return $this -> handleException($passable, $e);
} catch (Throwable $e) {
$e = $this -> convertToQinglongException($e = new FatalThrowableError($e));
return $this -> handleException($passable, $e);
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
Arguments
Request {#49
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: ParameterBag {#51}
+request: ParameterBag {#57}
+query: ParameterBag {#57}
+server: ServerBag {#53}
+files: FileBag {#54}
+cookies: ParameterBag {#52}
+headers: HeaderBag {#55}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/"
requestUri: "/"
baseUrl: ""
basePath: ""
format: "html"
}
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
public function via($method)
{
$this->method = $method;
return $this;
}
/**
* Run the pipeline with a final destination callback.
*
* @param \Closure $destination
* @return mixed
*/
public function then(Closure $destination)
{
$pipeline = array_reduce(
array_reverse($this->pipes), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Run the pipeline and return the result.
*
* @return mixed
*/
public function thenReturn()
{
return $this->then(function ($passable) {
return $passable;
});
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
Arguments
Request {#49
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: ParameterBag {#51}
+request: ParameterBag {#57}
+query: ParameterBag {#57}
+server: ServerBag {#53}
+files: FileBag {#54}
+cookies: ParameterBag {#52}
+headers: HeaderBag {#55}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/"
requestUri: "/"
baseUrl: ""
basePath: ""
format: "html"
}
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/qinglong
/framework
/Http
/Kernel.php
}
/**
* Send the given request through the middleware / router.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
protected function sendRequestThroughRouter($request)
{
$this -> app -> instance('request', $request);
Facade ::clearResolvedInstance('request');
$this -> bootstrap();
return (new Pipeline($this -> app))
-> send($request)
-> through($this -> app -> shouldSkipMiddleware() ? [] : $this -> middleware)
-> then($this -> dispatchToRouter());
}
/**
* laravel exception转换为qinglong exception
*
* @param Exception $exception
* @return Exception
*/
protected function convertToQinglongException(Exception $exception)
{
if (method_exists($this -> app[ExceptionHandler::class], 'convertToQinglongException')) {
$exception = $this -> app[ExceptionHandler::class] -> convertToQinglongException($exception);
}
return $exception;
}
}
Arguments
Closure($request) {#47 …5}
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/vendor
/qinglong
/framework
/Http
/Kernel.php
*
* @param Application $app
* @param Router $router
*/
public function __construct(Application $app, Router $router)
{
parent ::__construct($app, $router);
}
/**
* Handle an incoming HTTP request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function handle($request)
{
try {
$request -> enableHttpMethodParameterOverride();
$response = $this -> sendRequestThroughRouter($request);
} catch (Exception $e) {
$e = $this -> convertToQinglongException($e);
$this -> reportException($e);
$response = $this -> renderException($request, $e);
} catch (Throwable $e) {
$e = $this -> convertToQinglongException($e = new FatalThrowableError($e));
$this -> reportException($e);
$response = $this -> renderException($request, $e);
}
app('events') -> dispatch(new RequestHandled($request, $response));
return $response;
}
/**
* Send the given request through the middleware / router.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
Arguments
Request {#49
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: ParameterBag {#51}
+request: ParameterBag {#57}
+query: ParameterBag {#57}
+server: ServerBag {#53}
+files: FileBag {#54}
+cookies: ParameterBag {#52}
+headers: HeaderBag {#55}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/"
requestUri: "/"
baseUrl: ""
basePath: ""
format: "html"
}
/home
/yfdisk
/wwwroot
/dev.taojibao.cn
/www
/index.php
*/
$app = require_once __DIR__.'/../common/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app -> make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel -> handle(
$request = Illuminate\Http\Request ::capture()
);
$response -> send();
$kernel -> terminate($request, $response);
Arguments
Request {#49
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: ParameterBag {#51}
+request: ParameterBag {#57}
+query: ParameterBag {#57}
+server: ServerBag {#53}
+files: FileBag {#54}
+cookies: ParameterBag {#52}
+headers: HeaderBag {#55}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/"
requestUri: "/"
baseUrl: ""
basePath: ""
format: "html"
}