当前位置: 首页>>代码示例>>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;未经允许,请勿转载。