Select($queryGlyphs);
$locales = [LOCALE_EN, LOCALE_FR, LOCALE_DE, LOCALE_ES, LOCALE_RU];
// check directory-structure
foreach (Util::$localeStrings as $dir)
if (!is_dir('datasets\\'.$dir))
mkdir('datasets\\'.$dir, 0755, true);
echo "script set up in ".Util::execTime()."
\n";
$glyphSpells = new SpellList(array(['s.id', array_keys($glyphList)], 0));
foreach ($locales as $lId)
{
User::useLocale($lId);
$glyphsOut = [];
while ($glyphSpells->iterate())
{
$pop = $glyphList[$glyphSpells->id];
if (!$pop['glyphEffect'])
continue;
if ($glyphSpells->getField('effect1Id') != 6 && $glyphSpells->getField('effect2Id') != 6 && $glyphSpells->getField('effect3Id') != 6)
continue;
$glyphsOut[$pop['itemId']] = array(
'name' => Util::localizedString($pop, 'name'),
'description' => $glyphSpells->parseText()[0],
'icon' => $pop['icon'],
'type' => $pop['type'],
'classs' => $pop['classs'],
'skill' => $pop['skillId'],
'level' => $pop['level']
);
}
$toFile = "var g_glyphs = ";
$toFile .= json_encode($glyphsOut, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK);
$toFile .= ";";
$file = 'datasets\\'.User::$localeString.'\\glyphs';
$handle = fOpen($file, "w");
fWrite($handle, $toFile);
fClose($handle);
echo "done glyphs loc: ".$lId." in ".Util::execTime()."
\n";
}
echo "
\nall done";
User::useLocale(LOCALE_EN);
$stats = DB::Aowow()->getStatistics();
echo "
\n".$stats['count']." queries in: ".Util::formatTime($stats['time'] * 1000);
?>