Fix for r47482: put the RELEASE-NOTES entry in the "bug fixes" section and not the...
[mediawiki.git] / maintenance / patchSql.php
blob42380eea80018268c2f08d49b637414979d43539
1 <?php
2 /**
3 * Manually run an SQL patch outside of the general updaters.
4 * This ensures that the DB options (charset, prefix, engine) are correctly set.
6 * @file
7 * @ingroup Maintenance
8 */
10 require_once 'commandLine.inc';
11 require_once "$IP/maintenance/updaters.inc";
13 if( $args ) {
14 foreach( $args as $arg ) {
15 $files = array(
16 $arg,
17 archive( $arg ),
18 archive( "patch-$arg.sql" ),
20 foreach( $files as $file ) {
21 if( file_exists( $file ) ) {
22 echo "$file ...\n";
23 dbsource( $file );
24 continue 2;
27 echo "Could not find $arg\n";
29 echo "done.\n";
30 } else {
31 echo "Run an SQL file into the DB, replacing prefix and charset vars.\n";
32 echo "Usage:\n";
33 echo " php maintenance/patchSql.php file1.sql file2.sql ...\n";
34 echo "\n";
35 echo "Paths in maintenance/archive are automatically expanded if a local file isn't found.\n";