diff --git a/lib/base.php b/lib/base.php
index 2cace2a0a06a84155c58e9b3855450044df63cf9..d6ef01ccbf729c768334c6db6cd4d0f1d3b82691 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -469,7 +469,12 @@ class OC {
 
 	public static function loadAppClassPaths() {
 		foreach (OC_APP::getEnabledApps() as $app) {
-			$file = OC_App::getAppPath($app) . '/appinfo/classpath.php';
+			$appPath = OC_App::getAppPath($app);
+			if ($appPath === false) {
+				continue;
+			}
+
+			$file = $appPath . '/appinfo/classpath.php';
 			if (file_exists($file)) {
 				require_once $file;
 			}
diff --git a/lib/private/route/router.php b/lib/private/route/router.php
index 8d31d448855535fb791a751a518ff4ac4ace545e..5cfddca966afb4e416142ced094bcda2f9dbda65 100644
--- a/lib/private/route/router.php
+++ b/lib/private/route/router.php
@@ -33,6 +33,7 @@ namespace OC\Route;
 use OCP\ILogger;
 use OCP\Route\IRouter;
 use OCP\AppFramework\App;
+use OCP\Util;
 use Symfony\Component\Routing\Exception\RouteNotFoundException;
 use Symfony\Component\Routing\Matcher\UrlMatcher;
 use Symfony\Component\Routing\Generator\UrlGenerator;
@@ -41,49 +42,26 @@ use Symfony\Component\Routing\RouteCollection;
 use Symfony\Component\Routing\Exception\ResourceNotFoundException;
 
 class Router implements IRouter {
-	/**
-	 * @var \Symfony\Component\Routing\RouteCollection[]
-	 */
-	protected $collections = array();
-
-	/**
-	 * @var \Symfony\Component\Routing\RouteCollection
-	 */
+	/** @var RouteCollection[] */
+	protected $collections = [];
+	/** @var null|RouteCollection */
 	protected $collection = null;
-
-	/**
-	 * @var string
-	 */
+	/** @var null|string */
 	protected $collectionName = null;
-
-	/**
-	 * @var \Symfony\Component\Routing\RouteCollection
-	 */
+	/** @var null|RouteCollection */
 	protected $root = null;
-
-	/**
-	 * @var \Symfony\Component\Routing\Generator\UrlGenerator
-	 */
+	/** @var null|UrlGenerator */
 	protected $generator = null;
-
-	/**
-	 * @var string[]
-	 */
+	/** @var string[] */
 	protected $routingFiles;
-
-	/**
-	 * @var string
-	 */
-	protected $cacheKey;
-
+	/** @var bool */
 	protected $loaded = false;
-
-	protected $loadedApps = array();
-
-	/**
-	 * @var ILogger
-	 */
+	/** @var array */
+	protected $loadedApps = [];
+	/** @var ILogger */
 	protected $logger;
+	/** @var RequestContext */
+	protected $context;
 
 	/**
 	 * @param ILogger $logger
@@ -114,7 +92,7 @@ class Router implements IRouter {
 	 */
 	public function getRoutingFiles() {
 		if (!isset($this->routingFiles)) {
-			$this->routingFiles = array();
+			$this->routingFiles = [];
 			foreach (\OC_APP::getEnabledApps() as $app) {
 				$file = \OC_App::getAppPath($app) . '/appinfo/routes.php';
 				if (file_exists($file)) {
@@ -126,23 +104,9 @@ class Router implements IRouter {
 	}
 
 	/**
-	 * @return string
-	 */
-	public function getCacheKey() {
-		if (!isset($this->cacheKey)) {
-			$files = $this->getRoutingFiles();
-			$files[] = 'settings/routes.php';
-			$files[] = 'core/routes.php';
-			$files[] = 'ocs/routes.php';
-			$this->cacheKey = \OC\Cache::generateCacheKeyFromFiles($files);
-		}
-		return $this->cacheKey;
-	}
-
-	/**
-	 * loads the api routes
+	 * Loads the routes
 	 *
-	 * @return void
+	 * @param null|string $app
 	 */
 	public function loadRoutes($app = null) {
 		$requestedApp = $app;
@@ -157,10 +121,10 @@ class Router implements IRouter {
 				return;
 			}
 			$file = \OC_App::getAppPath($app) . '/appinfo/routes.php';
-			if (file_exists($file)) {
-				$routingFiles = array($app => $file);
+			if ($file !== false && file_exists($file)) {
+				$routingFiles = [$app => $file];
 			} else {
-				$routingFiles = array();
+				$routingFiles = [];
 			}
 		}
 		\OC::$server->getEventLogger()->start('loadroutes' . $requestedApp, 'Loading Routes');
@@ -183,12 +147,12 @@ class Router implements IRouter {
 		if (!isset($this->loadedApps['core'])) {
 			$this->loadedApps['core'] = true;
 			$this->useCollection('root');
-			require_once 'settings/routes.php';
-			require_once 'core/routes.php';
+			require_once __DIR__ . '/../../../settings/routes.php';
+			require_once __DIR__ . '/../../../core/routes.php';
 		}
 		if ($this->loaded) {
 			// include ocs routes, must be loaded last for /ocs prefix
-			require_once 'ocs/routes.php';
+			require_once __DIR__ . '/../../../ocs/routes.php';
 			$collection = $this->getCollection('ocs');
 			$collection->addPrefix('/ocs');
 			$this->root->addCollection($collection);
@@ -196,6 +160,14 @@ class Router implements IRouter {
 		\OC::$server->getEventLogger()->end('loadroutes' . $requestedApp);
 	}
 
+	/**
+	 * @return string
+	 * @deprecated
+	 */
+	public function getCacheKey() {
+		return '';
+	}
+
 	/**
 	 * @param string $name
 	 * @return \Symfony\Component\Routing\RouteCollection
@@ -237,7 +209,10 @@ class Router implements IRouter {
 	 * @param array $requirements An array of requirements for parameters (regexes)
 	 * @return \OC\Route\Route
 	 */
-	public function create($name, $pattern, array $defaults = array(), array $requirements = array()) {
+	public function create($name,
+						   $pattern,
+						   array $defaults = [],
+						   array $requirements = []) {
 		$route = new Route($pattern, $defaults, $requirements);
 		$this->collection->add($name, $route);
 		return $route;
@@ -260,7 +235,7 @@ class Router implements IRouter {
 			$this->loadRoutes($app);
 		} else if (substr($url, 0, 6) === '/core/' or substr($url, 0, 10) === '/settings/') {
 			\OC::$REQUESTEDAPP = $url;
-			if (!\OC::$server->getConfig()->getSystemValue('maintenance', false) && !\OCP\Util::needUpgrade()) {
+			if (!\OC::$server->getConfig()->getSystemValue('maintenance', false) && !Util::needUpgrade()) {
 				\OC_App::loadApps();
 			}
 			$this->loadRoutes('core');
@@ -325,7 +300,9 @@ class Router implements IRouter {
 	 * @param bool $absolute
 	 * @return string
 	 */
-	public function generate($name, $parameters = array(), $absolute = false) {
+	public function generate($name,
+							 $parameters = [],
+							 $absolute = false) {
 		$this->loadRoutes();
 		try {
 			$referenceType = UrlGenerator::ABSOLUTE_URL;
@@ -376,6 +353,4 @@ class Router implements IRouter {
 			$application->registerRoutes($this, $routes);
 		}
 	}
-
-
 }
diff --git a/lib/public/route/irouter.php b/lib/public/route/irouter.php
index 3f5b58ac416e06697b49f608b3fc24a8184233f0..63e7b9b6202a9ad6bac5fdad1a632c085fee29cd 100644
--- a/lib/public/route/irouter.php
+++ b/lib/public/route/irouter.php
@@ -29,6 +29,7 @@ namespace OCP\Route;
  *
  * @package OCP\Route
  * @since 7.0.0
+ * @deprecated 9.0.0
  */
 interface IRouter {
 
@@ -37,19 +38,23 @@ interface IRouter {
 	 *
 	 * @return string[]
 	 * @since 7.0.0
+	 * @deprecated 9.0.0
 	 */
 	public function getRoutingFiles();
 
 	/**
 	 * @return string
 	 * @since 7.0.0
+	 * @deprecated 9.0.0
 	 */
 	public function getCacheKey();
 
 	/**
-	 * loads the api routes
-	 * @return void
+	 * Loads the routes
+	 *
+	 * @param null|string $app
 	 * @since 7.0.0
+	 * @deprecated 9.0.0
 	 */
 	public function loadRoutes($app = null);
 
@@ -59,6 +64,7 @@ interface IRouter {
 	 * @param string $name Name of the collection to use.
 	 * @return void
 	 * @since 7.0.0
+	 * @deprecated 9.0.0
 	 */
 	public function useCollection($name);
 
@@ -67,6 +73,7 @@ interface IRouter {
 	 *
 	 * @return string the collection name
 	 * @since 8.0.0
+	 * @deprecated 9.0.0
 	 */
 	public function getCurrentCollection();
 
@@ -79,6 +86,7 @@ interface IRouter {
 	 * @param array $requirements An array of requirements for parameters (regexes)
 	 * @return \OCP\Route\IRoute
 	 * @since 7.0.0
+	 * @deprecated 9.0.0
 	 */
 	public function create($name, $pattern, array $defaults = array(), array $requirements = array());
 
@@ -89,6 +97,7 @@ interface IRouter {
 	 * @throws \Exception
 	 * @return void
 	 * @since 7.0.0
+	 * @deprecated 9.0.0
 	 */
 	public function match($url);
 
@@ -96,6 +105,7 @@ interface IRouter {
 	 * Get the url generator
 	 *
 	 * @since 7.0.0
+	 * @deprecated 9.0.0
 	 */
 	public function getGenerator();
 
@@ -107,6 +117,7 @@ interface IRouter {
 	 * @param bool $absolute
 	 * @return string
 	 * @since 7.0.0
+	 * @deprecated 9.0.0
 	 */
 	public function generate($name, $parameters = array(), $absolute = false);