@@ -715,28 +715,29 @@ public static function ajax_deploySnapshot_callback(){
715
715
716
716
if ( !mysql_select_db ( $ temporaryDatabase , $ dbh ) )
717
717
self ::ajaxError ( "Could not select temporary database {$ temporaryDatabase } : " . mysql_error ( $ dbh ) );
718
- $ curdbres = mysql_query ( 'SELECT DATABASE() ' , $ dbh );
719
- $ curdbrow = mysql_fetch_array ( $ curdbres , MYSQL_NUM );
718
+ $ curdbres = mysql_query ( 'SELECT DATABASE() ' , $ dbh );
719
+ $ curdbrow = mysql_fetch_array ( $ curdbres , MYSQL_NUM );
720
720
721
- $ renames = array ();
722
- foreach ( self ::$ wpTables as $ t ){
723
- array_push ( $ renames , "{$ dbname }. {$ destTablePrefix }{$ t } TO {$ temporaryDatabase }.old_ {$ t } , {$ temporaryDatabase }. {$ sourceTablePrefix }$ t TO {$ dbname }. {$ destTablePrefix }{$ t }" );
724
- }
725
- $ stime = microtime ( true );
726
- mysql_query ( 'RENAME TABLE ' . implode ( ', ' , $ renames ) , $ dbh );
727
- $ lockTime = sprintf ( '%.4f ' , microtime ( true ) - $ stime );
728
- if ( mysql_error ( $ dbh ) )
729
- self ::ajaxError ( 'A database error occured: ' . substr ( mysql_error ( $ dbh ) , 0 , 200 ) );
730
- if ( $ temporaryDatabaseCreated ){
731
- mysql_query ( "DROP DATABASE {$ temporaryDatabase }" , $ dbh );
732
- }else {
733
- self ::emptyDatabase ( $ temporaryDatabase , $ dbh );
734
- }
735
- if ( mysql_error ( $ dbh ) )
736
- self ::ajaxError ( 'A database error occured trying to drop an old temporary database, but the deployment completed. Error was: ' . substr ( mysql_error ( $ dbh ) , 0 , 200 ) );
737
- if ( !$ backupDisabled )
738
- self ::deleteOldBackupDatabases ();
739
- die ( json_encode ( array ( 'ok ' => 1 , 'lockTime ' => $ lockTime ) ) );
721
+ $ renames = array ();
722
+ foreach ( self ::$ wpTables as $ t ){
723
+ array_push ( $ renames , "{$ dbname }. {$ destTablePrefix }{$ t } TO {$ temporaryDatabase }.old_ {$ t } , {$ temporaryDatabase }. {$ sourceTablePrefix }$ t TO {$ dbname }. {$ destTablePrefix }{$ t }" );
724
+ }
725
+ $ stime = microtime ( true );
726
+ mysql_query ( 'RENAME TABLE ' . implode ( ', ' , $ renames ) , $ dbh );
727
+ $ lockTime = sprintf ( '%.4f ' , microtime ( true ) - $ stime );
728
+ if ( mysql_error ( $ dbh ) )
729
+ self ::ajaxError ( 'A database error occured: ' . substr ( mysql_error ( $ dbh ) , 0 , 200 ) );
730
+ if ( $ temporaryDatabaseCreated ){
731
+ mysql_query ( "DROP DATABASE {$ temporaryDatabase }" , $ dbh );
732
+ }else {
733
+ self ::emptyDatabase ( $ temporaryDatabase , $ dbh );
734
+ }
735
+ if ( mysql_error ( $ dbh ) )
736
+ self ::ajaxError ( 'A database error occured trying to drop an old temporary database, but the deployment completed. Error was: ' . substr ( mysql_error ( $ dbh ) , 0 , 200 ) );
737
+ if ( !$ backupDisabled )
738
+ self ::deleteOldBackupDatabases ();
739
+ die ( json_encode ( array ( 'ok ' => 1 , 'lockTime ' => $ lockTime ) ) );
740
+ }
740
741
}
741
742
742
743
public static function ajax_updateSnapDesc_callback (){
0 commit comments