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


PHP Request::decodedPath方法代码示例

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


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

示例1: handle

 /**
  * Return 404s for missing files and redirect to index.html for directories
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     // File path requested
     $path = $request->decodedPath();
     // Remove any repeated slashes
     $path = preg_replace('#//+#', '/', $path);
     // If user requested / explicitly redirect them to index.html
     if ($path == '/') {
         return redirect('index.html', 301);
     }
     // Handle requests for missing files
     if (!$this->fs->has($path)) {
         $this->logger->warning('File not found (cache miss)', array('path' => $path));
         abort(404);
     }
     // If request is for directory, redirect to index.html in that directory
     $metaData = $this->fs->getMetadata($path);
     if ($metaData['type'] == 'dir') {
         $path .= '/index.html';
         return redirect($path, 301);
     }
     // Forward to Controller for content & modified time
     return $next($request);
 }
开发者ID:bbatsche,项目名称:S3-OAuth-Proxy,代码行数:31,代码来源:S3Middleware.php

示例2: denyRequest

 private function denyRequest()
 {
     // Store return path to allow redirect after auth, ...
     \Session::put('laraguard_lastDenied', $this->request->decodedPath());
     \Session::put('laraguard_lastDeniedLifetime', $this->permissionParser->getDeniedUrlLifetime());
     // Redirect to permissionDenied method of controller
     if ($this->requestParser->hasControllerPermissionDeniedMethod()) {
         // Modify request action to direct to method 'permissionDenied'
         $action = $this->request->route()->getAction();
         $controllerPath = $this->requestParser->getControllerPath();
         $action['uses'] = $controllerPath . '@permissionDenied';
         $action['controller'] = $controllerPath . '@permissionDenied';
         // Set new action
         $this->request->route()->setAction($action);
         if ($this->permissionParser->debugging()) {
             \Log::info('[Laraguard] DENY - with permissionDenied(): ' . $action['uses']);
         }
         return \Route::dispatch($this->request);
     } else {
         if ($this->permissionParser->hasNoPermissionRoute()) {
             $noPermissionRoute = $this->permissionParser->getNoPermissionRoute();
             if ($this->permissionParser->debugging()) {
                 \Log::info('[Laraguard] DENY - with defaultNoPermissionRoute: ' . $noPermissionRoute);
             }
             return redirect($noPermissionRoute);
         } else {
             if ($this->permissionParser->debugging()) {
                 \Log::info('[Laraguard] DENY - with 501 Error');
             }
             return $this->returnError(['Permission denied']);
         }
     }
 }
开发者ID:amanullah-1,项目名称:Laraguard,代码行数:33,代码来源:Permission.php

示例3: decodedPath

 /**
  * Get the current encoded path info for the request.
  *
  * @return string 
  * @static 
  */
 public static function decodedPath()
 {
     return \Illuminate\Http\Request::decodedPath();
 }
开发者ID:satriashp,项目名称:tour,代码行数:10,代码来源:_ide_helper.php

示例4: bindPathParameters

 /**
  * Get the parameter matches for the path portion of the URI.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return array
  */
 protected function bindPathParameters(Request $request)
 {
     preg_match($this->compiled->getRegex(), '/' . $request->decodedPath(), $matches);
     return $matches;
 }
开发者ID:joshe091,项目名称:buscadorapps,代码行数:11,代码来源:Route.php

示例5: getEmailDatas

 /**
  * get error email datas
  *
  * @param \Illuminate\Http\Request $request
  * @param Exception $e
  * @return array
  */
 private function getEmailDatas($request, $e)
 {
     return ['date' => Carbon::now()->format('d.m.Y H:i:s'), 'rUser' => $request->user(), 'rSessionOld' => $request->session()->all()['flash']['old'], 'rSessionNew' => $request->session()->all()['flash']['new'], 'rAll' => $request->all(), 'rIp' => $request->ip(), 'rDecodedPath' => $request->decodedPath(), 'rPath' => $request->path(), 'rFullUrl' => $request->fullUrl(), 'rUrl' => $request->url(), 'rRoot' => $request->root(), 'rMethod' => $request->method(), 'eMessage' => method_exists($e, 'getMessage') ? $e->getMessage() : '', 'eCode' => method_exists($e, 'getStatusCode') ? $e->getStatusCode() : 200, 'eFile' => method_exists($e, 'getFile') ? $e->getFile() : '', 'eLine' => method_exists($e, 'getLine') ? $e->getLine() : '', 'ePrevious' => is_string($e->getPrevious()) ? $e->getPrevious() : '', 'eTrace' => nl2br($e->getTraceAsString())];
 }
开发者ID:erenmustafaozdal,项目名称:laravel-modules-base,代码行数:11,代码来源:Handler.php

示例6: index

 public function index(Request $request)
 {
     print_r($request->all());
     print_r($request->decodedPath());
 }
开发者ID:vtl3000,项目名称:rest,代码行数:5,代码来源:Controller.php


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