<commit_before><?php

    namespace thebuggenie\modules\bootgenie;

    use thebuggenie\core\framework;

    /**
     * Autogenerated module Bootgenie
     *
     * @author
     * @version 0.1
     * @license http://opensource.org/licenses/MPL-2.0 Mozilla Public License 2.0 (MPL 2.0)
     * @package bootgenie
     * @subpackage core
		 *
     * @Table(name="\thebuggenie\core\entities\tables\Modules")
     */
    class Bootgenie extends \thebuggenie\core\entities\Module
    {

        const VERSION = '0.1';

        protected $_longname = 'Bootgenie';
        protected $_description = 'Bootgenie description here';
        protected $_module_config_title = 'Bootgenie';
        protected $_module_config_description = 'Set up the Bootgenie module from this section';

        protected $_enabled = false;
        protected $_overridemap = ['components'=>[], 'actions'=>[]];

        /**
         * Return an instance of this module
         *
         * @return Bootgenie
         */
        public static function getModule()
        {
            return framework\Context::getModule('bootgenie');
        }

        /**
         * Add an override rule to the override map
         *
         * @return NULL
         */
        public function addOverride($original, $override, $type='component')
        {
            // $new_array = [$original => $override];
            if ( $type == 'component' ){
                $this->_overridemap['components'][$original] = $override;
            } elseif ( $type == 'action' ){
                $this->_overridemap['actions'][$original] = $override;
            }
        }

        /**
         * Get an override map compatible with framework\Routing::setComponentOverrideMap
         *
         * @return array
         */
        public function getComponentOverrideMap()
        {
            $return_array = [];
            foreach($this->_overridemap['components'] as $key=>$value){
                list($module, $method) = explode('/', $value);
                $return_array[$key] = ['module'=>$module, 'method'=>$method];
            }
            return $return_array;
        }

        /**
         * Get an override map containing all the actions
         *
         * @return array
         */
        public function getActionOverrideMap()
        {
            $return_array = [];
            foreach($this->_overridemap['actions'] as $key=>$value){
                list($class, $action) = explode('/', $key);
                $return_array[$key] = ['class'=>$class, 'action'=>$action, 'template'=>$value];
            }
            return $return_array;
        }

        protected function _initialize()
        {
            define('BOOTGENIE_PATH', THEBUGGENIE_PATH . 'modules/bootgenie/');

            // Add override rules
            self::addOverride('publish/menustriplinks', 'bootgenie/publish_menustriplinks', 'component');
            self::addOverride('main/index', 'bootgenie/main_index', 'action');
            self::addOverride('main/menulinks', 'bootgenie/main_menulinks', 'component');
        }

        protected function _addListeners()
        {
            if (true) {
                // listen for renderTemplate (overwrite module action templates)
                framework\Event::listen('core', 'self::performAction::renderTemplate', array($this, 'listen_renderTemplate'));
                // listen for renderBegins (overwrite layout and components)
                framework\Event::listen('core', '\thebuggenie\core\framework\Context::renderBegins', array($this, 'listen_renderBegins'));
            }
        }

        protected function _install($scope)
        {
        }

        protected function _loadFixtures($scope)
        {
        }
<commit_msg>Add checking for inherited _enabled variable<commit_after><?php

    namespace thebuggenie\modules\bootgenie;

    use thebuggenie\core\framework;

    /**
     * Autogenerated module Bootgenie
     *
     * @author
     * @version 0.1
     * @license http://opensource.org/licenses/MPL-2.0 Mozilla Public License 2.0 (MPL 2.0)
     * @package bootgenie
     * @subpackage core
		 *
     * @Table(name="\thebuggenie\core\entities\tables\Modules")
     */
    class Bootgenie extends \thebuggenie\core\entities\Module
    {

        const VERSION = '0.1';

        protected $_longname = 'Bootgenie';
        protected $_description = 'Bootgenie description here';
        protected $_module_config_title = 'Bootgenie';
        protected $_module_config_description = 'Set up the Bootgenie module from this section';

        protected $_overridemap = ['components'=>[], 'actions'=>[]];

        /**
         * Return an instance of this module
         *
         * @return Bootgenie
         */
        public static function getModule()
        {
            return framework\Context::getModule('bootgenie');
        }

        /**
         * Add an override rule to the override map
         *
         * @return NULL
         */
        public function addOverride($original, $override, $type='component')
        {
            // $new_array = [$original => $override];
            if ( $type == 'component' ){
                $this->_overridemap['components'][$original] = $override;
            } elseif ( $type == 'action' ){
                $this->_overridemap['actions'][$original] = $override;
            }
        }

        /**
         * Get an override map compatible with framework\Routing::setComponentOverrideMap
         *
         * @return array
         */
        public function getComponentOverrideMap()
        {
            $return_array = [];
            foreach($this->_overridemap['components'] as $key=>$value){
                list($module, $method) = explode('/', $value);
                $return_array[$key] = ['module'=>$module, 'method'=>$method];
            }
            return $return_array;
        }

        /**
         * Get an override map containing all the actions
         *
         * @return array
         */
        public function getActionOverrideMap()
        {
            $return_array = [];
            foreach($this->_overridemap['actions'] as $key=>$value){
                list($class, $action) = explode('/', $key);
                $return_array[$key] = ['class'=>$class, 'action'=>$action, 'template'=>$value];
            }
            return $return_array;
        }

        protected function _initialize()
        {
            define('BOOTGENIE_PATH', THEBUGGENIE_PATH . 'modules/bootgenie/');

            // Add override rules
            self::addOverride('publish/menustriplinks', 'bootgenie/publish_menustriplinks', 'component');
            self::addOverride('main/index', 'bootgenie/main_index', 'action');
            self::addOverride('main/menulinks', 'bootgenie/main_menulinks', 'component');

            // Disable for testing
            // $this->_enabled = false;
        }

        protected function _addListeners()
        {
            if ( $this->_enabled == true ) {
                // listen for renderTemplate (overwrite module action templates)
                framework\Event::listen('core', 'self::performAction::renderTemplate', array($this, 'listen_renderTemplate'));
                // listen for renderBegins (overwrite layout and components)
                framework\Event::listen('core', '\thebuggenie\core\framework\Context::renderBegins', array($this, 'listen_renderBegins'));
            }
        }

        protected function _install($scope)
        {
        }

        protected function _loadFixtures($scope)
        {
        }

{'fraction_non_alphanumeric': 0.1281443434742526, 'fraction_numerical': 0.0026340050046095085, 'mean_word_length': 1.9698865858427845, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '1915608', 'n_tokens_mistral': 2026, 'n_tokens_neox': 1972, 'n_words': 416}