diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-05-10 11:49:55 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-05-11 11:18:00 +0200 |
commit | db16dc66447f15429561213d9825673f047a5202 (patch) | |
tree | 180d82e8418c3a8911317f81ef8e1b2a35629249 | |
parent | f39e163d4a6ee63444bfb6a797e12a482bd0a49f (diff) | |
download | nextcloud-server-db16dc66447f15429561213d9825673f047a5202.tar.gz nextcloud-server-db16dc66447f15429561213d9825673f047a5202.zip |
Correctly register autoloading before install.php and loading commands
-rw-r--r-- | lib/private/Console/Application.php | 2 | ||||
-rw-r--r-- | lib/private/Installer.php | 2 | ||||
-rw-r--r-- | lib/private/legacy/app.php | 3 | ||||
-rw-r--r-- | tests/settings/controller/EncryptionControllerTest.php | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/lib/private/Console/Application.php b/lib/private/Console/Application.php index 7f12db4eca6..dd5111743f1 100644 --- a/lib/private/Console/Application.php +++ b/lib/private/Console/Application.php @@ -98,7 +98,7 @@ class Application { if($appPath === false) { continue; } - \OC::$loader->addValidRoot($appPath); + \OC_App::registerAutoloading($app, $appPath); $file = $appPath . '/appinfo/register_command.php'; if (file_exists($file)) { require $file; diff --git a/lib/private/Installer.php b/lib/private/Installer.php index edc6306b8f1..336fa0acef8 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -564,7 +564,7 @@ class Installer { } //run appinfo/install.php - \OC::$loader->addValidRoot($appPath); + \OC_App::registerAutoloading($app, $appPath); self::includeAppScript("$appPath/appinfo/install.php"); $info = OC_App::getAppInfo($app); diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index dab4c1a70c7..f558c873556 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -159,10 +159,11 @@ class OC_App { } /** + * @internal * @param string $app * @param string $path */ - protected static function registerAutoloading($app, $path) { + public static function registerAutoloading($app, $path) { // Register on PSR-4 composer autoloader $appNamespace = \OC\AppFramework\App::buildAppNamespace($app); \OC::$composerAutoloader->addPsr4($appNamespace . '\\', $path . '/lib/', true); diff --git a/tests/settings/controller/EncryptionControllerTest.php b/tests/settings/controller/EncryptionControllerTest.php index a3bb4c45a27..565aaf29c9a 100644 --- a/tests/settings/controller/EncryptionControllerTest.php +++ b/tests/settings/controller/EncryptionControllerTest.php @@ -91,7 +91,7 @@ class EncryptionControllerTest extends TestCase { public function testStartMigrationSuccessful() { // we need to be able to autoload the class we're mocking - \OC::$loader->addValidRoot(\OC_App::getAppPath('encryption')); + \OC_App::registerAutoloading('encryption', \OC_App::getAppPath('encryption')); $migration = $this->getMockBuilder('\\OCA\\Encryption\\Migration') ->disableOriginalConstructor()->getMock(); |