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


PHP r::ssl方法代码示例

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


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

示例1: run

 /**
  * Iterate through every route to find a matching route.
  *
  * @param  string $path Optional path to match against
  * @return Route
  */
 public function run($path = null)
 {
     $method = r::method();
     $ajax = r::ajax();
     $https = r::ssl();
     $routes = a::get($this->routes, $method, array());
     // detect path if not set manually
     if ($path === null) {
         $path = implode('/', (array) url::fragments(detect::path()));
     }
     // empty urls should never happen
     if (empty($path)) {
         $path = '/';
     }
     foreach ($routes as $route) {
         if ($route->https and !$https) {
             continue;
         }
         if ($route->ajax and !$ajax) {
             continue;
         }
         // handle exact matches
         if ($route->pattern == $path) {
             $this->route = $route;
             break;
         }
         // We only need to check routes with regular expression since all others
         // would have been able to be matched by the search for literal matches
         // we just did before we started searching.
         if (strpos($route->pattern, '(') === false) {
             continue;
         }
         $preg = '#^' . $this->wildcards($route->pattern) . '$#u';
         // If we get a match we'll return the route and slice off the first
         // parameter match, as preg_match sets the first array item to the
         // full-text match of the pattern.
         if (preg_match($preg, $path, $parameters)) {
             $this->route = $route;
             $this->route->arguments = array_slice($parameters, 1);
             break;
         }
     }
     if ($this->route and $this->filterer($this->route->filter) !== false) {
         return $this->route;
     } else {
         return null;
     }
 }
开发者ID:LucasFyl,项目名称:korakia,代码行数:54,代码来源:router.php

示例2: testSsl

 public function testSsl()
 {
     $this->assertFalse(r::ssl());
     $this->assertFalse(r::secure());
 }
开发者ID:aoimedia,项目名称:kosmonautensofa,代码行数:5,代码来源:RTest.php


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