<commit_before><?php

require_once CORE . '/class.cacheable.php';

class Extension_Routing extends Extension
{
    private static $resolved;

    // delegates

    public function getSubscribedDelegates()
    {
        return array(

            array('page'     => '/frontend/',
                  'delegate' => 'FrontendPrePageResolve',
                  'callback' => 'frontendPrePageResolve')
        );
    }

    // install

    public function install()
    {
        // add configuration

        Symphony::Configuration()->set('path', 'routes.xml', 'routing');
        Administration::instance()->saveConfig();

        // create example

        if (!file_exists(WORKSPACE . '/routes.xml')) {

            copy(EXTENSIONS . '/routing/routes.xml', WORKSPACE . '/routes.xml');
        }

        // create cache

        $this->enable();
    }

    // uninstall

    public function uninstall()
    {
        // remove configuration

        Symphony::Configuration()->remove('routing');
        Administration::instance()->saveConfig();

        // clear cache

        $this->disable();
    }

    // enable

    public function enable()
    {
        // refresh cache

        $this->cache(true);
    }<commit_msg>Update Configuration writing for Sym 2.4<commit_after><?php

require_once CORE . '/class.cacheable.php';

class Extension_Routing extends Extension
{
    private static $resolved;

    // delegates

    public function getSubscribedDelegates()
    {
        return array(

            array('page'     => '/frontend/',
                  'delegate' => 'FrontendPrePageResolve',
                  'callback' => 'frontendPrePageResolve')
        );
    }

    // install

    public function install()
    {
        // add configuration

        Symphony::Configuration()->set('path', 'routes.xml', 'routing');
        Symphony::Configuration()->write();

        // create example

        if (!file_exists(WORKSPACE . '/routes.xml')) {

            copy(EXTENSIONS . '/routing/routes.xml', WORKSPACE . '/routes.xml');
        }

        // create cache

        $this->enable();
    }

    // uninstall

    public function uninstall()
    {
        // remove configuration

        Symphony::Configuration()->remove('routing');
        Symphony::Configuration()->write();

        // clear cache

        $this->disable();
    }

    // enable

    public function enable()
    {
        // refresh cache

        $this->cache(true);
    }
{'fraction_non_alphanumeric': 0.13844904587900933, 'fraction_numerical': 0.0008120178643930166, 'mean_word_length': 1.8818713450292397, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '4185749', 'n_tokens_mistral': 665, 'n_tokens_neox': 644, 'n_words': 131}