Index: trunk/phase3/includes/Database.php |
— | — | @@ -2116,7 +2116,7 @@ |
2117 | 2117 | |
2118 | 2118 | /** |
2119 | 2119 | * Read and execute SQL commands from a file. |
2120 | | - * Returns true on success, error string on failure |
| 2120 | + * Returns true on success, error string or exception on failure (depending on object's error ignore settings) |
2121 | 2121 | * @param string $filename File name to open |
2122 | 2122 | * @param callback $lineCallback Optional function called before reading each line |
2123 | 2123 | * @param callback $resultCallback Optional function called for each MySQL result |
— | — | @@ -2124,7 +2124,7 @@ |
2125 | 2125 | function sourceFile( $filename, $lineCallback = false, $resultCallback = false ) { |
2126 | 2126 | $fp = fopen( $filename, 'r' ); |
2127 | 2127 | if ( false === $fp ) { |
2128 | | - return "Could not open \"{$filename}\".\n"; |
| 2128 | + throw new MWException( "Could not open \"{$filename}\".\n" ); |
2129 | 2129 | } |
2130 | 2130 | $error = $this->sourceStream( $fp, $lineCallback, $resultCallback ); |
2131 | 2131 | fclose( $fp ); |
— | — | @@ -2133,7 +2133,7 @@ |
2134 | 2134 | |
2135 | 2135 | /** |
2136 | 2136 | * Read and execute commands from an open file handle |
2137 | | - * Returns true on success, error string on failure |
| 2137 | + * Returns true on success, error string or exception on failure (depending on object's error ignore settings) |
2138 | 2138 | * @param string $fp File handle |
2139 | 2139 | * @param callback $lineCallback Optional function called before reading each line |
2140 | 2140 | * @param callback $resultCallback Optional function called for each MySQL result |
— | — | @@ -2176,7 +2176,7 @@ |
2177 | 2177 | if ( $done ) { |
2178 | 2178 | $cmd = str_replace(';;', ";", $cmd); |
2179 | 2179 | $cmd = $this->replaceVars( $cmd ); |
2180 | | - $res = $this->query( $cmd, __METHOD__, true ); |
| 2180 | + $res = $this->query( $cmd, __METHOD__ ); |
2181 | 2181 | if ( $resultCallback ) { |
2182 | 2182 | call_user_func( $resultCallback, $res ); |
2183 | 2183 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -362,6 +362,8 @@ |
363 | 363 | * We no longer just give up on a missing upload base directory; it's now |
364 | 364 | created automatically if we have sufficient permissions! |
365 | 365 | * (bug 14479) MediaWiki:upload-maxfilesize should have a div id wrapper |
| 366 | +* (bug 14497) Throw visible errors in installer scripts when SQL files |
| 367 | + fail due to database permission or other error |
366 | 368 | |
367 | 369 | |
368 | 370 | === API changes in 1.13 === |