<commit_before><?php

# Usage:
#
# Don't create instances, use static variables/methods instead.
#
# AdminConfig::init() : initialize the configuration class (call it once)
#
# AdminConfig::$tpl : template renderer
# 
# AdminConfig::$default_tpl_values : default values for templates
#

class AdminConfig {

    static $tpl;
    static $default_tpl_values;

    # initalize Twig
    static function tpl_init() {

        Twig_Autoloader::register();

        $loader = new Twig_Loader_Filesystem('views/templates');

        self::$tpl = new Twig_Environment($loader, array(
            'cache'            => dirname(__FILE__).'/cache/templates',
            'charset'          => 'utf-8',
            'strict_variables' => true,
            'autoescape'       => true
        ));

        self::$default_tpl_values = array(

            'site' => array(
                'root' => '/',

                'logo' => array(
                    'src'    => '',
                    'width'  => 0,
                    'height' => 0
                ),

                'title' => 'Administration IP7'

            ),

            'page' => array(
                'lang'        => 'fr',
                'charset'     => 'utf-8',
                'keywords'    => '',
                'description' => 'interface d\'administration d\' infop7.org'
            )
        );
    }

    # initialize Limonade
    static function routes_init() {

        # Controllers directory
        option('controllers_dir', dirname(__FILE__).'/controllers');
    }

    # call others *_init() methods
    static function init() {
        self::tpl_init();
        self::routes_init();
    }

};

?>
<commit_msg>AdminConfig class rewritten<commit_after><?php

require_once '../config.php';

# Helpers
require_once '../helpers/tpl.php';

# Usage:
#
# Don't create instances, use static variables/methods instead.
#
# AdminConfig::init() : initialize the configuration class (call it once)
#
# AdminConfig::$tpl : template renderer
# 
# AdminConfig::$default_tpl_values : default values for templates
#

class AdminConfig extends Config {

    # initalize Twig
    static function tpl_init() {

        Twig_Autoloader::register();

        self::$tpl = create_twig_environment(dirname(__FILE__).'/cache/templates');
    }

};

?>

{'fraction_non_alphanumeric': 0.13391304347826086, 'fraction_numerical': 0.0026086956521739132, 'mean_word_length': 2.055776892430279, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '6306262', 'n_tokens_mistral': 675, 'n_tokens_neox': 657, 'n_words': 141}