protected $excludedIPs = [];
/**
* Constructor.
*
* @param \Illuminate\Contracts\Foundation\Application $app
*/
public function __construct(Application $app)
{
/* application */
$this->app = $app;
/* current channel */
$this->channel = core()->getCurrentChannel();
/* adding exception for admin routes */
$this->except[] = env('APP_ADMIN_URL', 'admin') . '*';
/* adding exception for ips */
$this->excludedIPs = array_map('trim', explode(',', $this->channel->allowed_ips));
}
/**
* Check for the except routes.
*
* @param \Illuminate\Http\Request $request
* @return boolean
*/
protected function shouldPassThrough($request)
{
foreach ($this->except as $except) {
if ($except !== '/') {
$except = trim($except, '/');
}
if ($request->is($except)) {
return true;
}
}
Arguments
"Trying to get property 'allowed_ips' of non-object"
protected $excludedIPs = [];
/**
* Constructor.
*
* @param \Illuminate\Contracts\Foundation\Application $app
*/
public function __construct(Application $app)
{
/* application */
$this->app = $app;
/* current channel */
$this->channel = core()->getCurrentChannel();
/* adding exception for admin routes */
$this->except[] = env('APP_ADMIN_URL', 'admin') . '*';
/* adding exception for ips */
$this->excludedIPs = array_map('trim', explode(',', $this->channel->allowed_ips));
}
/**
* Check for the except routes.
*
* @param \Illuminate\Http\Request $request
* @return boolean
*/
protected function shouldPassThrough($request)
{
foreach ($this->except as $except) {
if ($except !== '/') {
$except = trim($except, '/');
}
if ($request->is($except)) {
return true;
}
}
Arguments
8
"Trying to get property 'allowed_ips' of non-object"
"/www/wwwroot/www.cn111.net/packages/Webkul/Core/src/Http/Middleware/CheckForMaintenanceMode.php"
59
array:1 [
"app" => Illuminate\Foundation\Application {#4}
]
Arguments
Illuminate\Foundation\Application {#4}
return new $concrete;
}
$dependencies = $constructor->getParameters();
// Once we have all the constructor's parameters we can create each of the
// dependency instances and then use the reflection instances to make a
// new instance of this class, injecting the created dependencies in.
try {
$instances = $this->resolveDependencies($dependencies);
} catch (BindingResolutionException $e) {
array_pop($this->buildStack);
throw $e;
}
array_pop($this->buildStack);
return $reflector->newInstanceArgs($instances);
}
/**
* Resolve all of the dependencies from the ReflectionParameters.
*
* @param \ReflectionParameter[] $dependencies
* @return array
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
protected function resolveDependencies(array $dependencies)
{
$results = [];
foreach ($dependencies as $dependency) {
// If the dependency has an override for this particular build we will use
// that instead as the value. Otherwise, we will continue with this run
// of resolutions and let reflection attempt to determine the result.
if ($this->hasParameterOverride($dependency)) {
$results[] = $this->getParameterOverride($dependency);
Arguments
array:1 [
0 => Illuminate\Foundation\Application {#4}
]
$needsContextualBuild = ! empty($parameters) || ! is_null($concrete);
// If an instance of the type is currently being managed as a singleton we'll
// just return an existing instance instead of instantiating new instances
// so the developer can keep using the same objects instance every time.
if (isset($this->instances[$abstract]) && ! $needsContextualBuild) {
return $this->instances[$abstract];
}
$this->with[] = $parameters;
if (is_null($concrete)) {
$concrete = $this->getConcrete($abstract);
}
// We're ready to instantiate an instance of the concrete type registered for
// the binding. This will instantiate the types, as well as resolve any of
// its "nested" dependencies recursively until all have gotten resolved.
if ($this->isBuildable($concrete, $abstract)) {
$object = $this->build($concrete);
} else {
$object = $this->make($concrete);
}
// If we defined any extenders for this type, we'll need to spin through them
// and apply them to the object being built. This allows for the extension
// of services, such as changing configuration or decorating the object.
foreach ($this->getExtenders($abstract) as $extender) {
$object = $extender($object, $this);
}
// If the requested type is registered as a singleton we'll want to cache off
// the instances in "memory" so we can return it later without creating an
// entirely new instance of an object on each subsequent request for it.
if ($this->isShared($abstract) && ! $needsContextualBuild) {
$this->instances[$abstract] = $object;
}
if ($raiseEvents) {
$this->fireResolvingCallbacks($abstract, $object);
Arguments
"Webkul\Core\Http\Middleware\CheckForMaintenanceMode"
public function make($abstract, array $parameters = [])
{
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));
return parent::make($abstract, $parameters);
}
/**
* Resolve the given type from the container.
*
* @param string $abstract
* @param array $parameters
* @param bool $raiseEvents
* @return mixed
*/
protected function resolve($abstract, $parameters = [], $raiseEvents = true)
{
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));
return parent::resolve($abstract, $parameters, $raiseEvents);
}
/**
* Load the deferred provider if the given type is a deferred service and the instance has not been loaded.
*
* @param string $abstract
* @return void
*/
protected function loadDeferredProviderIfNeeded($abstract)
{
if ($this->isDeferredService($abstract) && ! isset($this->instances[$abstract])) {
$this->loadDeferredProvider($abstract);
}
}
/**
* Determine if the given abstract type has been bound.
*
* @param string $abstract
* @return bool
Arguments
"Webkul\Core\Http\Middleware\CheckForMaintenanceMode"
[]
true
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function makeWith($abstract, array $parameters = [])
{
return $this->make($abstract, $parameters);
}
/**
* Resolve the given type from the container.
*
* @param string $abstract
* @param array $parameters
* @return mixed
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function make($abstract, array $parameters = [])
{
return $this->resolve($abstract, $parameters);
}
/**
* {@inheritdoc}
*/
public function get($id)
{
try {
return $this->resolve($id);
} catch (Exception $e) {
if ($this->has($id)) {
throw $e;
}
throw new EntryNotFoundException($id, $e->getCode(), $e);
}
}
/**
* Resolve the given type from the container.
Arguments
"Webkul\Core\Http\Middleware\CheckForMaintenanceMode"
[]
if (! $this->isBooted()) {
$this->booting(function () use ($instance) {
$this->bootProvider($instance);
});
}
}
/**
* Resolve the given type from the container.
*
* @param string $abstract
* @param array $parameters
* @return mixed
*/
public function make($abstract, array $parameters = [])
{
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));
return parent::make($abstract, $parameters);
}
/**
* Resolve the given type from the container.
*
* @param string $abstract
* @param array $parameters
* @param bool $raiseEvents
* @return mixed
*/
protected function resolve($abstract, $parameters = [], $raiseEvents = true)
{
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));
return parent::resolve($abstract, $parameters, $raiseEvents);
}
/**
* Load the deferred provider if the given type is a deferred service and the instance has not been loaded.
*
Arguments
"Webkul\Core\Http\Middleware\CheckForMaintenanceMode"
[]
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
if (is_callable($pipe)) {
// If the pipe is a callable, then we will call it directly, but otherwise we
// will resolve the pipes out of the dependency container and call it with
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$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];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
Arguments
"Webkul\Core\Http\Middleware\CheckForMaintenanceMode"
public function via($method)
{
$this->method = $method;
return $this;
}
/**
* Run the pipeline with a final destination callback.
*
* @param \Closure $destination
* @return mixed
*/
public function then(Closure $destination)
{
$pipeline = array_reduce(
array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Run the pipeline and return the result.
*
* @return mixed
*/
public function thenReturn()
{
return $this->then(function ($passable) {
return $passable;
});
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
Arguments
Illuminate\Http\Request {#46
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: Symfony\Component\HttpFoundation\ParameterBag {#48}
+request: Symfony\Component\HttpFoundation\InputBag {#54}
+query: Symfony\Component\HttpFoundation\InputBag {#54}
+server: Symfony\Component\HttpFoundation\ServerBag {#50}
+files: Symfony\Component\HttpFoundation\FileBag {#51}
+cookies: Symfony\Component\HttpFoundation\InputBag {#49}
+headers: Symfony\Component\HttpFoundation\HeaderBag {#52}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/news/experience/2019/0329/71.html"
#requestUri: "/news/experience/2019/0329/71.html"
#baseUrl: ""
#basePath: null
#method: null
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-preferredFormat: null
-isHostValid: true
-isForwardedValid: true
-isSafeContentPreferred: null
basePath: ""
method: "GET"
format: "html"
}
}
/**
* 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) {#1082 …4}
public function __construct(Application $app, Router $router)
{
$this->app = $app;
$this->router = $router;
$this->syncMiddlewareToRouter();
}
/**
* 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 (Throwable $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
}
$this->app['events']->dispatch(
new RequestHandled($request, $response)
);
return $response;
}
/**
* Send the given request through the middleware / router.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
protected function sendRequestThroughRouter($request)
Arguments
Illuminate\Http\Request {#46
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: Symfony\Component\HttpFoundation\ParameterBag {#48}
+request: Symfony\Component\HttpFoundation\InputBag {#54}
+query: Symfony\Component\HttpFoundation\InputBag {#54}
+server: Symfony\Component\HttpFoundation\ServerBag {#50}
+files: Symfony\Component\HttpFoundation\FileBag {#51}
+cookies: Symfony\Component\HttpFoundation\InputBag {#49}
+headers: Symfony\Component\HttpFoundation\HeaderBag {#52}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/news/experience/2019/0329/71.html"
#requestUri: "/news/experience/2019/0329/71.html"
#baseUrl: ""
#basePath: null
#method: null
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-preferredFormat: null
-isHostValid: true
-isForwardedValid: true
-isSafeContentPreferred: null
basePath: ""
method: "GET"
format: "html"
}
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
Arguments
Illuminate\Http\Request {#46
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: Symfony\Component\HttpFoundation\ParameterBag {#48}
+request: Symfony\Component\HttpFoundation\InputBag {#54}
+query: Symfony\Component\HttpFoundation\InputBag {#54}
+server: Symfony\Component\HttpFoundation\ServerBag {#50}
+files: Symfony\Component\HttpFoundation\FileBag {#51}
+cookies: Symfony\Component\HttpFoundation\InputBag {#49}
+headers: Symfony\Component\HttpFoundation\HeaderBag {#52}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: "/news/experience/2019/0329/71.html"
#requestUri: "/news/experience/2019/0329/71.html"
#baseUrl: ""
#basePath: null
#method: null
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-preferredFormat: null
-isHostValid: true
-isForwardedValid: true
-isSafeContentPreferred: null
basePath: ""
method: "GET"
format: "html"
}