<commit_before><?php

/*
 * CONFIG 
 */
define('ENIC_PATH',dirname (__FILE__) . '/');

//get enic Action Group
require(ENIC_PATH.'enic.actiongroup.php');
//get enic Zone
require(ENIC_PATH.'enic.zone.php');
//get enic Service
require(ENIC_PATH.'enic.service.php');

/*
 * FACTORY
 */
class enic{

    //internal link
    static $l = array();

    /*
     * load block in global container
     */
    public static function load($type, $name = null){

        //load file 
        enic::to_load($type);

        //get name
        $name = (!empty($name)) ? enic::sanitize($name) : $type;

        if(in_array($name, self::$l))
            trigger_error('Item <em>'.$name.'</em> in <strong>ENIC ROOT CORE</strong> already exists', E_USER_WARNING);

        //load class in local ref
        $className = 'enic'.ucfirst($type);
        self::$l[$name] =& new $className();

        //add name attribute
        self::$l[$name]->_name = $name;

        //execute the startExec
        self::$l[$name]->startExec();

        //test if the class is a containor class :
        if(method_exists(self::$l[$name], 'getClass')){
            self::$l[$name] =& self::$l[$name]->getClass();
        }

        return self::$l[$name];
    }

    /*
     * Load only CLass' file & check if the class is callable<commit_msg>[FIX] Enic : Deprecated method...<commit_after><?php

/*
 * CONFIG 
 */
define('ENIC_PATH',dirname (__FILE__) . '/');

//get enic Action Group
require(ENIC_PATH.'enic.actiongroup.php');
//get enic Zone
require(ENIC_PATH.'enic.zone.php');
//get enic Service
require(ENIC_PATH.'enic.service.php');

/*
 * FACTORY
 */
class enic{

    //internal link
    static $l = array();

    /*
     * load block in global container
     */
    public static function load($type, $name = null){

        //load file 
        enic::to_load($type);

        //get name
        $name = (!empty($name)) ? enic::sanitize($name) : $type;

        if(in_array($name, self::$l))
            trigger_error('Item <em>'.$name.'</em> in <strong>ENIC ROOT CORE</strong> already exists', E_USER_WARNING);

        //load class in local ref
        $className = 'enic'.ucfirst($type);
        self::$l[$name] = new $className();

        //add name attribute
        self::$l[$name]->_name = $name;

        //execute the startExec
        self::$l[$name]->startExec();

        //test if the class is a containor class :
        if(method_exists(self::$l[$name], 'getClass')){
            self::$l[$name] =& self::$l[$name]->getClass();
        }

        return self::$l[$name];
    }

    /*
     * Load only CLass' file & check if the class is callable
{'fraction_non_alphanumeric': 0.17874762808349146, 'fraction_numerical': 0.0, 'mean_word_length': 2.4233766233766234, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '3916845', 'n_tokens_mistral': 851, 'n_tokens_neox': 836, 'n_words': 200}