load classpaths of apps before routes

This commit is contained in:
Bernhard Posselt 2013-01-17 21:42:33 +01:00
parent d85e440aa1
commit a8094abac7
1 changed files with 17 additions and 0 deletions

View File

@ -321,6 +321,18 @@ class OC
return OC::$router;
}
public static function loadAppClassPaths()
{
foreach(OC_APP::getEnabledApps() as $app) {
$file = OC_App::getAppPath($app).'/appinfo/classpath.php';
if(file_exists($file)) {
require_once $file;
}
}
}
public static function init()
{
// register autoloader
@ -537,6 +549,11 @@ class OC
header('location: ' . OC_Helper::linkToRemote('webdav'));
return;
}
// load all the classpaths from the enabled apps so they are available
// in the routing files of each app
OC::loadAppClassPaths();
try {
OC::getRouter()->match(OC_Request::getPathInfo());
return;