当前位置: 首页>>代码示例>>PHP>>正文


PHP Facade::clearResolvedInstance方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\Facade::clearResolvedInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Facade::clearResolvedInstance方法的具体用法?PHP Facade::clearResolvedInstance怎么用?PHP Facade::clearResolvedInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\Facade的用法示例。


在下文中一共展示了Facade::clearResolvedInstance方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendRequestThroughRouter

 /**
  * 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->middleware)->then($this->dispatchToRouter());
 }
开发者ID:fparralejo,项目名称:btrabajo,代码行数:13,代码来源:Kernel.php

示例2: sendRequestThroughRouter

 /**
  * 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();
     // If administration panel is attempting to be displayed,
     // we don't need any response
     if (is_admin()) {
         return;
     }
     // Get response on `template_include` filter so the conditional functions work correctly
     add_filter('template_include', function ($template) use($request) {
         // If the template is not index.php, then don't output anything
         if ($template !== get_template_directory() . '/index.php') {
             return $template;
         }
         try {
             $response = (new Pipeline($this->app))->send($request)->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)->then($this->dispatchToRouter());
         } 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']->fire('kernel.handled', [$request, $response]);
         return $template;
     }, PHP_INT_MAX);
 }
开发者ID:laraish,项目名称:framework,代码行数:36,代码来源:Kernel.php

示例3: sendRequestThroughRouter

 /**
  * 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();
     $shouldSkipMiddleware = $this->app->bound('middleware.disable') && $this->app->make('middleware.disable') === true;
     return (new Pipeline($this->app))->send($request)->through($shouldSkipMiddleware ? [] : $this->middleware)->then($this->dispatchToRouter());
 }
开发者ID:hilmysyarif,项目名称:sisfito,代码行数:14,代码来源:Kernel.php

示例4: setUp

 public function setUp()
 {
     parent::setUp();
     // reset configs
     Facade::clearResolvedInstance('reactjs');
     $this->app['config']->set('basepath', '');
     $this->app['config']->set('react_src', '');
     $this->app['config']->set('src_files', []);
     $this->app['config']->set('react_prefix', '');
     $this->app['config']->set('components_prefix', '');
 }
开发者ID:sirvo,项目名称:laravel-reactjs,代码行数:11,代码来源:ReactJSTest.php

示例5: __construct

 /**
  * Create do provider.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  */
 public function __construct($app)
 {
     parent::__construct($app);
     // Trocar instancias
     foreach ($this->instances as $provider => $classServiceProvider) {
         // Limpar facade
         Facade::clearResolvedInstance($provider);
         // Trocar / Criar
         $this->app->instance($provider, new $classServiceProvider($app));
     }
 }
开发者ID:netforcews,项目名称:framework,代码行数:16,代码来源:ServiceProvider.php

示例6: onRequest

 public function onRequest($request, $response, $illuminate_request = false)
 {
     // for file system
     clearstatcache();
     if (config('laravoole.base_config.deal_with_public')) {
         if ($this->dealWithPublic($request, $response)) {
             return;
         }
     }
     try {
         $kernel = $this->kernel;
         if (!$illuminate_request) {
             $illuminate_request = $this->dealWithRequest($request);
         }
         $illuminate_response = $kernel->handle($illuminate_request);
         // Is gzip enabled and the client accept it?
         $accept_gzip = config('laravoole.base_config.gzip') && isset($request->header['Accept-Encoding']) && stripos($request->header['Accept-Encoding'], 'gzip') !== false;
         $this->dealWithResponse($response, $illuminate_response, $accept_gzip);
     } catch (\Exception $e) {
         echo '[ERR] ' . $e->getFile() . '(' . $e->getLine() . '): ' . $e->getMessage() . PHP_EOL;
         echo $e->getTraceAsString() . PHP_EOL;
     } catch (\Throwable $e) {
         echo '[ERR] ' . $e->getFile() . '(' . $e->getLine() . '): ' . $e->getMessage() . PHP_EOL;
         echo $e->getTraceAsString() . PHP_EOL;
     } finally {
         if (isset($illuminate_response)) {
             $kernel->terminate($illuminate_request, $illuminate_response);
         }
         if ($illuminate_request->hasSession()) {
             $illuminate_request->getSession()->clear();
         }
         if ($this->app->isProviderLoaded(\Illuminate\Auth\AuthServiceProvider::class)) {
             $this->app->register(\Illuminate\Auth\AuthServiceProvider::class, [], true);
             Facade::clearResolvedInstance('auth');
         }
         return $response;
     }
 }
开发者ID:acabin,项目名称:laravoole,代码行数:38,代码来源:Base.php

示例7: refreshRequest

 /**
  * Refresh the bound request instance in the container.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return void
  */
 protected function refreshRequest(Request $request)
 {
     $this->instance('request', $request);
     Facade::clearResolvedInstance('request');
 }
开发者ID:jordone,项目名称:diyonline,代码行数:11,代码来源:Application.php

示例8: init

 /**
  * Send the given request through the middleware / router.
  *
  * @param  \Illuminate\Http\Request $request
  *
  * @return \Illuminate\Http\Response
  */
 public function init($request)
 {
     $this->app->instance('request', $request);
     Facade::clearResolvedInstance('request');
     $this->bootstrap();
 }
开发者ID:lara-press,项目名称:framework,代码行数:13,代码来源:Kernel.php

示例9: handle

 /**
  * Handle the given request and get the response.
  *
  * Provides compatibility with BrowserKit functional testing.
  *
  * @implements HttpKernelInterface::handle
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int   $type
  * @param  bool  $catch
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function handle(SymfonyRequest $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
 {
     $this->instance('request', $request);
     Facade::clearResolvedInstance('request');
     return $this->dispatch($request);
 }
开发者ID:farhan4648gul,项目名称:hercules-cp-laravel,代码行数:18,代码来源:Application.php

示例10: injectRequest

 protected function injectRequest(CmsRequest $request)
 {
     $this->app->instance('request', $request);
     Facade::clearResolvedInstance('request');
 }
开发者ID:realholgi,项目名称:cmsable,代码行数:5,代码来源:CmsRequestInjector.php


注:本文中的Illuminate\Support\Facades\Facade::clearResolvedInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。