Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 676d5ed

Browse files
committed
Had this fixed weeks ago, but apparently never committed it. Fixes syntax error. Issue #15
1 parent 01becff commit 676d5ed

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

Diff for: deployMintCore.php

+22-21
Original file line numberDiff line numberDiff line change
@@ -715,28 +715,29 @@ public static function ajax_deploySnapshot_callback(){
715715

716716
if( !mysql_select_db( $temporaryDatabase , $dbh ) )
717717
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 );
720720

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+
}
740741
}
741742

742743
public static function ajax_updateSnapDesc_callback(){

0 commit comments

Comments
 (0)