Example #1
0
function txDatabaseRestore()
{
    global $DB, $C;
    VerifyAdministrator();
    CheckAccessList();
    $GLOBALS['message'] = DoDatabaseRestore($_REQUEST);
    txShDatabaseTools();
}
Example #2
0
function ShuffleError($code, $string, $file, $line)
{
    global $C, $DB, $backup_files;
    $reporting = error_reporting();
    if ($reporting == 0 || !($code & $reporting)) {
        return;
    }
    $string = str_replace('<br />', "\n", $string);
    echo "Error on line {$line} of file {$file}\n" . "{$string}\n\n";
    $DB->Update('UNLOCK TABLES');
    // Automatic restore of database
    echo "Automatically restoring previous database tables...\n";
    if (file_exists("{$GLOBALS['BASE_DIR']}/data/{$backup_files['sql-file']}")) {
        DoDatabaseRestore($backup_files, TRUE);
    }
    echo "Database has been restored to it's previous state\n\n";
    echo "Please report this error message in the support forums\n";
    echo "http://www.jmbsoft.com/support/\n\n";
    exit;
}
Example #3
0
     break;
 case '--backup':
     $args = ParseCommandLine();
     if (IsEmptyString($args['sql-file'])) {
         echo "ERROR: You must specify at least a SQL data backup filename when using the --backup function\n" . "Example:\n" . "{$_SERVER['_']} {$path}/{$GLOBALS['argv'][0]} --backup --sql-file=sql-backup.txt --thumbs-file=thumbs-backup.txt --archive-file=backup.tar.gz\n";
         break;
     }
     DoDatabaseBackup($args, TRUE);
     break;
 case '--restore':
     $args = ParseCommandLine();
     if (IsEmptyString($args['sql-file'])) {
         echo "ERROR: You must specify at least a SQL data backup filename when using the --restore function\n" . "Example:\n" . "{$_SERVER['_']} {$path}/{$GLOBALS['argv'][0]} --restore --sql-file=sql-backup.txt --thumbs-file=thumbs-backup.txt\n";
         break;
     }
     DoDatabaseRestore($args, TRUE);
     break;
 case '--export':
     DoGalleryExport(null, TRUE);
     break;
 case '--optimize':
     OptimizeDatabase();
     break;
 case '--daily-partner':
     DailyPartnerMaintenance();
     break;
 case '--cleanup':
     ScheduledCleanup(FALSE);
     break;
 case '--reset-clicks-submitted':
     $DB->Update('UPDATE `tx_galleries` SET `clicks`=0 WHERE `type`=?', array('submitted'));