Browse files

Add progress messages to unattended upgrade script.

  • Loading branch information...
1 parent 638a04b commit 6071c941ed116ebe4373fd928f87c4810147b841 @vboctor vboctor committed Oct 25, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 admin/upgrade_unattended.php
View
8 admin/upgrade_unattended.php
@@ -117,7 +117,7 @@ function print_test_result( $p_result, $p_hard_fail = true, $p_message = '' ) {
$t_result = @$g_db->Connect( $f_hostname, $f_db_username, $f_db_password, $f_database_name );
if( false == $t_result ) {
- echo "failed\n";
+ echo "Failed.\n";
exit( 1 );
}
@@ -127,6 +127,7 @@ function print_test_result( $p_result, $p_hard_fail = true, $p_message = '' ) {
$t_last_update = config_get( 'database_version', -1, ALL_USERS, ALL_PROJECTS );
$lastid = count( $upgrade ) - 1;
$i = $t_last_update + 1;
+$t_count_done = 0;
while(( $i <= $lastid ) && !$g_failed ) {
echo 'Create Schema ( ' . $upgrade[$i][0] . ' on ' . $upgrade[$i][1][0] . ' )';
@@ -147,12 +148,17 @@ function print_test_result( $p_result, $p_hard_fail = true, $p_message = '' ) {
}
$i++;
+ $t_count_done++;
}
+echo "$t_count_done schema upgrades executed.\n";
+
if( false == $g_failed ) {
+ echo "Done.\n";
exit( 0 );
}
+echo "Failed.\n";
exit( 1 );
# vim: noexpandtab tabstop=4 softtabstop=0:

0 comments on commit 6071c94

Please sign in to comment.