: regenerate tables/files that depend on given world-table\n"; echo "--update : apply new sql updates fetched from github\n"; echo "--firstrun : goes through the nessecary hoops of the initial setup.\n"; echo "additional options\n"; echo "--log logfile : write ouput to file\n"; echo "--locales= : limit setup to enUS, frFR, deDE, esES and/or ruRU (does not override config settings)\n"; echo "--mpqDataDir=path/ : manually point to directory with extracted mpq files; is limited to setup/ (default: setup/mpqData/)\n"; echo "--delete | -d : delete generated dbc_* tables when script finishes\n"; echo "--help | -h : contextual help\n"; die("\n"); } else CLISetup::init(); $cmd = array_pop(array_keys($opt)); $s = []; $b = []; switch ($cmd) // we accept only one main parameter { case 'firstrun': require_once 'setup/tools/clisetup/firstrun.func.php'; firstrun(); finish(); case 'account': case 'dbconfig': case 'siteconfig': case 'sql': case 'build': require_once 'setup/tools/clisetup/'.$cmd.'.func.php'; $cmd(); finish(); case 'update': require_once 'setup/tools/clisetup/update.func.php'; [$s, $b] = update(); // return true if we do not rebuild stuff if (!$s && !$b) return; case 'sync': require_once 'setup/tools/clisetup/sql.func.php'; require_once 'setup/tools/clisetup/build.func.php'; $_s = sql($s); $_b = build($b); if ($s) { $_ = array_diff($s, $_s); DB::Aowow()->query('UPDATE ?_dbversion SET `sql` = ?', $_ ? implode(' ', $_) : ''); } if ($b) { $_ = array_diff($b, $_b); DB::Aowow()->query('UPDATE ?_dbversion SET `build` = ?', $_ ? implode(' ', $_) : ''); } finish(); case 'dbc': foreach (explode(',', $opt['dbc']) as $n) { if (empty($n)) continue; $dbc = new DBC(trim($n), ['temporary' => false]); if ($dbc->error) { CLI::write('CLISetup::loadDBC() - required DBC '.$name.'.dbc not found!', CLI::LOG_ERROR); return false; } if (!$dbc->readFile()) { CLI::write('CLISetup::loadDBC() - DBC '.$name.'.dbc could not be written to DB!', CLI::LOG_ERROR); return false; } } break; } ?>