Browse Source
			
			
			Correctly register autoloading before install.php and loading commands
			
			
				remotes/origin/ceph-wait-for-http
			
			
		 
		
			
				
					
						 Joas Schilling
					
					10 years ago
						Joas Schilling
					
					10 years ago
					
						
							committed by
							
								 Thomas Müller
								Thomas Müller
							
						 
					
				 
				
			 
		 
		
			
				
				  
				  No known key found for this signature in database
				  
				  	
						GPG Key ID: A943788A3BBEC44C
				  	
				  
				
			
		
		
		
	
		
			
				 4 changed files with 
5 additions and 
4 deletions
			 
			
		 
		
			
				- 
					
					
					 
					lib/private/Console/Application.php
				
- 
					
					
					 
					lib/private/Installer.php
				
- 
					
					
					 
					lib/private/legacy/app.php
				
- 
					
					
					 
					tests/settings/controller/EncryptionControllerTest.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; | 
			
		
	
	
		
			
				
					|  |  | 
 | 
			
		
	
										
									
								
							
						 
					 
				 
			
		
			
				
					
					
						
							
								
									
										
											
	
		
			
				
					|  |  | @ -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); | 
			
		
	
	
		
			
				
					|  |  | 
 | 
			
		
	
										
									
								
							
						 
					 
				 
			
		
			
				
					
					
						
							
								
									
										
											
	
		
			
				
					|  |  | @ -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); | 
			
		
	
	
		
			
				
					|  |  | 
 | 
			
		
	
										
									
								
							
						 
					 
				 
			
		
			
				
					
					
						
							
								
									
										
											
	
		
			
				
					|  |  | @ -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(); | 
			
		
	
	
		
			
				
					|  |  | 
 |