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


PHP Request::isSecure方法代碼示例

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


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

示例1: url

 /**
  * Return the URL for the file.
  *
  * @param array $attributes
  * @param null  $secure
  * @return string
  */
 public function url(array $attributes = [], $secure = null)
 {
     if ($secure === null) {
         $secure = $this->request->isSecure();
     }
     return $this->url->to($this->object->publicPath(), $attributes, $secure);
 }
開發者ID:bloveless,項目名稱:files-module,代碼行數:14,代碼來源:FilePresenter.php

示例2: handle

 /**
  * Enforces the secure attribute for a request
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$request->isSecure()) {
         return redirect()->secure($request->path());
     }
     return $next($request);
 }
開發者ID:muhamadsyahril,項目名稱:ecommerce-1,代碼行數:15,代碼來源:RequireSSL.php

示例3: handle

 /**
  * Removes the secure attribute from a request
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request->isSecure()) {
         return redirect()->to($request->path(), 302, [], false);
     }
     return $next($request);
 }
開發者ID:muhamadsyahril,項目名稱:ecommerce-1,代碼行數:15,代碼來源:RemoveSSL.php

示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$request->isSecure() && noah_installed() && site('forceSsl') == '1') {
         return redirect($request->path(), 302, [], true);
     }
     return $next($request);
 }
開發者ID:projnoah,項目名稱:noah,代碼行數:14,代碼來源:ForceSSL.php

示例5: handle

 /**
  * Handle an incoming request.
  *
  * @param Request $request
  * @param Closure $next
  *
  * @return mixed
  */
 public function handle(Request $request, Closure $next)
 {
     if (!$request->isSecure()) {
         return $this->redirector->to($request->getRequestUri(), 302, $request->headers->all(), true);
     }
     return $next($request);
 }
開發者ID:hughgrigg,項目名稱:ching-shop,代碼行數:15,代碼來源:ForceSecure.php

示例6: addPortToDomain

 /**
  * Add the port to the domain if necessary.
  *
  * @param  string  $domain
  * @return string
  */
 protected function addPortToDomain($domain)
 {
     $secure = $this->request->isSecure();
     $port = $this->request->getPort();
     if ($secure && $port === 443 || !$secure && $port === 80) {
         return $domain;
     }
     return $domain . ':' . $port;
 }
開發者ID:hilmysyarif,項目名稱:sisfito,代碼行數:15,代碼來源:UrlGenerator.php

示例7: handle

 /**
  * Verify the incoming request is via an ssl connection unless its on an approved url
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$request->isSecure() && env('FORCE_SECURE', 'true')) {
         if (strpos($request->path(), 'access-control/') !== 0 && $request->path() !== 'acs' && $request->path() !== 'acs/spark') {
             return redirect()->secure($request->path());
         }
     }
     return $next($request);
 }
開發者ID:paters936,項目名稱:BBMembershipSystem,代碼行數:16,代碼來源:SSLOnly.php

示例8: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$request->isSecure() and env('SECURE_COOKIE', false)) {
         if (strpos($request->getRequestUri(), '/storage/') === false) {
             return redirect()->secure($request->getRequestUri());
         }
     }
     return $next($request);
 }
開發者ID:distilleries,項目名稱:expendable,代碼行數:16,代碼來源:Secure.php

示例9: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->app->environment() === 'production') {
         // for Proxies
         Request::setTrustedProxies([$request->getClientIp()]);
         if (!$request->isSecure()) {
             return redirect()->secure($request->getRequestUri());
         }
     }
     return $next($request);
 }
開發者ID:shin1x1,項目名稱:laravel-force-https-url-scheme,代碼行數:18,代碼來源:ForceHttpsUrlScheme.php

示例10: isSecure

 /**
  * Determine if the request is over HTTPS.
  *
  * @return bool
  */
 public function isSecure()
 {
     $isSecure = parent::isSecure();
     if ($isSecure) {
         return true;
     }
     if ($this->isHttpsOn()) {
         return true;
     } elseif ($this->isLoadBalancedHttps()) {
         return true;
     }
     return false;
 }
開發者ID:stevenmaguire,項目名稱:oauth-tool-php,代碼行數:18,代碼來源:LoadBalancedRequest.php

示例11: isSecure

 /**
  * Checks whether the request is secure or not.
  * 
  * This method can read the client protocol from the "X-Forwarded-Proto" header
  * when trusted proxies were set via "setTrustedProxies()".
  * 
  * The "X-Forwarded-Proto" header must contain the protocol: "https" or "http".
  * 
  * If your reverse proxy uses a different header name than "X-Forwarded-Proto"
  * ("SSL_HTTPS" for instance), configure it via "setTrustedHeaderName()" with
  * the "client-proto" key.
  *
  * @return bool 
  * @static 
  */
 public static function isSecure()
 {
     //Method inherited from \Symfony\Component\HttpFoundation\Request
     return \Illuminate\Http\Request::isSecure();
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:20,代碼來源:_ide_helper.php

示例12: getIndex

 /** Получение адреса сокета
  * @param Request $request
  * @return mixed
  */
 public function getIndex(Request $request)
 {
     return Tattler::getWs($request->isSecure());
 }
開發者ID:alex322,項目名稱:OctoTattler,代碼行數:8,代碼來源:SettingsController.php


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