/data
/wwwroot
/kuaijiwenda
/vendor
/guzzlehttp
/guzzle
/src
/Handler
/CurlFactory.php
'An error was encountered during the on_headers event',
$easy->request,
$easy->response,
$easy->onHeadersException,
$ctx
)
);
}
$message = sprintf(
'cURL error %s: %s (%s)',
$ctx['errno'],
$ctx['error'],
'see http://curl.haxx.se/libcurl/c/libcurl-errors.html'
);
// Create a connection exception if it was a specific error code.
$error = isset($connectionErrors[$easy->errno])
? new ConnectException($message, $easy->request, null, $ctx)
: new RequestException($message, $easy->request, $easy->response, null, $ctx);
return \GuzzleHttp\Promise\rejection_for($error);
}
private function getDefaultConf(EasyHandle $easy)
{
$conf = [
'_headers' => $easy->request->getHeaders(),
CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
CURLOPT_RETURNTRANSFER => false,
CURLOPT_HEADER => false,
CURLOPT_CONNECTTIMEOUT => 150,
];
if (defined('CURLOPT_PROTOCOLS')) {
$conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
}
$version = $easy->request->getProtocolVersion();
Arguments
"cURL error 56: OpenSSL SSL_read: Connection reset by peer, errno 104 (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)"
/data
/wwwroot
/kuaijiwenda
/vendor
/guzzlehttp
/guzzle
/src
/Handler
/CurlFactory.php
private static function finishError(
callable $handler,
EasyHandle $easy,
CurlFactoryInterface $factory
) {
// Get error information and release the handle to the factory.
$ctx = [
'errno' => $easy->errno,
'error' => curl_error($easy->handle),
] + curl_getinfo($easy->handle);
$factory->release($easy);
// Retry when nothing is present or when curl failed to rewind.
if (empty($easy->options['_err_message'])
&& (!$easy->errno || $easy->errno == 65)
) {
return self::retryFailedRewind($handler, $easy, $ctx);
}
return self::createRejection($easy, $ctx);
}
private static function createRejection(EasyHandle $easy, array $ctx)
{
static $connectionErrors = [
CURLE_OPERATION_TIMEOUTED => true,
CURLE_COULDNT_RESOLVE_HOST => true,
CURLE_COULDNT_CONNECT => true,
CURLE_SSL_CONNECT_ERROR => true,
CURLE_GOT_NOTHING => true,
];
// If an exception was encountered during the onHeaders event, then
// return a rejected promise that wraps that exception.
if ($easy->onHeadersException) {
return \GuzzleHttp\Promise\rejection_for(
new RequestException(
'An error was encountered during the on_headers event',
$easy->request,
$easy->response,
Arguments
EasyHandle {#2885}
array:28 [
"errno" => 56
"error" => "OpenSSL SSL_read: Connection reset by peer, errno 104"
"url" => "https://i.kuaiji.com/api/v1/materials/cateGetCodeId?category=zhognjizhicheng&type=ask"
"content_type" => null
"http_code" => 0
"header_size" => 0
"request_size" => 187
"filetime" => -1
"ssl_verify_result" => 0
"redirect_count" => 0
"total_time" => 3.098226
"namelookup_time" => 0.001388
"connect_time" => 0.003227
"pretransfer_time" => 0.016627
"size_upload" => 0.0
"size_download" => 0.0
"speed_download" => 0.0
"speed_upload" => 0.0
"download_content_length" => -1.0
"upload_content_length" => 0.0
"starttransfer_time" => 0.0
"redirect_time" => 0.0
"redirect_url" => ""
"primary_ip" => "43.141.49.12"
"certinfo" => []
"primary_port" => 443
"local_ip" => "11.0.0.6"
"local_port" => 33560
]
/data
/wwwroot
/kuaijiwenda
/vendor
/guzzlehttp
/guzzle
/src
/Handler
/CurlFactory.php
* Completes a cURL transaction, either returning a response promise or a
* rejected promise.
*
* @param callable $handler
* @param EasyHandle $easy
* @param CurlFactoryInterface $factory Dictates how the handle is released
*
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public static function finish(
callable $handler,
EasyHandle $easy,
CurlFactoryInterface $factory
) {
if (isset($easy->options['on_stats'])) {
self::invokeStats($easy);
}
if (!$easy->response || $easy->errno) {
return self::finishError($handler, $easy, $factory);
}
// Return the response if it is present and there is no error.
$factory->release($easy);
// Rewind the body of the response if possible.
$body = $easy->response->getBody();
if ($body->isSeekable()) {
$body->rewind();
}
return new FulfilledPromise($easy->response);
}
private static function invokeStats(EasyHandle $easy)
{
$curlStats = curl_getinfo($easy->handle);
$stats = new TransferStats(
$easy->request,
$easy->response,
Arguments
/data
/wwwroot
/kuaijiwenda
/vendor
/guzzlehttp
/guzzle
/src
/Handler
/CurlMultiHandler.php
private function processMessages()
{
while ($done = curl_multi_info_read($this->_mh)) {
$id = (int) $done['handle'];
curl_multi_remove_handle($this->_mh, $done['handle']);
if (!isset($this->handles[$id])) {
// Probably was cancelled.
continue;
}
$entry = $this->handles[$id];
unset($this->handles[$id], $this->delays[$id]);
$entry['easy']->errno = $done['result'];
$entry['deferred']->resolve(
CurlFactory::finish(
$this,
$entry['easy'],
$this->factory
)
);
}
}
private function timeToNext()
{
$currentTime = microtime(true);
$nextTime = PHP_INT_MAX;
foreach ($this->delays as $time) {
if ($time < $nextTime) {
$nextTime = $time;
}
}
return max(0, $nextTime - $currentTime) * 1000000;
}
}
Arguments
/data
/wwwroot
/kuaijiwenda
/vendor
/guzzlehttp
/guzzle
/src
/Handler
/CurlMultiHandler.php
$this->handles[$id]['easy']->handle
);
}
}
}
// Step through the task queue which may add additional requests.
P\queue()->run();
if ($this->active &&
curl_multi_select($this->_mh, $this->selectTimeout) === -1
) {
// Perform a usleep if a select returns -1.
// See: https://bugs.php.net/bug.php?id=61141
usleep(250);
}
while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);
$this->processMessages();
}
/**
* Runs until all outstanding connections have completed.
*/
public function execute()
{
$queue = P\queue();
while ($this->handles || !$queue->isEmpty()) {
// If there are no transfers, then sleep for the next delay
if (!$this->active && $this->delays) {
usleep($this->timeToNext());
}
$this->tick();
}
}
private function addRequest(array $entry)
{
/data
/wwwroot
/kuaijiwenda
/vendor
/guzzlehttp
/guzzle
/src
/Handler
/CurlMultiHandler.php
}
while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);
$this->processMessages();
}
/**
* Runs until all outstanding connections have completed.
*/
public function execute()
{
$queue = P\queue();
while ($this->handles || !$queue->isEmpty()) {
// If there are no transfers, then sleep for the next delay
if (!$this->active && $this->delays) {
usleep($this->timeToNext());
}
$this->tick();
}
}
private function addRequest(array $entry)
{
$easy = $entry['easy'];
$id = (int) $easy->handle;
$this->handles[$id] = $entry;
if (empty($easy->options['delay'])) {
curl_multi_add_handle($this->_mh, $easy->handle);
} else {
$this->delays[$id] = microtime(true) + ($easy->options['delay'] / 1000);
}
}
/**
* Cancels a handle from sending and removes references to it.
*
* @param int $id Handle ID to cancel and remove.
*
/data
/wwwroot
/kuaijiwenda
/vendor
/guzzlehttp
/promises
/src
/Promise.php
// If there's not wait function, then reject the promise.
$this->reject('Cannot wait on a promise that has '
. 'no internal wait function. You must provide a wait '
. 'function when constructing the promise to be able to '
. 'wait on a promise.');
}
queue()->run();
if ($this->state === self::PENDING) {
$this->reject('Invoking the wait callback did not resolve the promise');
}
}
private function invokeWaitFn()
{
try {
$wfn = $this->waitFn;
$this->waitFn = null;
$wfn(true);
} catch (\Exception $reason) {
if ($this->state === self::PENDING) {
// The promise has not been resolved yet, so reject the promise
// with the exception.
$this->reject($reason);
} else {
// The promise was already resolved, so there's a problem in
// the application.
throw $reason;
}
}
}
private function invokeWaitList()
{
$waitList = $this->waitList;
$this->waitList = null;
foreach ($waitList as $result) {
while (true) {
Arguments
/data
/wwwroot
/kuaijiwenda
/vendor
/guzzlehttp
/promises
/src
/Promise.php
} elseif ($index === 1) {
// Forward resolution values as-is.
$promise->resolve($value);
} else {
// Forward rejections down the chain.
$promise->reject($value);
}
} catch (\Throwable $reason) {
$promise->reject($reason);
} catch (\Exception $reason) {
$promise->reject($reason);
}
}
private function waitIfPending()
{
if ($this->state !== self::PENDING) {
return;
} elseif ($this->waitFn) {
$this->invokeWaitFn();
} elseif ($this->waitList) {
$this->invokeWaitList();
} else {
// If there's not wait function, then reject the promise.
$this->reject('Cannot wait on a promise that has '
. 'no internal wait function. You must provide a wait '
. 'function when constructing the promise to be able to '
. 'wait on a promise.');
}
queue()->run();
if ($this->state === self::PENDING) {
$this->reject('Invoking the wait callback did not resolve the promise');
}
}
private function invokeWaitFn()
{
try {
/data
/wwwroot
/kuaijiwenda
/vendor
/guzzlehttp
/promises
/src
/Promise.php
if ($this->state === self::PENDING) {
// The promise has not been resolved yet, so reject the promise
// with the exception.
$this->reject($reason);
} else {
// The promise was already resolved, so there's a problem in
// the application.
throw $reason;
}
}
}
private function invokeWaitList()
{
$waitList = $this->waitList;
$this->waitList = null;
foreach ($waitList as $result) {
while (true) {
$result->waitIfPending();
if ($result->result instanceof Promise) {
$result = $result->result;
} else {
if ($result->result instanceof PromiseInterface) {
$result->result->wait(false);
}
break;
}
}
}
}
}
/data
/wwwroot
/kuaijiwenda
/vendor
/guzzlehttp
/promises
/src
/Promise.php
$promise->resolve($value);
} else {
// Forward rejections down the chain.
$promise->reject($value);
}
} catch (\Throwable $reason) {
$promise->reject($reason);
} catch (\Exception $reason) {
$promise->reject($reason);
}
}
private function waitIfPending()
{
if ($this->state !== self::PENDING) {
return;
} elseif ($this->waitFn) {
$this->invokeWaitFn();
} elseif ($this->waitList) {
$this->invokeWaitList();
} else {
// If there's not wait function, then reject the promise.
$this->reject('Cannot wait on a promise that has '
. 'no internal wait function. You must provide a wait '
. 'function when constructing the promise to be able to '
. 'wait on a promise.');
}
queue()->run();
if ($this->state === self::PENDING) {
$this->reject('Invoking the wait callback did not resolve the promise');
}
}
private function invokeWaitFn()
{
try {
$wfn = $this->waitFn;
$this->waitFn = null;
/data
/wwwroot
/kuaijiwenda
/vendor
/guzzlehttp
/promises
/src
/Promise.php
if ($this->state === self::FULFILLED) {
return $onFulfilled
? promise_for($this->result)->then($onFulfilled)
: promise_for($this->result);
}
// It's either cancelled or rejected, so return a rejected promise
// and immediately invoke any callbacks.
$rejection = rejection_for($this->result);
return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
}
public function otherwise(callable $onRejected)
{
return $this->then(null, $onRejected);
}
public function wait($unwrap = true)
{
$this->waitIfPending();
$inner = $this->result instanceof PromiseInterface
? $this->result->wait($unwrap)
: $this->result;
if ($unwrap) {
if ($this->result instanceof PromiseInterface
|| $this->state === self::FULFILLED
) {
return $inner;
} else {
// It's rejected so "unwrap" and throw an exception.
throw exception_for($inner);
}
}
}
public function getState()
{
return $this->state;
/data
/wwwroot
/kuaijiwenda
/app
/Services
/CodeService.php
* 通过直属上级分类,获取关联的活码id,传给小程序二维码参数
* @param $category_id
* @return int
*/
public function cateFindCodeId($category_id)
{
$parent_category_one = Category::findFromCache($category_id);
$codeParam = [
'category' => !empty($parent_category_one) ? $parent_category_one->slug : '',
'type' => 'ask',//活码关联问答类型
];
$str = http_build_query($codeParam);
$client = new \GuzzleHttp\Client();
$headers = [
'Content-Type' => 'application/json'
];
$url = UCENTER_URL . '/api/v1/materials/cateGetCodeId?' . $str;
$request = new Req('GET', $url, $headers, '');
$response = $client->sendAsync($request)->wait();
$result = $response->getBody()->getContents();
$res = json_decode($result, true);
$codeId = isTestEnv() ? 5 : 26;//默认活码
if ($response->getStatusCode() == 200) {
if ($res['code'] == 0 && !empty($res['data']) && isset($res['data']['setting_code'])) {
$codeId = $res['data']['setting_code'];
}
}
return $codeId;
}
}
/data
/wwwroot
/kuaijiwenda
/app
/Http
/Controllers
/Ask
/QuestionController.php
// $commentList
// );
// if (Auth()->check()) {
// $loginUser = Auth()->user();
// //是否收藏
// $questionData['is_collected'] = false;
// if ($loginUser->isCollected(get_class($question), $question->id)) {
// $questionData['is_collected'] = true;
// }
// //是否赞过
// $questionData['is_supported'] = $loginUser->isSupported(get_class($question), $question->id);
// }
//上级分类面包屑+自己
$parentCategories = Category::getParentCategories($question->category_id);
//通过直属上级分类,获取关联的活码id,传给小程序二维码参数
$codeId = (new CodeService())->cateFindCodeId($question->category_id);
//右侧推荐数据
$newestZhuanyewenda = BlockService::html('newest_zywd');
$newestTags = BlockService::html('newest_tags');
//$newestTeacher = BlockService::html('newest_teacher');
$newestTeacherQuestions = BlockService::html('newest_teacher_question');
$newestNews = BlockService::html('newest_news');
//精选问题&&最新问题
$newestAboutQuestion = BlockService::html('newest_about_question');
//搜索的相关问题
$searchNews = [];
$searchQuestions = [];
if (!isDevelopEnv()) {//非本地环境才搜索
try {
$searchKeyword = !empty($question->title) ? $question->title : '会计';
$pcSearchService = new PcSearchService();
$searchNews = $pcSearchService->getSearchNews($searchKeyword, 1, 20)['dataList'];
$searchQuestions = $pcSearchService->getSearchQuestion($searchKeyword, 1, 3)['dataList'];
} catch (\Exception $e) {
Arguments
/data
/wwwroot
/kuaijiwenda
/app
/Http
/Controllers
/Controller.php
* @param $sourceId
*/
public function setUniqueParams($userId, $action, $sourceType, $sourceId)
{
$this->uniqueParams = [
'userId' => $userId,
'action' => $action,
'sourceType' => $sourceType,
'sourceId' => $sourceId,
];
}
/**
* @param string $method
* @param array $parameters
* @return mixed|\Symfony\Component\HttpFoundation\Response
*/
public function callAction($method, $parameters)
{
$return = call_user_func_array([$this, $method], $parameters);
call_user_func_array([$this, 'afterAction'], ['method' => $method]);
return $return;
}
/**
* @param $method
*/
public function afterAction($method)
{
//积分
IntegrationQueueService::push($this, $method, $this->uniqueParams);
}
/**
* 操作成功提示
* @param $url string
* @param $message 消息内容
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
protected function success($url, $message, $intended = false)
Arguments
3829
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/app
/Http
/Controllers
/Controller.php
* @param $sourceId
*/
public function setUniqueParams($userId, $action, $sourceType, $sourceId)
{
$this->uniqueParams = [
'userId' => $userId,
'action' => $action,
'sourceType' => $sourceType,
'sourceId' => $sourceId,
];
}
/**
* @param string $method
* @param array $parameters
* @return mixed|\Symfony\Component\HttpFoundation\Response
*/
public function callAction($method, $parameters)
{
$return = call_user_func_array([$this, $method], $parameters);
call_user_func_array([$this, 'afterAction'], ['method' => $method]);
return $return;
}
/**
* @param $method
*/
public function afterAction($method)
{
//积分
IntegrationQueueService::push($this, $method, $this->uniqueParams);
}
/**
* 操作成功提示
* @param $url string
* @param $message 消息内容
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
protected function success($url, $message, $intended = false)
Arguments
array:2 [
0 => QuestionController {#2480}
1 => "question_detail"
]
array:2 [
"id" => 3829
0 => Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
]
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/ControllerDispatcher.php
{
$this->container = $container;
}
/**
* Dispatch a request to a given controller and method.
*
* @param \Illuminate\Routing\Route $route
* @param mixed $controller
* @param string $method
* @return mixed
*/
public function dispatch(Route $route, $controller, $method)
{
$parameters = $this->resolveClassMethodDependencies(
$route->parametersWithoutNulls(), $controller, $method
);
if (method_exists($controller, 'callAction')) {
return $controller->callAction($method, $parameters);
}
return $controller->{$method}(...array_values($parameters));
}
/**
* Get the middleware for the controller instance.
*
* @param \Illuminate\Routing\Controller $controller
* @param string $method
* @return array
*/
public function getMiddleware($controller, $method)
{
if (! method_exists($controller, 'getMiddleware')) {
return [];
}
return collect($controller->getMiddleware())->reject(function ($data) use ($method) {
return static::methodExcludedByOptions($method, $data['options']);
Arguments
"question_detail"
array:2 [
"id" => 3829
0 => Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
]
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Route.php
protected function runCallable()
{
$callable = $this->action['uses'];
return $callable(...array_values($this->resolveMethodDependencies(
$this->parametersWithoutNulls(), new ReflectionFunction($this->action['uses'])
)));
}
/**
* Run the route action and return the response.
*
* @return mixed
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
protected function runController()
{
return $this->controllerDispatcher()->dispatch(
$this, $this->getController(), $this->getControllerMethod()
);
}
/**
* Get the controller instance for the route.
*
* @return mixed
*/
public function getController()
{
if (! $this->controller) {
$class = $this->parseControllerCallback()[0];
$this->controller = $this->container->make(ltrim($class, '\\'));
}
return $this->controller;
}
/**
Arguments
Route {#722}
QuestionController {#2480}
"question_detail"
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Route.php
*
* @throws \UnexpectedValueException
*/
protected function parseAction($action)
{
return RouteAction::parse($this->uri, $action);
}
/**
* Run the route action and return the response.
*
* @return mixed
*/
public function run()
{
$this->container = $this->container ?: new Container;
try {
if ($this->isControllerAction()) {
return $this->runController();
}
return $this->runCallable();
} catch (HttpResponseException $e) {
return $e->getResponse();
}
}
/**
* Checks whether the route's action is a controller.
*
* @return bool
*/
protected function isControllerAction()
{
return is_string($this->action['uses']);
}
/**
* Run the route action and return the response.
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
/**
* Run the given route within a Stack "onion" instance.
*
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @return mixed
*/
protected function runRouteWithinStack(Route $route, Request $request)
{
$shouldSkipMiddleware = $this->container->bound('middleware.disable') &&
$this->container->make('middleware.disable') === true;
$middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
return (new Pipeline($this->container))
->send($request)
->through($middleware)
->then(function ($request) use ($route) {
return $this->prepareResponse(
$request, $route->run()
);
});
}
/**
* Gather the middleware for the given route with resolved class names.
*
* @param \Illuminate\Routing\Route $route
* @return array
*/
public function gatherRouteMiddleware(Route $route)
{
$middleware = collect($route->gatherMiddleware())->map(function ($name) {
return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups);
})->flatten();
return $this->sortMiddleware($middleware);
}
/**
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
use Symfony\Component\Debug\Exception\FatalThrowableError;
/**
* This extended pipeline catches any exceptions that occur during each slice.
*
* The exceptions are converted to HTTP responses for proper middleware handling.
*/
class Pipeline extends BasePipeline
{
/**
* 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) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($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
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/app
/Http
/Middleware
/Hashid.php
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$this->decodeRequest($request);//解密post参数
$router = Route::current();
if ($router->hasParameters()) {//解密Parameter参数
$parameterNames = $router->parameterNames();
if (! empty($parameter)) {
foreach ($parameter as $v) {
$this->decodeParameter($router, $v);
}
} else {
foreach ($parameterNames as $v) {
$this->decodeParameter($router, $v);
}
}
}
return $next($request);
}
private function decodeParameter($router, $parameterName)
{
if ($router->hasParameter($parameterName)) {
if($parameterName == 'id' || $parameterName == 'source_id'){//只对id、source_id加密
$code = $router->parameter($parameterName);
if(question_decode($code)){
$router->setParameter($parameterName, question_decode($code)[0]);
}else{
abort(404);
}
}
}
}
private function decodeRequest(&$request){
if($request->question_id){
$id = question_decode($request->question_id)[0];
$request->offsetSet('question_id', $id);
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#2474 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Middleware
/SubstituteBindings.php
*/
public function __construct(Registrar $router)
{
$this->router = $router;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$this->router->substituteBindings($route = $request->route());
$this->router->substituteImplicitBindings($route);
return $next($request);
}
}
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#2739 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Middleware
/VerifyCsrfToken.php
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*
* @throws \Illuminate\Session\TokenMismatchException
*/
public function handle($request, Closure $next)
{
if (
$this->isReading($request) ||
$this->runningUnitTests() ||
$this->inExceptArray($request) ||
$this->tokensMatch($request)
) {
return $this->addCookieToResponse($request, $next($request));
}
throw new TokenMismatchException;
}
/**
* Determine if the HTTP request uses a ‘read’ verb.
*
* @param \Illuminate\Http\Request $request
* @return bool
*/
protected function isReading($request)
{
return in_array($request->method(), ['HEAD', 'GET', 'OPTIONS']);
}
/**
* Determine if the application is running unit tests.
*
* @return bool
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#2740 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/View
/Middleware
/ShareErrorsFromSession.php
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
// If the current session has an "errors" variable bound to it, we will share
// its value with all view instances so the views can easily access errors
// without having to bind. An empty bag is set when there aren't errors.
$this->view->share(
'errors', $request->session()->get('errors') ?: new ViewErrorBag
);
// Putting the errors in the view for every view allows the developer to just
// assume that some errors are always available, which is convenient since
// they don't have to continually run checks for the presence of errors.
return $next($request);
}
}
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#2741 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/app
/Http
/Middleware
/SyncUser.php
$role = $user->roles()->first();
if ($role && $role->slug != 'member' && !session()->has('user_permissions')) {
$permissions = $role->permissions()->pluck('slug')->toArray();
request()->session()->put('user_permissions', $permissions);
}
}
} else {
$this->logout();
}
} else {
// 微信浏览器静默登录
if (strpos($request->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false) {
$url = CMS_URL . '/' . $request->path() . '?' . http_build_query($request->all());
return redirect(UCENTER_URL . '/wechat/micro_messenger/auth?redirect=' . $url);
}
$this->logout();
}
return $next($request);
}
}
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#2742 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Cookie
/Middleware
/AddQueuedCookiesToResponse.php
* Create a new CookieQueue instance.
*
* @param \Illuminate\Contracts\Cookie\QueueingFactory $cookies
* @return void
*/
public function __construct(CookieJar $cookies)
{
$this->cookies = $cookies;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$response = $next($request);
foreach ($this->cookies->getQueuedCookies() as $cookie) {
$response->headers->setCookie($cookie);
}
return $response;
}
}
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#2743 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/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);
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
return $destination($passable);
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
*
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @return mixed
*/
protected function runRouteWithinStack(Route $route, Request $request)
{
$shouldSkipMiddleware = $this->container->bound('middleware.disable') &&
$this->container->make('middleware.disable') === true;
$middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
return (new Pipeline($this->container))
->send($request)
->through($middleware)
->then(function ($request) use ($route) {
return $this->prepareResponse(
$request, $route->run()
);
});
}
/**
* Gather the middleware for the given route with resolved class names.
*
* @param \Illuminate\Routing\Route $route
* @return array
*/
public function gatherRouteMiddleware(Route $route)
{
$middleware = collect($route->gatherMiddleware())->map(function ($name) {
return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups);
})->flatten();
return $this->sortMiddleware($middleware);
}
/**
* Sort the given middleware by priority.
*
Arguments
Closure($request) {#2469 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
return $route;
}
/**
* Return the response for the given route.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Routing\Route $route
* @return mixed
*/
protected function runRoute(Request $request, Route $route)
{
$request->setRouteResolver(function () use ($route) {
return $route;
});
$this->events->dispatch(new Events\RouteMatched($route, $request));
return $this->prepareResponse($request,
$this->runRouteWithinStack($route, $request)
);
}
/**
* Run the given route within a Stack "onion" instance.
*
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @return mixed
*/
protected function runRouteWithinStack(Route $route, Request $request)
{
$shouldSkipMiddleware = $this->container->bound('middleware.disable') &&
$this->container->make('middleware.disable') === true;
$middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
return (new Pipeline($this->container))
->send($request)
->through($middleware)
Arguments
Route {#722}
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/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 mixed
*/
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 {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Route {#722}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
* @return mixed
*/
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 mixed
*/
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 {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/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 {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
use Symfony\Component\Debug\Exception\FatalThrowableError;
/**
* This extended pipeline catches any exceptions that occur during each slice.
*
* The exceptions are converted to HTTP responses for proper middleware handling.
*/
class Pipeline extends BasePipeline
{
/**
* 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) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($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
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Session
/Middleware
/StartSession.php
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$this->sessionHandled = true;
// If a session driver has been configured, we will need to start the session here
// so that the data is ready for an application. Note that the Laravel sessions
// do not make use of PHP "native" sessions in any way since they are crappy.
if ($this->sessionConfigured()) {
$request->setLaravelSession(
$session = $this->startSession($request)
);
$this->collectGarbage($session);
}
$response = $next($request);
// Again, if the session has been configured we will need to close out the session
// so that the attributes may be persisted to some storage medium. We will also
// add the session identifier cookie to the application response headers now.
if ($this->sessionConfigured()) {
$this->storeCurrentUrl($request, $session);
$this->addCookieToResponse($response, $session);
}
return $response;
}
/**
* Perform any final actions for the request lifecycle.
*
* @param \Illuminate\Http\Request $request
* @param \Symfony\Component\HttpFoundation\Response $response
* @return void
*/
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#1230 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Cookie
/Middleware
/EncryptCookies.php
* Disable encryption for the given cookie name(s).
*
* @param string|array $name
* @return void
*/
public function disableFor($name)
{
$this->except = array_merge($this->except, (array) $name);
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return \Symfony\Component\HttpFoundation\Response
*/
public function handle($request, Closure $next)
{
return $this->encrypt($next($this->decrypt($request)));
}
/**
* Decrypt the cookies on the request.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* @return \Symfony\Component\HttpFoundation\Request
*/
protected function decrypt(Request $request)
{
foreach ($request->cookies as $key => $cookie) {
if ($this->isDisabled($key)) {
continue;
}
try {
$request->cookies->set($key, $this->decryptCookie($key, $cookie));
} catch (DecryptException $e) {
$request->cookies->set($key, null);
}
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#1060 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/app
/Http
/Middleware
/BanIpCheck.php
* @return mixed
*/
public function handle($request, Closure $next)
{
$ip = getUserRealIp($request);
$ips = Cache::rememberForever('ip_blacklist', function () {
if (!file_exists(storage_path('installed'))) {
return [];
}
return BanIp::all()->pluck('ip')->toArray();
});
if (Auth::check() && !Auth::user()->isSuperAdmin()) {
if (in_array($ip, $ips)) {
abort('403');
return false;
}
}
return $next($request);
}
}
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#1061 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/app
/Http
/Middleware
/TrustProxies.php
{
/**
* The trusted proxies for this application.
*
* @var array
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
public function handle(Request $request, Closure $next)
{
$request->setTrustedProxies($request->getClientIps(), $this->headers);
return $next($request);
}
}
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#2406 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Middleware
/TransformsRequest.php
*
* @var array
*/
protected $attributes = [];
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param array ...$attributes
* @return mixed
*/
public function handle($request, Closure $next, ...$attributes)
{
$this->attributes = $attributes;
$this->clean($request);
return $next($request);
}
/**
* Clean the request's data.
*
* @param \Illuminate\Http\Request $request
* @return void
*/
protected function clean($request)
{
$this->cleanParameterBag($request->query);
if ($request->isJson()) {
$this->cleanParameterBag($request->json());
} else {
$this->cleanParameterBag($request->request);
}
}
/**
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#2407 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Middleware
/TransformsRequest.php
*
* @var array
*/
protected $attributes = [];
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param array ...$attributes
* @return mixed
*/
public function handle($request, Closure $next, ...$attributes)
{
$this->attributes = $attributes;
$this->clean($request);
return $next($request);
}
/**
* Clean the request's data.
*
* @param \Illuminate\Http\Request $request
* @return void
*/
protected function clean($request)
{
$this->cleanParameterBag($request->query);
if ($request->isJson()) {
$this->cleanParameterBag($request->json());
} else {
$this->cleanParameterBag($request->request);
}
}
/**
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#2408 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Middleware
/ValidatePostSize.php
class ValidatePostSize
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*
* @throws \Illuminate\Http\Exceptions\PostTooLargeException
*/
public function handle($request, Closure $next)
{
$max = $this->getPostMaxSize();
if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
throw new PostTooLargeException;
}
return $next($request);
}
/**
* Determine the server 'post_max_size' as bytes.
*
* @return int
*/
protected function getPostMaxSize()
{
if (is_numeric($postMaxSize = ini_get('post_max_size'))) {
return (int) $postMaxSize;
}
$metric = strtoupper(substr($postMaxSize, -1));
$postMaxSize = (int) $postMaxSize;
switch ($metric) {
case 'K':
return $postMaxSize * 1024;
case 'M':
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#2409 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Middleware
/CheckForMaintenanceMode.php
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
*/
public function handle($request, Closure $next)
{
if ($this->app->isDownForMaintenance()) {
$data = json_decode(file_get_contents($this->app->storagePath().'/framework/down'), true);
if (isset($data['allowed']) && IpUtils::checkIp($request->ip(), (array) $data['allowed'])) {
return $next($request);
}
if ($this->inExceptArray($request)) {
return $next($request);
}
throw new MaintenanceModeException($data['time'], $data['retry'], $data['message']);
}
return $next($request);
}
/**
* Determine if the request has a URI that should be accessible in maintenance mode.
*
* @param \Illuminate\Http\Request $request
* @return bool
*/
protected function inExceptArray($request)
{
foreach ($this->except as $except) {
if ($except !== '/') {
$except = trim($except, '/');
}
if ($request->fullUrlIs($except) || $request->is($except)) {
return true;
}
}
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $response instanceof Responsable
? $response->toResponse($this->container->make(Request::class))
: $response;
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure($passable) {#2410 …6}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($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();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/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);
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
return $destination($passable);
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/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());
}
/**
* Bootstrap the application for HTTP requests.
*
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
* Get the route dispatcher callback.
*
* @return \Closure
*/
protected function dispatchToRouter()
Arguments
Closure($request) {#796 …5}
/data
/wwwroot
/kuaijiwenda
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Kernel.php
$router->middlewareGroup($key, $middleware);
}
foreach ($this->routeMiddleware as $key => $middleware) {
$router->aliasMiddleware($key, $middleware);
}
}
/**
* 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) {
$this->reportException($e);
$response = $this->renderException($request, $e);
} catch (Throwable $e) {
$this->reportException($e = new FatalThrowableError($e));
$response = $this->renderException($request, $e);
}
$this->app['events']->dispatch(
new Events\RequestHandled($request, $response)
);
return $response;
}
/**
* Send the given request through the middleware / router.
*
Arguments
Request {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/data
/wwwroot
/kuaijiwenda
/public
/index.php
//加载不同环境env
$app->loadEnvironmentFrom(ENV_FILE);
/*
|--------------------------------------------------------------------------
| 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 {#1219
#json: null
#convertedFiles: []
#userResolver: Closure($guard = null) {#2470 …6}
#routeResolver: Closure() {#2464 …5}
+attributes: ParameterBag {#1217}
+request: ParameterBag {#1211}
+query: ParameterBag {#1211}
+server: ServerBag {#1215}
+files: FileBag {#1214}
+cookies: ParameterBag {#1216}
+headers: HeaderBag {#1213}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/ask/q72003829.html"
#requestUri: "/ask/q72003829.html"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: Store {#2459}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}