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