Permalink
Browse files

Add progress messages to unattended upgrade script.

  • Loading branch information...
1 parent ad929d4 commit 5249cbe3c2beade8588514f67d9219fa9fdca4c2 @vboctor vboctor committed Oct 26, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 admin/upgrade_unattended.php
@@ -113,7 +113,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 );
}
@@ -123,6 +123,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] . ' )';
@@ -143,12 +144,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 5249cbe

Please sign in to comment.