fix travis
authorStricted <info@stricted.de>
Wed, 23 Dec 2015 19:34:41 +0000 (20:34 +0100)
committerStricted <info@stricted.de>
Wed, 23 Dec 2015 19:34:41 +0000 (20:34 +0100)
.travis.yml
lib/system/RequestHandler.class.php
lib/system/template/plugins/block.link.php

index f2072cce52baa60d19b3e597fed079545bc0c72e..5bd8f318ac652cd62e4c2a043bba312735d0625c 100644 (file)
@@ -1,12 +1,13 @@
 language: php\r
+sudo: false\r
 php:\r
   - 5.3\r
   - 5.4\r
   - 5.5\r
   - 5.6\r
-  - nightly\r
+  - 7.0\r
 before_install:\r
-  - pear install pear/PHP_CodeSniffer\r
+  - pyrus install pear/PHP_CodeSniffer\r
   - phpenv rehash\r
 before_script:\r
   - git clone --branch=master --depth=1 --quiet git://github.com/WoltLab/WCF.git WCF\r
index 89e94418a9415706fc87c65631103da5ad875d95..1af5a1923262268f7e716293290f9c88324e888e 100644 (file)
@@ -10,14 +10,13 @@ use dns\system\cache\builder\ControllerCacheBuilder;
 class RequestHandler {
        protected $pattern = "";
        protected $routeData = array();
-       protected $controllers = array();
        
        /**
         * init RequestHandler
         */
        public function __construct ($module = '') {
                $this->pattern = '~/?(?:(?P<controller>[A-Za-z0-9\-]+)(?:/(?P<id>\d+)(?:-(?P<title>[^/]+))?)?)?~x';
-               $this->getControllers($module);
+               $controllers = ControllerCacheBuilder::getInstance()->getData(array('module' => $module));
                
                if (DNS::getSession()->username !== null) {
                        DNS::getTPL()->assign(array("username" => DNS::getSession()->username));
@@ -37,8 +36,8 @@ class RequestHandler {
                
                if (isset($this->routeData['controller']) && !empty($this->routeData['controller'])) {
                        $controller = strtolower($this->routeData['controller']);
-                       if (isset($this->controllers[$controller]) && !empty($this->controllers[$controller])) {
-                               $className = $this->controllers[$controller];
+                       if (isset($controllers[$controller]) && !empty($controllers[$controller])) {
+                               $className = $controllers[$controller];
                        }
                        else {
                                @header('HTTP/1.0 404 Not Found');
@@ -97,23 +96,6 @@ class RequestHandler {
                }
        }
        
-       public function getControllers ($module) {
-               
-               $this->controllers = ControllerCacheBuilder::getInstance()->getData(array('module' => $module));
-               /*
-               $pages = glob(DNS_DIR.'/lib/'.(empty($module) ? '' : $module.'/').'page/*Page.class.php');
-               
-               foreach ($pages as $page) {
-                       $page = str_replace('Page.class.php', '', basename($page));
-
-                       $class = "\\dns".(empty($module) ? '' : "\\".$module)."\\page\\".$page."Page";
-                       if (class_exists($class) && is_subclass_of($class, '\\dns\\page\\AbstractPage')) {
-                               $this->controllers[strtolower($page)] = $class;
-                       }
-               }
-               */
-       }
-       
        public function matches($requestURL) {
                if (preg_match($this->pattern, $requestURL, $matches)) {
                        foreach ($matches as $key => $value) {
index c9769808202f68b731f57168d0289c91795afbd4..a38f202e17e7ee1ae26bf376be9d3bf77dd230ff 100644 (file)
@@ -36,5 +36,5 @@ function smarty_block_link($params, $content, $template, &$repeat) {
                $url .= $content;
        }
        
-       return @htmlspecialchars($url, ENT_COMPAT, 'UTF-8');;
-}
\ No newline at end of file
+       return @htmlspecialchars($url, ENT_COMPAT, 'UTF-8');
+}