Use global namespace

This commit is contained in:
Dennis Eichhorn 2019-04-27 00:13:26 +02:00
parent ac3c2a8c16
commit 1dc7f5d299
3 changed files with 16 additions and 16 deletions

View File

@ -22,11 +22,11 @@ echo $this->getData('nav')->render(); ?>
<div class="inner"> <div class="inner">
<table class="list wf-100"> <table class="list wf-100">
<tbody> <tbody>
<tr><td><?= $this->getHtml('OS'); ?><td><?= $this->printHtml(php_uname('s')); ?> <tr><td><?= $this->getHtml('OS'); ?><td><?= $this->printHtml(\php_uname('s')); ?>
<tr><td><?= $this->getHtml('Version'); ?><td><?= $this->printHtml(php_uname('v')); ?> <tr><td><?= $this->getHtml('Version'); ?><td><?= $this->printHtml(\php_uname('v')); ?>
<tr><td><?= $this->getHtml('Release'); ?><td><?= $this->printHtml(php_uname('r')); ?> <tr><td><?= $this->getHtml('Release'); ?><td><?= $this->printHtml(\php_uname('r')); ?>
<tr><td><?= $this->getHtml('RAMUsage'); ?><td><?= $this->printHtml(memory_get_usage(true)/(1024*1024)); ?> MB <tr><td><?= $this->getHtml('RAMUsage'); ?><td><?= $this->printHtml(\memory_get_usage(true)/(1024*1024)); ?> MB
<tr><td><?= $this->getHtml('MemoryLimit'); ?><td><?= $this->printHtml(ini_get('memory_limit')); ?> <tr><td><?= $this->getHtml('MemoryLimit'); ?><td><?= $this->printHtml(\ini_get('memory_limit')); ?>
<tr><td><?= $this->getHtml('SystemRAM'); ?><td><?= $this->printHtml(\phpOMS\System\SystemUtils::getRAM()/(1024)); ?> MB <tr><td><?= $this->getHtml('SystemRAM'); ?><td><?= $this->printHtml(\phpOMS\System\SystemUtils::getRAM()/(1024)); ?> MB
<tr><td><?= $this->getHtml('CPUUsage'); ?><td><?= $this->printHtml(\phpOMS\System\SystemUtils::getCpuUsage()); ?>% <tr><td><?= $this->getHtml('CPUUsage'); ?><td><?= $this->printHtml(\phpOMS\System\SystemUtils::getCpuUsage()); ?>%
</table> </table>
@ -48,7 +48,7 @@ echo $this->getData('nav')->render(); ?>
<tr><td><?= $this->getHtml('Notices'); ?><td><?= $this->printHtml($logs['notice'] ?? 0); ?> <tr><td><?= $this->getHtml('Notices'); ?><td><?= $this->printHtml($logs['notice'] ?? 0); ?>
<tr><td><?= $this->getHtml('Info'); ?><td><?= $this->printHtml($logs['info'] ?? 0); ?> <tr><td><?= $this->getHtml('Info'); ?><td><?= $this->printHtml($logs['info'] ?? 0); ?>
<tr><td><?= $this->getHtml('Debug'); ?><td><?= $this->printHtml($logs['debug'] ?? 0); ?> <tr><td><?= $this->getHtml('Debug'); ?><td><?= $this->printHtml($logs['debug'] ?? 0); ?>
<tr><td><?= $this->getHtml('Total'); ?><td><?= $this->printHtml(array_sum($logs)); ?> <tr><td><?= $this->getHtml('Total'); ?><td><?= $this->printHtml(\array_sum($logs)); ?>
</table> </table>
</div> </div>
</section> </section>

View File

@ -15,16 +15,16 @@
*/ */
$log = $this->app->logger->getByLine((int) $this->request->getData('id') ?? 1); $log = $this->app->logger->getByLine((int) $this->request->getData('id') ?? 1);
$temp = trim($log['backtrace']); $temp = \trim($log['backtrace']);
$log['backtrace'] = \json_decode($temp, true); $log['backtrace'] = \json_decode($temp, true);
$details = '* Uri: `' . trim($log['path']) . "`\n" $details = '* Uri: `' . \trim($log['path']) . "`\n"
. '* Level: `' . trim($log['level']) . "`\n" . '* Level: `' . \trim($log['level']) . "`\n"
. '* Message: `' . trim($log['message']) . "`\n" . '* Message: `' . \trim($log['message']) . "`\n"
. '* File: `' . trim($log['file']) . "`\n" . '* File: `' . \trim($log['file']) . "`\n"
. '* Line: `' . trim($log['line']) . "`\n" . '* Line: `' . \trim($log['line']) . "`\n"
. '* Version: `' . trim($log['version']) . "`\n" . '* Version: `' . \trim($log['version']) . "`\n"
. '* OS: `' . trim($log['os']) . "`\n\n" . '* OS: `' . \trim($log['os']) . "`\n\n"
. "Backtrace: \n\n```\n" . \json_encode($log['backtrace'], JSON_PRETTY_PRINT); . "Backtrace: \n\n```\n" . \json_encode($log['backtrace'], JSON_PRETTY_PRINT);
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
@ -84,7 +84,7 @@ echo $this->getData('nav')->render(); ?>
<pre><?= $this->printHtml(\json_encode($log['backtrace'], JSON_PRETTY_PRINT)); ?></pre> <pre><?= $this->printHtml(\json_encode($log['backtrace'], JSON_PRETTY_PRINT)); ?></pre>
<tr> <tr>
<td colspan="3" style="padding-top: 10px"><a class="button" target="_blank" <td colspan="3" style="padding-top: 10px"><a class="button" target="_blank"
href="https://gitreports.com/issue/Orange-Management/Orange-Management/?name=Guest&issue_title=<?= $this->printHtml(urlencode($log['message'])); ?>&details=<?= $this->printHtml(urlencode($details)); ?>"><?= $this->getHtml('Report') ?></a> href="https://gitreports.com/issue/Orange-Management/Orange-Management/?name=Guest&issue_title=<?= $this->printHtml(\urlencode($log['message'])); ?>&details=<?= $this->printHtml(\urlencode($details)); ?>"><?= $this->getHtml('Report') ?></a>
</table> </table>
</div> </div>
</section> </section>

View File

@ -13,7 +13,7 @@
/** /**
* @var \phpOMS\Views\View $this * @var \phpOMS\Views\View $this
*/ */
$logs = array_reverse($this->app->logger->get(25), true); $logs = \array_reverse($this->app->logger->get(25), true);
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>