<commit_before><?php


class Initializer {

    public static function initialize() {
        set_include_path(get_include_path() . PATH_SEPARATOR . "core");
        set_include_path(get_include_path() . PATH_SEPARATOR . "modules");
        set_include_path(get_include_path() . PATH_SEPARATOR . "config");
        set_include_path(get_include_path() . PATH_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "lib");
        set_include_path(get_include_path() . PATH_SEPARATOR . "app");
        set_include_path(get_include_path() . PATH_SEPARATOR . "app" . DIRECTORY_SEPARATOR . "coreLib");
        set_include_path(get_include_path() . PATH_SEPARATOR . "moduleLib");
        set_include_path(get_include_path() . PATH_SEPARATOR . "plugin");


        //set module paths
        $root = PathService::getInstance()->getRootDir();
        $modulePath = $root . DIRECTORY_SEPARATOR . "modules";
        $moduleFolders = Initializer::getDirectory($modulePath, TRUE);
        foreach ($moduleFolders as $i => $mfolder)
        {
            $fd = trim($mfolder);
            $rp = trim($modulePath) . DIRECTORY_SEPARATOR;
            $f = "modules" .DIRECTORY_SEPARATOR .str_replace($rp, "", $fd);
            set_include_path(get_include_path() . PATH_SEPARATOR . $f);
        }
        $Config = Config::getInstance();
        //set time zone
        if (!is_null($Config->getTimezone())) {
            date_default_timezone_set($Config->getTimezone());
        }
        /*
         * include folders under moduleLib, coreLib, plug-in
         *  
         */
        $plugIn = $root . DIRECTORY_SEPARATOR . "plugin";
        $coreLib = $root . DIRECTORY_SEPARATOR . "app" . DIRECTORY_SEPARATOR . "coreLib";
        $moduleLib = $root . DIRECTORY_SEPARATOR . "moduleLib";

        $plugInFolders = Initializer::getDirectory($plugIn, TRUE);
        foreach ($plugInFolders as $i => $folder1)
        {
            $fd = trim($folder1);
            $rp = trim($plugIn) . DIRECTORY_SEPARATOR;
            $f = "plugin" .DIRECTORY_SEPARATOR .str_replace($rp, "", $fd);           
            set_include_path(get_include_path() . PATH_SEPARATOR . $f);
        }
        
         
        $coreLibFolders = Initializer::getDirectory($coreLib, TRUE);
        foreach ($coreLibFolders as $i => $folder1)
        {
            $fd = trim($folder1);
            $rp = trim($coreLib) . DIRECTORY_SEPARATOR;
            $f = "app" . DIRECTORY_SEPARATOR . "coreLib" .DIRECTORY_SEPARATOR .str_replace($rp, "", $fd);
            set_include_path(get_include_path() . PATH_SEPARATOR . $f);
        }
        
        $moduleLibFolders = Initializer::getDirectory($moduleLib, TRUE);
        foreach ($moduleLibFolders as $i => $folder1)
        {
            $fd = trim($folder1);
            $rp = trim($moduleLib) . DIRECTORY_SEPARATOR;
            $f = "moduleLib" .DIRECTORY_SEPARATOR .str_replace($rp, "", $fd);
            set_include_path(get_include_path() . PATH_SEPARATOR . $f);
        }

    }<commit_msg>restructure the folder from moduleLib to share and change corresponding code<commit_after><?php


class Initializer {

    public static function initialize() {
        set_include_path(get_include_path() . PATH_SEPARATOR . "core");
        set_include_path(get_include_path() . PATH_SEPARATOR . "modules");
        set_include_path(get_include_path() . PATH_SEPARATOR . "config");
        set_include_path(get_include_path() . PATH_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "lib");
        set_include_path(get_include_path() . PATH_SEPARATOR . "app");
        set_include_path(get_include_path() . PATH_SEPARATOR . "app" . DIRECTORY_SEPARATOR . "coreLib");
        set_include_path(get_include_path() . PATH_SEPARATOR . "common");
        set_include_path(get_include_path() . PATH_SEPARATOR . "plugin");


        //set module paths
        $root = PathService::getInstance()->getRootDir();
        $modulePath = $root . DIRECTORY_SEPARATOR . "modules";
        $moduleFolders = Initializer::getDirectory($modulePath, TRUE);
        foreach ($moduleFolders as $i => $mfolder)
        {
            $fd = trim($mfolder);
            $rp = trim($modulePath) . DIRECTORY_SEPARATOR;
            $f = "modules" .DIRECTORY_SEPARATOR .str_replace($rp, "", $fd);
            set_include_path(get_include_path() . PATH_SEPARATOR . $f);
        }
        $Config = Config::getInstance();
        //set time zone
        if (!is_null($Config->getTimezone())) {
            date_default_timezone_set($Config->getTimezone());
        }
        /*
         * include folders under share, coreLib, plug-in
         *  
         */
        $plugIn = $root . DIRECTORY_SEPARATOR . "plugin";
        $coreLib = $root . DIRECTORY_SEPARATOR . "app" . DIRECTORY_SEPARATOR . "coreLib";
        $moduleLib = $root . DIRECTORY_SEPARATOR . "share";

        $plugInFolders = Initializer::getDirectory($plugIn, TRUE);
        foreach ($plugInFolders as $i => $folder1)
        {
            $fd = trim($folder1);
            $rp = trim($plugIn) . DIRECTORY_SEPARATOR;
            $f = "plugin" .DIRECTORY_SEPARATOR .str_replace($rp, "", $fd);           
            set_include_path(get_include_path() . PATH_SEPARATOR . $f);
        }
        
         
        $coreLibFolders = Initializer::getDirectory($coreLib, TRUE);
        foreach ($coreLibFolders as $i => $folder1)
        {
            $fd = trim($folder1);
            $rp = trim($coreLib) . DIRECTORY_SEPARATOR;
            $f = "app" . DIRECTORY_SEPARATOR . "coreLib" .DIRECTORY_SEPARATOR .str_replace($rp, "", $fd);
            set_include_path(get_include_path() . PATH_SEPARATOR . $f);
        }
        
        $moduleLibFolders = Initializer::getDirectory($moduleLib, TRUE);
        foreach ($moduleLibFolders as $i => $folder1)
        {
            $fd = trim($folder1);
            $rp = trim($moduleLib) . DIRECTORY_SEPARATOR;
            $f = "share" .DIRECTORY_SEPARATOR .str_replace($rp, "", $fd);
            set_include_path(get_include_path() . PATH_SEPARATOR . $f);
        }

    }
{'fraction_non_alphanumeric': 0.1314569536423841, 'fraction_numerical': 0.001986754966887417, 'mean_word_length': 2.4226628895184135, 'pattern_counts': {'":': 0, '<': 5, '<?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': '617076', 'n_tokens_mistral': 1927, 'n_tokens_neox': 1865, 'n_words': 326}