From 91f11813c0f6e588789da17687528e02199ab04b Mon Sep 17 00:00:00 2001 From: Stricted Date: Wed, 23 Dec 2015 20:34:41 +0100 Subject: [PATCH] fix travis --- .travis.yml | 5 +++-- lib/system/RequestHandler.class.php | 24 +++------------------- lib/system/template/plugins/block.link.php | 4 ++-- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index f2072cc..5bd8f31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,13 @@ language: php +sudo: false php: - 5.3 - 5.4 - 5.5 - 5.6 - - nightly + - 7.0 before_install: - - pear install pear/PHP_CodeSniffer + - pyrus install pear/PHP_CodeSniffer - phpenv rehash before_script: - git clone --branch=master --depth=1 --quiet git://github.com/WoltLab/WCF.git WCF diff --git a/lib/system/RequestHandler.class.php b/lib/system/RequestHandler.class.php index 89e9441..1af5a19 100644 --- a/lib/system/RequestHandler.class.php +++ b/lib/system/RequestHandler.class.php @@ -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[A-Za-z0-9\-]+)(?:/(?P\d+)(?:-(?P[^/]+))?)?)?~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) { diff --git a/lib/system/template/plugins/block.link.php b/lib/system/template/plugins/block.link.php index c976980..a38f202 100644 --- a/lib/system/template/plugins/block.link.php +++ b/lib/system/template/plugins/block.link.php @@ -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'); +} -- 2.20.1