mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Config/Profiler
* update config to enable/disable profiler in general, instead of just the queue * regenerate affected files on config change
This commit is contained in:
@@ -471,7 +471,8 @@ class AjaxAdmin extends AjaxHandler
|
||||
$msg .= ' * remember to rebuild all static files for the language you just added.<br />';
|
||||
$msg .= ' * you can speed this up by supplying the regionCode to the setup: <pre class="q1">--locales=<regionCodes,> -f</pre>';
|
||||
break;
|
||||
case 'profiler_queue':
|
||||
case 'profiler_enable':
|
||||
$buildList = 'realms,realmMenu';
|
||||
$fn = function($x) use (&$msg) {
|
||||
if (!$x)
|
||||
return true;
|
||||
|
||||
@@ -47,6 +47,9 @@ class AjaxProfile extends AjaxHandler
|
||||
if (!$this->params)
|
||||
return;
|
||||
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
return;
|
||||
|
||||
switch ($this->params[0])
|
||||
{
|
||||
case 'unlink':
|
||||
|
||||
@@ -244,7 +244,7 @@ class Profiler
|
||||
|
||||
public static function resyncStatus($type, array $subjectGUIDs)
|
||||
{
|
||||
$response = [CFG_PROFILER_QUEUE ? 2 : 0]; // in theory you could have multiple queues; used as divisor for: (15 / x) + 2
|
||||
$response = [CFG_PROFILER_ENABLE ? 2 : 0]; // in theory you could have multiple queues; used as divisor for: (15 / x) + 2
|
||||
if (!$subjectGUIDs)
|
||||
$response[] = [PR_QUEUE_STATUS_ENDED, 0, 0, PR_QUEUE_ERROR_CHAR];
|
||||
else
|
||||
|
||||
@@ -20,6 +20,9 @@ class ArenaTeamPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
$this->error();
|
||||
|
||||
$params = array_map('urldecode', explode('.', $pageParam));
|
||||
if ($params[0])
|
||||
$params[0] = Profiler::urlize($params[0]);
|
||||
|
||||
@@ -17,6 +17,9 @@ class ArenaTeamsPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
$this->error();
|
||||
|
||||
$this->getSubjectFromUrl($pageParam);
|
||||
|
||||
$this->filterObj = new ArenaTeamListFilter();
|
||||
|
||||
@@ -20,6 +20,9 @@ class GuildPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
$this->error();
|
||||
|
||||
$params = array_map('urldecode', explode('.', $pageParam));
|
||||
if ($params[0])
|
||||
$params[0] = Profiler::urlize($params[0]);
|
||||
|
||||
@@ -17,6 +17,9 @@ class GuildsPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
$this->error();
|
||||
|
||||
$this->getSubjectFromUrl($pageParam);
|
||||
|
||||
$this->filterObj = new GuildListFilter();
|
||||
|
||||
@@ -13,6 +13,14 @@ class ProfilerPage extends GenericPage
|
||||
protected $js = ['profile_all.js', 'profile.js'];
|
||||
protected $css = [['path' => 'Profiler.css']];
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
$this->error();
|
||||
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
}
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addJS('?data=realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
||||
|
||||
@@ -20,6 +20,9 @@ class ProfilesPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
$this->error();
|
||||
|
||||
$this->getSubjectFromUrl($pageParam);
|
||||
|
||||
$realms = [];
|
||||
|
||||
4
prQueue
4
prQueue
@@ -41,8 +41,8 @@ $error = function ($type, $typeId, $realmId)
|
||||
};
|
||||
|
||||
|
||||
// if (CFG_PROFILER_QUEUE) - wont work because it is not redefined if changed in config
|
||||
while (DB::Aowow()->selectCell('SELECT value FROM ?_config WHERE `key` = "profiler_queue"'))
|
||||
// if (CFG_PROFILER_ENABLE) - wont work because it is not redefined if changed in config
|
||||
while (DB::Aowow()->selectCell('SELECT value FROM ?_config WHERE `key` = "profiler_enable"'))
|
||||
{
|
||||
if (($tDiff = (microtime(true) - $tCycle)) < (CFG_PROFILER_QUEUE_DELAY / 1000))
|
||||
{
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -46,7 +46,8 @@ function siteconfig()
|
||||
CLI::write(' * remember to rebuild all static files for the language you just added.', CLI::LOG_INFO);
|
||||
CLI::write(' * you can speed this up by supplying the regionCode to the setup: '.CLI::bold('--locales=<regionCodes,> -f'));
|
||||
break;
|
||||
case 'profiler_queue':
|
||||
case 'profiler_enable':
|
||||
array_push($updScripts, 'realms', 'realmMenu');
|
||||
$fn = function($x) {
|
||||
if (!$x)
|
||||
return true;
|
||||
|
||||
2
setup/updates/1522146994_01.sql
Normal file
2
setup/updates/1522146994_01.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
DELETE FROM `aowow_config` WHERE `key` IN ('profiler_queue', 'profiler_enable');
|
||||
INSERT INTO `aowow_config` VALUES ('profiler_enable', '0', 7, 132, 'default: 0 - enable/disable profiler feature');
|
||||
Reference in New Issue
Block a user