<commit_before><?php

namespace Service\Debug;

use \PDO;
use \PDOException;
use \Exception;
use \DebugBar;
use \DebugBar\StandardDebugBar;


class Debug extends StandardDebugBar
{
    protected static $instance;
    protected static $url;
    protected static $resources;

    public static function init()
    {
        $config = autoload_config();

        self::setBaseUrl(URL . $config['app']['DEBUGBAR_RESOURCES']);
        self::setBaseDir(DOC_ROOT . $config['app']['DEBUGBAR_RESOURCES']);

        self::$instance = new \DebugBar\StandardDebugBar();

        self::collectorConfig(require DOC_ROOT.'app/Config/App.php', 'config-app');
        self::collectorConfig(require DOC_ROOT.'app/Config/Database.php', 'config-database');
        self::collectorTimeLine('teste', 'Teste de timeline', null);
    }

    public static function setBaseUrl($url)
    {
        self::$url = $url;
    }

    public static function getBaseUrl()
    {
        return self::$url;
    }

    public static function setBaseDir($dir)
    {
        self::$resources = $dir;
    }

    public static function getBaseDir()<commit_msg>carrega todos os arquivos de configuracoes no debugbar automaticamente<commit_after><?php

namespace Service\Debug;

use \PDO;
use \PDOException;
use \Exception;
use \DebugBar;
use \DebugBar\StandardDebugBar;

class Debug extends StandardDebugBar
{
    protected static $instance;
    protected static $url;
    protected static $resources;

    public static function init()
    {
        $config = autoload_config();

        self::setBaseUrl(URL . $config['app']['DEBUGBAR_RESOURCES']);
        self::setBaseDir(DOC_ROOT . $config['app']['DEBUGBAR_RESOURCES']);

        self::$instance = new \DebugBar\StandardDebugBar();

        foreach(glob(DOC_ROOT . 'app/Config/*.php') as $file) {
            if(file_exists($file)) {
                $name = explode('/', $file);
                $name = end($name);
                $name = str_replace('.php', '', $name);
                self::collectorConfig(require $file, 'Config-' . $name);
            }
        }

        self::collectorTimeLine('teste', 'Teste de timeline', null);
    }

    public static function setBaseUrl($url)
    {
        self::$url = $url;
    }

    public static function getBaseUrl()
    {
        return self::$url;
    }

    public static function setBaseDir($dir)
    {
        self::$resources = $dir;
    }

    public static function getBaseDir()
{'fraction_non_alphanumeric': 0.13224489795918368, 'fraction_numerical': 0.0, 'mean_word_length': 2.817757009345794, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3921975', 'n_tokens_mistral': 745, 'n_tokens_neox': 717, 'n_words': 162}