當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Request::enableHttpMethodParameterOverride方法代碼示例

本文整理匯總了PHP中Illuminate\Http\Request::enableHttpMethodParameterOverride方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::enableHttpMethodParameterOverride方法的具體用法?PHP Request::enableHttpMethodParameterOverride怎麽用?PHP Request::enableHttpMethodParameterOverride使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Http\Request的用法示例。


在下文中一共展示了Request::enableHttpMethodParameterOverride方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadCompiledAndInitSth

 protected function loadCompiledAndInitSth()
 {
     if (file_exists($this->compiledPath)) {
         require $this->compiledPath;
     }
     // removed from Illuminate\Foundation\Http\Kernel::handle
     \Illuminate\Http\Request::enableHttpMethodParameterOverride();
 }
開發者ID:kttis,項目名稱:LaravelFly,代碼行數:8,代碼來源:LaravelFlyServer.php

示例2: onWorkerStart

 public function onWorkerStart($serv, $worker_id)
 {
     //創建laravel內核(把該邏輯放在此處,確保所有worker創建前父進程副本與laravel無關,令laravel具備熱部署特性)
     require __DIR__ . '/../bootstrap/autoload.php';
     $app = (require __DIR__ . '/../bootstrap/app.php');
     $this->laravel_kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
     //開啟“方法欺騙”特性,與laravel5.1 LTS保持一致
     Illuminate\Http\Request::enableHttpMethodParameterOverride();
 }
開發者ID:nosun,項目名稱:swala,代碼行數:9,代碼來源:Server.php

示例3: handle

 /**
  * 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);
     }
     $this->app['events']->fire('kernel.handled', [$request, $response]);
     return $response;
 }
開發者ID:nsoimaru,項目名稱:Laravel51-starter,代碼行數:18,代碼來源:Kernel.php

示例4: bootstrap

 public static function bootstrap($errorCallbacks)
 {
     // Only bootstrap once.
     if (static::$bootstrapped) {
         return;
     }
     // Load helper functions.
     require_once __DIR__ . '/../../../illuminate/support/Illuminate/Support/helpers.php';
     // Directories.
     $basePath = str_finish(realpath(__DIR__ . '/..'), '/');
     $controllersDirectory = $basePath . 'Controllers';
     $modelsDirectory = $basePath . 'Models';
     // Register the autoloader and add directories.
     ClassLoader::register();
     ClassLoader::addDirectories(array($controllersDirectory, $modelsDirectory));
     // Instantiate the container.
     $app = new Container();
     static::$container = $app;
     // Tell facade about the application instance.
     Facade::setFacadeApplication($app);
     // Register application instance with container
     $app['app'] = $app;
     // Set environment.
     $app['env'] = 'production';
     // Enable HTTP Method Override.
     Request::enableHttpMethodParameterOverride();
     // Create the request.
     $app['request'] = Request::createFromGlobals();
     // Register services.
     with(new EventServiceProvider($app))->register();
     with(new RoutingServiceProvider($app))->register();
     // Register aliases.
     foreach (static::$aliases as $alias => $class) {
         class_alias($class, $alias);
     }
     // Load the routes file if it exists.
     if (file_exists($basePath . 'routes.php')) {
         require_once $basePath . 'routes.php';
     }
     // Dispatch on shutdown.
     register_shutdown_function('Seytar\\Routing\\Router::dispatch', $errorCallbacks);
     // Mark bootstrapped.
     static::$bootstrapped = true;
 }
開發者ID:seytar,項目名稱:php-router,代碼行數:44,代碼來源:Router.php

示例5: createApplication

 /**
  * Creates the application.
  *
  * Needs to be implemented by subclasses.
  *
  * @return \Symfony\Component\HttpKernel\HttpKernelInterface
  */
 public function createApplication()
 {
     $app = new Application();
     $app->detectEnvironment(array('local' => array('your-machine-name')));
     $app->bindInstallPaths($this->getApplicationPaths());
     $app['env'] = 'testing';
     $app->instance('app', $app);
     Facade::clearResolvedInstances();
     Facade::setFacadeApplication($app);
     $app->registerCoreContainerAliases();
     with($envVariables = new EnvironmentVariables($app->getEnvironmentVariablesLoader()))->load($app['env']);
     $app->instance('config', $config = new Repository($app->getConfigLoader(), $app['env']));
     $app->startExceptionHandling();
     date_default_timezone_set($this->getApplicationTimezone());
     $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases());
     AliasLoader::getInstance($aliases)->register();
     Request::enableHttpMethodParameterOverride();
     $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders());
     $app->getProviderRepository()->load($app, $providers);
     $this->registerBootedCallback($app);
     return $app;
 }
開發者ID:arwinjp,項目名稱:ODTS,代碼行數:29,代碼來源:TestCase.php

示例6: enableHttpMethodParameterOverride

 /**
  * Enables support for the _method request parameter to determine the intended HTTP method.
  * 
  * Be warned that enabling this feature might lead to CSRF issues in your code.
  * Check that you are using CSRF tokens when required.
  * If the HTTP method parameter override is enabled, an html-form with method "POST" can be altered
  * and used to send a "PUT" or "DELETE" request via the _method request parameter.
  * If these methods are not protected against CSRF, this presents a possible vulnerability.
  * 
  * The HTTP method can only be overridden when the real HTTP method is POST.
  *
  * @static 
  */
 public static function enableHttpMethodParameterOverride()
 {
     //Method inherited from \Symfony\Component\HttpFoundation\Request
     return \Illuminate\Http\Request::enableHttpMethodParameterOverride();
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:18,代碼來源:_ide_helper.php

示例7:

| is bound in the application since it contains the alias definitions.
|
*/
$aliases = $config['aliases'];
AliasLoader::getInstance($aliases)->register();
/*
|--------------------------------------------------------------------------
| Enable HTTP Method Override
|--------------------------------------------------------------------------
|
| Next we will tell the request class to allow HTTP method overriding
| since we use this to simulate PUT and DELETE requests from forms
| as they are not currently supported by plain HTML form setups.
|
*/
Request::enableHttpMethodParameterOverride();
/*
|--------------------------------------------------------------------------
| Register The Core Service Providers
|--------------------------------------------------------------------------
|
| The Illuminate core service providers register all of the core pieces
| of the Illuminate framework including session, caching, encryption
| and more. It's simply a convenient wrapper for the registration.
|
*/
$providers = $config['providers'];
$app->getProviderRepository()->load($app, $providers);
/*
|--------------------------------------------------------------------------
| Register Booted Start Files
開發者ID:pali88,項目名稱:nodspot-web,代碼行數:31,代碼來源:start.php

示例8: handle

 /**
  * Handle an incoming HTTP request.
  *
  * @param  \Illuminate\Http\Request $request
  *
  * @return \Illuminate\Http\Response
  */
 public function handle($request)
 {
     $request->enableHttpMethodParameterOverride();
     $this->sendRequestThroughRouter($request);
     return $this;
 }
開發者ID:laraish,項目名稱:framework,代碼行數:13,代碼來源:Kernel.php


注:本文中的Illuminate\Http\Request::enableHttpMethodParameterOverride方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。