00001 <?php
00010 require_once 'commandLine.inc';
00011 require_once "$IP/maintenance/updaters.inc";
00012
00013 if( $args ) {
00014 foreach( $args as $arg ) {
00015 $files = array(
00016 $arg,
00017 archive( $arg ),
00018 archive( "patch-$arg.sql" ),
00019 );
00020 foreach( $files as $file ) {
00021 if( file_exists( $file ) ) {
00022 echo "$file ...\n";
00023 dbsource( $file );
00024 continue 2;
00025 }
00026 }
00027 echo "Could not find $arg\n";
00028 }
00029 echo "done.\n";
00030 } else {
00031 echo "Run an SQL file into the DB, replacing prefix and charset vars.\n";
00032 echo "Usage:\n";
00033 echo " php maintenance/patchSql.php file1.sql file2.sql ...\n";
00034 echo "\n";
00035 echo "Paths in maintenance/archive are automatically expanded if a local file isn't found.\n";
00036 }