<commit_before><?php
namespace Gears\Framework\View\Helper;

use Gears\Framework\Debug;
use Gears\Framework\Session;
use Gears\Framework\View\Helper;

/**
 * Class DebugHelper
 * @package Gears\Framework\View\Helper
 * TODO: refactoring
 */
class DebugHelper extends Helper
{
    /**
     * Returns various system debug info
     *
     * @return string HTML content
     */
    public function get()
    {
        if (Debug::enabled()) {
            Debug::add('-- $_GET:', $_GET, '-- $_POST:', $_POST);
            Debug::add('-- QX_SESSION:', Session::get(null));

            return sprintf('%s<br />script <b>mem usage</b> %s<br />script <b>time</b> %s sec<br />',
                Debug::get(), Debug::getMemoryUsage(), Debug::scriptTime());
        }
    }

    /**
     *
     */
    public function console($opened = false)
    {
        if (Debug::enabled()):

            ob_start();

            ?>
            <!-- debug console -->
            <style type="text/css">
                #debug {
                    top: 0;
                    left: 0;
                    position: fixed;
                    width: 100%;
                    background-color: #333;
                    z-index: 1000;
                    opacity: 0.9;
                    -moz-box-shadow: 0 2px 10px #555;
                    -webkit-box-shadow: 0 2px 10px #555;
                    box-shadow: 0 2px 10px #555;
                }

                #debug-body pre {
                    font: normal 11pt consolas, "courier new", courier, monospace;
                    color: #cc5;
                    text-align: left;
                    margin: 5px 7px;
                }
            </style>
            <script type="text/javascript">
                (function () {
                    function toggle(el) {
                        el.style.display = (el.style.display == 'none') ? '' : 'none';
                    }

                    document.addEventListener("DOMContentLoaded", function () {
                        // console div container
                        var div = document.createElement('div');
                        div.setAttribute('id', 'debug');
                        div.innerHTML = '<div id="debug-body"><pre><?php echo str_replace("\n", '\\n', self::get()); ?></pre></div>';<commit_msg>Small style/console info changes<commit_after><?php
namespace Gears\Framework\View\Helper;

use Gears\Framework\Debug;
use Gears\Framework\Session;
use Gears\Framework\View\Helper;

/**
 * Class DebugHelper
 * @package Gears\Framework\View\Helper
 * TODO: refactoring
 */
class DebugHelper extends Helper
{
    /**
     * Returns various system debug info
     *
     * @return string HTML content
     */
    public function get()
    {
        if (Debug::enabled()) {
            Debug::add('-- $_GET:', $_GET, '-- $_POST:', $_POST);
            Debug::add('-- Gears\Framework\Session:', Session::get(null));

            return sprintf('%s<br />script <b>mem usage</b> %s<br />script <b>time</b> %s sec<br />',
                Debug::get(), Debug::getMemoryUsage(), Debug::scriptTime());
        }
    }

    /**
     *
     */
    public function console($opened = false)
    {
        if (Debug::enabled()):

            ob_start();

            ?>
            <!-- debug console -->
            <style type="text/css">
                #debug {
                    top: 0;
                    left: 0;
                    position: fixed;
                    width: 100%;
                    background-color: #333;
                    z-index: 1000;
                    opacity: 0.9;
                    -moz-box-shadow: 0 2px 10px #555;
                    -webkit-box-shadow: 0 2px 10px #555;
                    box-shadow: 0 2px 10px #555;
                }

                #debug-body pre {
                    font: normal 10pt consolas, "courier new", courier, monospace;
                    color: #eee;
                    text-align: left;
                    margin: 5px 7px;
                }
            </style>
            <script type="text/javascript">
                (function () {
                    function toggle(el) {
                        el.style.display = (el.style.display == 'none') ? '' : 'none';
                    }

                    document.addEventListener("DOMContentLoaded", function () {
                        // console div container
                        var div = document.createElement('div');
                        div.setAttribute('id', 'debug');
                        div.innerHTML = '<div id="debug-body"><pre><?php echo str_replace("\n", '\\n', self::get()); ?></pre></div>';
{'fraction_non_alphanumeric': 0.1406786941580756, 'fraction_numerical': 0.016967353951890033, 'mean_word_length': 1.308874566187407, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1187253', 'n_tokens_mistral': 1324, 'n_tokens_neox': 1191, 'n_words': 282}