<commit_before><?php
class Kwf_Acl extends Zend_Acl
{
    protected $_componentAclClass = 'Kwf_Component_Acl';

    /**
     * @var Kwf_Component_Acl
     */
    protected $_componentAcl;
    protected $_kwcResourcesLoaded = false;


    public static function getInstance()
    {
        static $i;
        if (!isset($i)) {
            $t = microtime(true);
            $m = memory_get_usage();
            $cacheId = 'acl';
            $i = Kwf_Cache_Simple::fetch($cacheId);
            if ($i === false) {
                $class = Kwf_Config::getValue('aclClass');
                $i = new $class();
                $i->loadKwcResources();
                Kwf_Cache_Simple::add($cacheId, $i);
                Kwf_Benchmark::subCheckpoint('create Acl', microtime(true)-$t);
            } else {
                Kwf_Benchmark::subCheckpoint('load cached Acl '.round((memory_get_usage()-$m) / (1024*1024), 2).'MB', microtime(true)-$t);
            }
        }
        return $i;
    }

    public static function clearCache()
    {
        $cacheId = 'acl';
        Kwf_Cache_Simple::delete($cacheId);
    }

    public function __construct()
    {
        $this->addRole(new Zend_Acl_Role('guest'));
        $this->addRole(new Kwf_Acl_Role_Admin('admin', trlKwfStatic('Administrator')));

        $this->add(new Zend_Acl_Resource('default_index'));
        $this->add(new Zend_Acl_Resource('kwf_user_menu'));
        $this->add(new Zend_Acl_Resource('kwf_user_changeuser'));
        $this->add(new Zend_Acl_Resource('kwf_user_about'));
        $this->add(new Zend_Acl_Resource('kwf_welcome_index'));
        $this->add(new Zend_Acl_Resource('kwf_welcome_content'));
        $this->add(new Zend_Acl_Resource('kwf_welcome_welcome'));
        $this->add(new Zend_Acl_Resource('kwf_debug'));
        $this->add(new Zend_Acl_Resource('kwf_debug_session-restart'), 'kwf_debug');
        $this->add(new Zend_Acl_Resource('kwf_debug_php-info'), 'kwf_debug');
        $this->add(new Zend_Acl_Resource('kwf_debug_apc'), 'kwf_debug');
        $this->add(new Zend_Acl_Resource('kwf_debug_assets-dependencies'), 'kwf_debug');
        $this->add(new Zend_Acl_Resource('kwf_debug_benchmark'), 'kwf_debug');
        $this->add(new Zend_Acl_Resource('kwf_debug_benchmark-counter'));
        $this->add(new Zend_Acl_Resource('kwf_media_upload'));
        $this->add(new Zend_Acl_Resource('kwf_media_post-back'));
        $this->add(new Zend_Acl_Resource('kwf_maintenance_setup'));
        $this->add(new Zend_Acl_Resource('kwf_maintenance_update'));
        $this->add(new Zend_Acl_Resource('kwf_maintenance_clear-cache'));
        $this->add(new Zend_Acl_Resource('kwf_maintenance_update-downloader'));
        $this->add(new Zend_Acl_Resource('kwf_maintenance_fulltext'));
        $this->add(new Zend_Acl_Resource('edit_role'));
        $this->add(new Kwf_Acl_Resource_EditRole('edit_role_admin', 'admin'), 'edit_role');

        $this->add(new Kwf_Acl_Resource_UserSelf('kwf_user_self', '/kwf/user/self'));<commit_msg>Change guest role to a named role<commit_after><?php
class Kwf_Acl extends Zend_Acl
{
    protected $_componentAclClass = 'Kwf_Component_Acl';

    /**
     * @var Kwf_Component_Acl
     */
    protected $_componentAcl;
    protected $_kwcResourcesLoaded = false;


    public static function getInstance()
    {
        static $i;
        if (!isset($i)) {
            $t = microtime(true);
            $m = memory_get_usage();
            $cacheId = 'acl';
            $i = Kwf_Cache_Simple::fetch($cacheId);
            if ($i === false) {
                $class = Kwf_Config::getValue('aclClass');
                $i = new $class();
                $i->loadKwcResources();
                Kwf_Cache_Simple::add($cacheId, $i);
                Kwf_Benchmark::subCheckpoint('create Acl', microtime(true)-$t);
            } else {
                Kwf_Benchmark::subCheckpoint('load cached Acl '.round((memory_get_usage()-$m) / (1024*1024), 2).'MB', microtime(true)-$t);
            }
        }
        return $i;
    }

    public static function clearCache()
    {
        $cacheId = 'acl';
        Kwf_Cache_Simple::delete($cacheId);
    }

    public function __construct()
    {
        $this->addRole(new Kwf_Acl_Role('guest', trlKwfStatic('Guest')));
        $this->addRole(new Kwf_Acl_Role_Admin('admin', trlKwfStatic('Administrator')));

        $this->add(new Zend_Acl_Resource('default_index'));
        $this->add(new Zend_Acl_Resource('kwf_user_menu'));
        $this->add(new Zend_Acl_Resource('kwf_user_changeuser'));
        $this->add(new Zend_Acl_Resource('kwf_user_about'));
        $this->add(new Zend_Acl_Resource('kwf_welcome_index'));
        $this->add(new Zend_Acl_Resource('kwf_welcome_content'));
        $this->add(new Zend_Acl_Resource('kwf_welcome_welcome'));
        $this->add(new Zend_Acl_Resource('kwf_debug'));
        $this->add(new Zend_Acl_Resource('kwf_debug_session-restart'), 'kwf_debug');
        $this->add(new Zend_Acl_Resource('kwf_debug_php-info'), 'kwf_debug');
        $this->add(new Zend_Acl_Resource('kwf_debug_apc'), 'kwf_debug');
        $this->add(new Zend_Acl_Resource('kwf_debug_assets-dependencies'), 'kwf_debug');
        $this->add(new Zend_Acl_Resource('kwf_debug_benchmark'), 'kwf_debug');
        $this->add(new Zend_Acl_Resource('kwf_debug_benchmark-counter'));
        $this->add(new Zend_Acl_Resource('kwf_media_upload'));
        $this->add(new Zend_Acl_Resource('kwf_media_post-back'));
        $this->add(new Zend_Acl_Resource('kwf_maintenance_setup'));
        $this->add(new Zend_Acl_Resource('kwf_maintenance_update'));
        $this->add(new Zend_Acl_Resource('kwf_maintenance_clear-cache'));
        $this->add(new Zend_Acl_Resource('kwf_maintenance_update-downloader'));
        $this->add(new Zend_Acl_Resource('kwf_maintenance_fulltext'));
        $this->add(new Zend_Acl_Resource('edit_role'));
        $this->add(new Kwf_Acl_Resource_EditRole('edit_role_admin', 'admin'), 'edit_role');

        $this->add(new Kwf_Acl_Resource_UserSelf('kwf_user_self', '/kwf/user/self'));
{'fraction_non_alphanumeric': 0.15246118268913114, 'fraction_numerical': 0.002973240832507433, 'mean_word_length': 3.318830242510699, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7164925', 'n_tokens_mistral': 2145, 'n_tokens_neox': 2026, 'n_words': 258}