Files
aowow/setup/tools/sqlgen/declinedword.ss.php
Sarjuuk 3a6c86092b Core/Compat
* create namespace Aowow to avoid naming conflicts
 * inclues/libs/ is outside of the Aowow namespace
2025-04-01 22:32:37 +02:00

35 lines
1.0 KiB
PHP

<?php
namespace Aowow;
if (!defined('AOWOW_REVISION'))
die('illegal access');
if (!CLI)
die('not in cli mode');
CLISetup::registerSetup("sql", new class extends SetupScript
{
protected $info = array(
'declinedwords' => [[], CLISetup::ARGV_PARAM, 'Compiles data for type: Enchantment from dbc and world db.']
);
protected $dbcSourceFiles = ['declinedword', 'declinedwordcases'];
public function generate(array $ids = []) : bool
{
CLI::write('[declinedwords] - copying declinedword.dbc into aowow_declinedword');
DB::Aowow()->query('TRUNCATE ?_declinedword');
DB::Aowow()->query('INSERT INTO ?_declinedword SELECT * FROM dbc_declinedword');
CLI::write('[declinedwords] - copying declinedwordcases.dbc into aowow_declinedwordcases');
DB::Aowow()->query('TRUNCATE ?_declinedwordcases');
DB::Aowow()->query('INSERT INTO ?_declinedwordcases SELECT `wordId`, `caseIdx`, `word` FROM dbc_declinedwordcases');
return true;
}
});
?>