當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。