|  |  | @ -83,7 +83,6 @@ abstract class Module extends Component | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 * it will use the "controllers" sub-namespace under the namespace of this module. |  |  |  | 	 * it will use the "controllers" sub-namespace under the namespace of this module. | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 * For example, if the namespace of this module is "foo\bar", then the default |  |  |  | 	 * For example, if the namespace of this module is "foo\bar", then the default | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 * controller namespace would be "foo\bar\controllers". |  |  |  | 	 * controller namespace would be "foo\bar\controllers". | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 * If the module is an application, it will default to "app\controllers". |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 */ |  |  |  | 	 */ | 
			
		
	
		
		
			
				
					
					|  |  |  | 	public $controllerNamespace; |  |  |  | 	public $controllerNamespace; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	/** |  |  |  | 	/** | 
			
		
	
	
		
		
			
				
					|  |  | @ -167,20 +166,16 @@ abstract class Module extends Component | 
			
		
	
		
		
			
				
					
					|  |  |  | 	/** |  |  |  | 	/** | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 * Initializes the module. |  |  |  | 	 * Initializes the module. | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 * This method is called after the module is created and initialized with property values |  |  |  | 	 * This method is called after the module is created and initialized with property values | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 * given in configuration. The default implement will create a path alias using the module [[id]] |  |  |  | 	 * given in configuration. The default implementation will create a path alias using the module [[id]] | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 	 * and then call [[preloadComponents()]] to load components that are declared in [[preload]]. |  |  |  | 	 * and then call [[preloadComponents()]] to load components that are declared in [[preload]]. | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 */ |  |  |  | 	 */ | 
			
		
	
		
		
			
				
					
					|  |  |  | 	public function init() |  |  |  | 	public function init() | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 		$this->preloadComponents(); |  |  |  | 		$this->preloadComponents(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		if ($this->controllerNamespace === null) { |  |  |  | 		if ($this->controllerNamespace === null) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			if ($this instanceof Application) { |  |  |  | 			$class = get_class($this); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				$this->controllerNamespace = 'app\\controllers'; |  |  |  | 			if (($pos = strrpos($class, '\\')) !== false) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			} else { |  |  |  | 				$this->controllerNamespace = substr($class, 0, $pos) . '\\controllers'; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				$class = get_class($this); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if (($pos = strrpos($class, '\\')) !== false) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 					$this->controllerNamespace = substr($class, 0, $pos) . '\\controllers'; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 				} |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
	
		
		
			
				
					|  |  | @ -221,9 +216,6 @@ abstract class Module extends Component | 
			
		
	
		
		
			
				
					
					|  |  |  | 		$p = realpath($path); |  |  |  | 		$p = realpath($path); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		if ($p !== false && is_dir($p)) { |  |  |  | 		if ($p !== false && is_dir($p)) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			$this->_basePath = $p; |  |  |  | 			$this->_basePath = $p; | 
			
		
	
		
		
			
				
					
					|  |  |  | 			if ($this instanceof Application) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 				Yii::setAlias('@app', $p); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} else { |  |  |  | 		} else { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			throw new InvalidParamException("The directory does not exist: $path"); |  |  |  | 			throw new InvalidParamException("The directory does not exist: $path"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
	
		
		
			
				
					|  |  | 
 |