summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php34
1 files changed, 18 insertions, 16 deletions
diff --git a/lib/base.php b/lib/base.php
index 4a5f4e77a59..50e415c334c 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -447,17 +447,27 @@ class OC {
$loaderStart = microtime(true);
require_once __DIR__ . '/autoloader.php';
self::$loader = new \OC\Autoloader();
- self::$loader->registerPrefix('Doctrine\\Common', 'doctrine/common/lib');
- self::$loader->registerPrefix('Doctrine\\DBAL', 'doctrine/dbal/lib');
- self::$loader->registerPrefix('Symfony\\Component\\Routing', 'symfony/routing');
- self::$loader->registerPrefix('Symfony\\Component\\Console', 'symfony/console');
- self::$loader->registerPrefix('Patchwork', '3rdparty');
- self::$loader->registerPrefix('Pimple', '3rdparty/Pimple');
spl_autoload_register(array(self::$loader, 'load'));
$loaderEnd = microtime(true);
- // setup the basic server
self::initPaths();
+
+ // setup 3rdparty autoloader
+ $vendorAutoLoad = OC::$THIRDPARTYROOT . '/3rdparty/autoload.php';
+ if (file_exists($vendorAutoLoad)) {
+ $loader = require_once $vendorAutoLoad;
+ $loader->add('Pimple',OC::$THIRDPARTYROOT . '/3rdparty/Pimple');
+ $loader->add('Doctrine\\Common',OC::$THIRDPARTYROOT . '/3rdparty/doctrine/common/lib');
+ $loader->add('Doctrine\\DBAL',OC::$THIRDPARTYROOT . '/3rdparty/doctrine/dbal/lib');
+ $loader->add('Symfony\\Component\\Routing',OC::$THIRDPARTYROOT . '/3rdparty/symfony/routing');
+ $loader->add('Symfony\\Component\\Console',OC::$THIRDPARTYROOT . '/3rdparty/symfony/console');
+ $loader->add('Patchwork',OC::$THIRDPARTYROOT . '/3rdparty');
+ } else {
+ OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
+ OC_Template::printErrorPage('Composer autoloader not found, unable to continue.');
+ }
+
+ // setup the basic server
self::$server = new \OC\Server();
\OC::$server->getEventLogger()->log('autoloader', 'Autoloader', $loaderStart, $loaderEnd);
\OC::$server->getEventLogger()->start('boot', 'Initialize');
@@ -494,17 +504,9 @@ class OC {
self::handleAuthHeaders();
self::registerAutoloaderCache();
-
- OC_Util::isSetLocaleWorking();
-
- // setup 3rdparty autoloader
- $vendorAutoLoad = OC::$THIRDPARTYROOT . '/3rdparty/autoload.php';
- if (file_exists($vendorAutoLoad)) {
- require_once $vendorAutoLoad;
- }
-
// initialize intl fallback is necessary
\Patchwork\Utf8\Bootup::initIntl();
+ OC_Util::isSetLocaleWorking();
if (!defined('PHPUNIT_RUN')) {
OC\Log\ErrorHandler::setLogger(OC_Log::$object);