From: Kunal Mehta Date: Fri, 14 Nov 2014 19:47:52 +0000 (-0800) Subject: AutoloadGenerator: Don't throw MWExceptions X-Git-Tag: 1.31.0-rc.0~13299 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28?a=commitdiff_plain;h=3d11157294cc83c4e179ac2bec798c2cf5b34d6d;p=lhc%2Fweb%2Fwiklou.git AutoloadGenerator: Don't throw MWExceptions The class won't have been autoloaded, so it can't be used. Change-Id: I54a9be600839c7bffe7debb8ee35ac46694390b4 --- diff --git a/includes/utils/AutoloadGenerator.php b/includes/utils/AutoloadGenerator.php index bcd339337b..ee2c77ab27 100644 --- a/includes/utils/AutoloadGenerator.php +++ b/includes/utils/AutoloadGenerator.php @@ -67,11 +67,11 @@ class AutoloadGenerator { public function forceClassPath( $fqcn, $inputPath ) { $path = realpath( $inputPath ); if ( !$path ) { - throw new \MWException( "Invalid path: $inputPath" ); + throw new \Exception( "Invalid path: $inputPath" ); } $len = strlen( $this->basepath ); if ( substr( $path, 0, $len ) !== $this->basepath ) { - throw new \MWException( "Path is not within basepath: $inputPath" ); + throw new \Exception( "Path is not within basepath: $inputPath" ); } $shortpath = substr( $path, $len ); $this->overrides[$fqcn] = $shortpath; @@ -83,11 +83,11 @@ class AutoloadGenerator { public function readFile( $inputPath ) { $path = realpath( $inputPath ); if ( !$path ) { - throw new \MWException( "Invalid path: $inputPath" ); + throw new \Exception( "Invalid path: $inputPath" ); } $len = strlen( $this->basepath ); if ( substr( $path, 0, $len ) !== $this->basepath ) { - throw new \MWException( "Path is not within basepath: $inputPath" ); + throw new \Exception( "Path is not within basepath: $inputPath" ); } $result = $this->collector->getClasses( file_get_contents( $path )