<commit_before><?php

$startTime = time();

require_once(__DIR__.'/../incl/incl.php');
require_once(__DIR__.'/../incl/memcache.incl.php');

$tables = [
    'tblBonusSet' => '1=1',
    'tblHouseCheck' => '1=1',
    'tblItemGlobal' => '1=1',
    'tblItemHistoryDaily' => 'item in (select id from tblDBCItem where auctionable=1)',
    'tblItemHistoryMonthly' => 'item in (select id from tblDBCItem where auctionable=1)',
    'tblItemSummary' => '1=1',
    'tblPet' => '1=1',
    'tblPetSummary' => '1=1',
    'tblRealm' => '1=1',
    'tblSnapshot' => '1=1',
];

$sqlFile = __DIR__.'/../backup/backupdata.'.Date('Ymd').'.sql.gz';

if (!(touch($sqlFile) && ($sqlFile = realpath($sqlFile)))) {
    DebugMessage("Could not create backupdata.sql.gz", E_USER_ERROR);
    exit(1);
}
file_put_contents($sqlFile, '');

APIMaintenance('+45 minutes');

$cmd = 'mysqldump --verbose --quick --allow-keywords --skip-opt --create-options --add-drop-table --add-locks --extended-insert --single-transaction --user='.escapeshellarg(DATABASE_USERNAME_CLI).' --password='.escapeshellarg(DATABASE_PASSWORD_CLI).' --where=%s '.escapeshellarg(DATABASE_SCHEMA)." %s | gzip -c >> %s\n";
foreach ($tables as $table => $where) {
    DebugMessage("Starting $table");
    $trash = [];<commit_msg>put skip-opt first for mysqldump<commit_after><?php

$startTime = time();

require_once(__DIR__.'/../incl/incl.php');
require_once(__DIR__.'/../incl/memcache.incl.php');

$tables = [
    'tblBonusSet' => '1=1',
    'tblHouseCheck' => '1=1',
    'tblItemGlobal' => '1=1',
    'tblItemHistoryDaily' => 'item in (select id from tblDBCItem where auctionable=1)',
    'tblItemHistoryMonthly' => 'item in (select id from tblDBCItem where auctionable=1)',
    'tblItemSummary' => '1=1',
    'tblPet' => '1=1',
    'tblPetSummary' => '1=1',
    'tblRealm' => '1=1',
    'tblSnapshot' => '1=1',
];

$sqlFile = __DIR__.'/../backup/backupdata.'.Date('Ymd').'.sql.gz';

if (!(touch($sqlFile) && ($sqlFile = realpath($sqlFile)))) {
    DebugMessage("Could not create backupdata.sql.gz", E_USER_ERROR);
    exit(1);
}
file_put_contents($sqlFile, '');

APIMaintenance('+45 minutes');

$cmd = 'mysqldump --verbose --skip-opt --quick --allow-keywords --create-options --add-drop-table --add-locks --extended-insert --single-transaction --user='.escapeshellarg(DATABASE_USERNAME_CLI).' --password='.<PASSWORD>arg(DATABASE_PASSWORD_CLI).' --where=%s '.escapeshellarg(DATABASE_SCHEMA)." %s | gzip -c >> %s\n";
foreach ($tables as $table => $where) {
    DebugMessage("Starting $table");
    $trash = [];
{'fraction_non_alphanumeric': 0.2162480376766091, 'fraction_numerical': 0.016483516483516484, 'mean_word_length': 4.266528925619835, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2321933', 'n_tokens_mistral': 957, 'n_tokens_neox': 938, 'n_words': 168}