' . yourls_s( 'Upgrade not required. Go back to play!', yourls_admin_url('index.php') ) . '';
} else {
/*
step 1: create new tables and populate them, update old tables structure,
step 2: convert each row of outdated tables if needed
step 3: - if applicable finish updating outdated tables (indexes etc)
- update version & db_version in options, this is all done!
*/
// From what are we upgrading?
if ( isset( $_GET['oldver'] ) && isset( $_GET['oldsql'] ) ) {
$oldver = yourls_sanitize_version( $_GET['oldver'] );
$oldsql = yourls_sanitize_version( $_GET['oldsql'] );
} else {
list( $oldver, $oldsql ) = yourls_get_current_version_from_sql();
}
// To what are we upgrading ?
$newver = YOURLS_VERSION;
$newsql = YOURLS_DB_VERSION;
// Verbose & ugly details
$ydb->show_errors = true;
// Let's go
$step = ( isset( $_GET['step'] ) ? intval( $_GET['step'] ) : 0 );
switch( $step ) {
default:
case 0:
?>
backup your database
(you should do this regularly anyway)' ); ?>
should happen, but this doesn't mean it won't happen, right? ;)" ); ?>
something goes wrong, you'll see a message and hopefully a way to fix." ); ?>
good for you, let it go :)' ); ?>
";
break;
case 1:
case 2:
$upgrade = yourls_upgrade( $step, $oldver, $newver, $oldsql, $newsql );
break;
case 3:
$upgrade = yourls_upgrade( 3, $oldver, $newver, $oldsql, $newsql );
echo '' . yourls__( 'Your installation is now up to date ! ' ) . '
';
echo '' . yourls_s( 'Go back to the admin interface', yourls_admin_url('index.php') ) . '
';
}
}
?>