Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_setup.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | * php SMW_refreshData.php [options...] |
16 | 16 | * |
17 | 17 | * -b <backend> Execute the operation for the storage backend of the given name |
18 | | - * -user <dbuser> Database user account to use for chaning DB layout |
| 18 | + * -user <dbuser> Database user account to use for changing DB layout |
19 | 19 | * -password <dbpassword> Password for user account |
20 | 20 | * NOTE: specifying user credentials in a command line call will usually store them |
21 | 21 | * within the shell history file. For security, provide credentials in Adminssetings.php |
— | — | @@ -45,7 +45,6 @@ |
46 | 46 | require_once ( getenv('MW_INSTALL_PATH') !== false |
47 | 47 | ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc" |
48 | 48 | : dirname( __FILE__ ) . '/../../../maintenance/commandLine.inc' ); |
49 | | -require_once("$IP/maintenance/counter.php"); |
50 | 49 | |
51 | 50 | global $smwgDefaultStore; |
52 | 51 | |
— | — | @@ -90,11 +89,29 @@ |
91 | 90 | |
92 | 91 | print "Abort with CTRL-C in the next $delay seconds ... "; |
93 | 92 | |
94 | | - for ($i = $delay+1; $i >= 1;) { |
95 | | - print_c($i, --$i); |
96 | | - sleep(1); |
| 93 | + // TODO |
| 94 | + // Remove the following section and replace it with a simple |
| 95 | + // wfCountDown as soon as we switch to MediaWiki 1.16. |
| 96 | + // Currently, wfCountDown is only supported from |
| 97 | + // revision 51650 (Jun 9 2009) onward. |
| 98 | + if (function_exists("wfCountDown")) { |
| 99 | + wfCountDown( $delay ); |
| 100 | + } else { |
| 101 | + for ( $i = $delay; $i >= 0; $i-- ) { |
| 102 | + if ( $i != $delay ) { |
| 103 | + echo str_repeat( "\x08", strlen( $i + 1 ) ); |
| 104 | + } |
| 105 | + echo $i; |
| 106 | + flush(); |
| 107 | + if ( $i ) { |
| 108 | + sleep( 1 ); |
| 109 | + } |
| 110 | + } |
| 111 | + echo "\n"; |
97 | 112 | } |
98 | | - echo "\n"; |
| 113 | + // Remove up to here and just uncomment the following line: |
| 114 | + // wfCountDown( $delay ); |
| 115 | + |
99 | 116 | smwfGetStore()->drop(true); |
100 | 117 | wfRunHooks('smwDropTables'); |
101 | 118 | print "\n"; |