<commit_before><?php
class Kwf_Component_Events
{
    protected $_config;
    public static $_indent = 0;

    protected function __construct($config = array())
    {
        $this->_config = $config;
        $this->_init();
    }

    public function getConfig()
    {
        return $this->_config;
    }

    protected function _init() {}

    /**
     * @return $this
     */
    public static final function getInstance($class, $config = array())
    {
        $id = md5(serialize(array($class, $config)));
        static $instances = array();
        if (!isset($instances[$id])) {
            $instances[$id] = new $class($config);
        }
        return $instances[$id];
    }

    public static final function getAllListeners()
    {
        $cacheId = 'Kwf_Component_Events_listeners';
        $listeners = Kwf_Cache_Simple::fetch($cacheId);
        if (!$listeners) {

            $eventObjects = array();
            foreach (Kwc_Abstract::getComponentClasses() as $componentClass) {
                $eventsClass = Kwc_Admin::getComponentClass($componentClass, 'Events');<commit_msg>use root component class for events cacheId<commit_after><?php
class Kwf_Component_Events
{
    protected $_config;
    public static $_indent = 0;

    protected function __construct($config = array())
    {
        $this->_config = $config;
        $this->_init();
    }

    public function getConfig()
    {
        return $this->_config;
    }

    protected function _init() {}

    /**
     * @return $this
     */
    public static final function getInstance($class, $config = array())
    {
        $id = md5(serialize(array($class, $config)));
        static $instances = array();
        if (!isset($instances[$id])) {
            $instances[$id] = new $class($config);
        }
        return $instances[$id];
    }

    public static final function getAllListeners()
    {
        $cacheId = 'Kwf_Component_Events_listeners'.Kwf_Component_Data_Root::getComponentClass();
        $listeners = Kwf_Cache_Simple::fetch($cacheId);
        if (!$listeners) {

            $eventObjects = array();
            foreach (Kwc_Abstract::getComponentClasses() as $componentClass) {
                $eventsClass = Kwc_Admin::getComponentClass($componentClass, 'Events');
{'fraction_non_alphanumeric': 0.13353900396650506, 'fraction_numerical': 0.0017628911414720142, 'mean_word_length': 2.580441640378549, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6852782', 'n_tokens_mistral': 646, 'n_tokens_neox': 628, 'n_words': 137}