mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
- moved shared setup functions from FileGen to new CLISetup
- removed web-setup - new CLI parameters --account : create initial account(s) --siteconfig : edit php/aowow config values --dbconfig : set up db connection --sql : create db content from world/dbc-tables --firstrun : [NYI] step by step initial setup - some fixes by the wayside * display required arena bracket for extendedCost * achievement chains are searchable again * category trees for factions should now be correct * trainer tab on spell detail page reapeared * userMenu item 'Settings' no longer breaks the page * display abilities of shapeshift in tab on spell detail page * corrected reading ?_sourcestrings for titles * fixed error on race detail page * added simple descriptions to skill detail page * fixed tab "reward from" (achievement) on title detail page * fixed alphabetical order of some filter-dropdowns * fixed skill colors for spells * fixed power display for rune-based spells, that also cost mana * added more information to zones * also check mail_loot_template for achivements * fixed bug, where loot_template-ids would be reused for multiple templates * display sourcemore for pvp-sources
This commit is contained in:
@@ -96,7 +96,7 @@ foreach ($sets as $k => $v)
|
||||
|
||||
|
||||
// handle occuring errors
|
||||
error_reporting($AoWoWconf && CFG_DEBUG ? (E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT)) : 0);
|
||||
error_reporting(!empty($AoWoWconf['aowow']) && CFG_DEBUG ? (E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT)) : 0);
|
||||
$errHandled = false;
|
||||
set_error_handler(function($errNo, $errStr, $errFile, $errLine) use (&$errHandled) {
|
||||
$errName = 'unknown error'; // errors not in this list can not be handled by set_error_handler (as per documentation) or are ignored
|
||||
@@ -126,15 +126,16 @@ set_error_handler(function($errNo, $errStr, $errFile, $errLine) use (&$errHandle
|
||||
Util::addNote(U_GROUP_STAFF, $errName.' - '.$errStr.' @ '.$errFile. ':'.$errLine);
|
||||
}
|
||||
|
||||
DB::Aowow()->query('INSERT INTO ?_errors (`date`, `version`, `phpError`, `file`, `line`, `query`, `userGroups`, `message`) VALUES (UNIX_TIMESTAMP(), ?d, ?d, ?, ?d, ?, ?d, ?) ON DUPLICATE KEY UPDATE `date` = UNIX_TIMESTAMP()',
|
||||
AOWOW_REVISION, $errNo, $errFile, $errLine, CLI ? 'CLI' : $_SERVER['QUERY_STRING'], User::$groups, $errStr
|
||||
);
|
||||
if (DB::isConnectable(DB_AOWOW))
|
||||
DB::Aowow()->query('INSERT INTO ?_errors (`date`, `version`, `phpError`, `file`, `line`, `query`, `userGroups`, `message`) VALUES (UNIX_TIMESTAMP(), ?d, ?d, ?, ?d, ?, ?d, ?) ON DUPLICATE KEY UPDATE `date` = UNIX_TIMESTAMP()',
|
||||
AOWOW_REVISION, $errNo, $errFile, $errLine, CLI ? 'CLI' : $_SERVER['QUERY_STRING'], User::$groups, $errStr
|
||||
);
|
||||
|
||||
return !(User::isInGroup(U_GROUP_STAFF) && defined('CFG_DEBUG') && CFG_DEBUG);
|
||||
return !((User::isInGroup(U_GROUP_STAFF) && defined('CFG_DEBUG') && CFG_DEBUG) || CLI);
|
||||
}, E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT));
|
||||
|
||||
|
||||
$secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || ($AoWoWconf && CFG_FORCE_SSL);
|
||||
$secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || (!empty($AoWoWconf['aowow']) && CFG_FORCE_SSL);
|
||||
if (defined('CFG_STATIC_HOST')) // points js to images & scripts
|
||||
define('STATIC_URL', ($secure ? 'https://' : 'http://').CFG_STATIC_HOST);
|
||||
|
||||
@@ -148,7 +149,7 @@ if (!CLI)
|
||||
session_set_cookie_params(15 * YEAR, '/', '', $secure, true);
|
||||
session_cache_limiter('private');
|
||||
session_start();
|
||||
if ($AoWoWconf && User::init())
|
||||
if (!empty($AoWoWconf['aowow']) && User::init())
|
||||
User::save(); // save user-variables in session
|
||||
|
||||
// todo: (low) - move to setup web-interface (when it begins its existance)
|
||||
@@ -158,7 +159,7 @@ if (!CLI)
|
||||
|
||||
define('HOST_URL', ($secure ? 'https://' : 'http://').$host);
|
||||
define('STATIC_URL', ($secure ? 'https://' : 'http://').$host.'/static');
|
||||
if (User::isInGroup(U_GROUP_ADMIN) && $AoWoWconf) // initial set
|
||||
if (User::isInGroup(U_GROUP_ADMIN) && !empty($AoWoWconf['aowow'])) // initial set
|
||||
{
|
||||
DB::Aowow()->query('INSERT IGNORE INTO ?_config VALUES (?, ?, ?d, ?), (?, ?, ?d, ?)',
|
||||
'site_host', $host, CON_FLAG_TYPE_STRING | CON_FLAG_PERSISTENT, 'default: '.$host.' - points js to executable files (automaticly set on first run)',
|
||||
@@ -169,7 +170,7 @@ if (!CLI)
|
||||
|
||||
// hard-override locale for this call (should this be here..?)
|
||||
// all strings attached..
|
||||
if ($AoWoWconf)
|
||||
if (!empty($AoWoWconf['aowow']))
|
||||
{
|
||||
if (isset($_GET['locale']) && (CFG_LOCALES & (1 << (int)$_GET['locale'])))
|
||||
User::useLocale($_GET['locale']);
|
||||
@@ -185,10 +186,9 @@ if (!CLI)
|
||||
|
||||
Util::$wowheadLink = 'http://'.Util::$subDomains[User::$localeId].'.wowhead.com/'.$str;
|
||||
}
|
||||
else if ($AoWoWconf)
|
||||
else if (!empty($AoWoWconf['aowow']))
|
||||
Lang::load('enus');
|
||||
|
||||
|
||||
$AoWoWconf = null; // empty auths
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user