<commit_before><?php

/**
 * This is the parent controller class of all controllers. It sets up the view 
 * system (implemented by Smarty), and provides a catch-all method that returns 
 * a 404 Not Found. This catch-all method can be overridden in the child 
 * controller.
 */

abstract class Controller
{
    public $view;
    public $env;
    public $module;
    public $domain;

    protected $_logger;
    protected $_factory;

    public function __construct($module)
    {
        // convenience variables
        $this->_logger = Zend_Registry::get('logger');
        $this->_factory = Zend_Registry::get('factory');

        $this->view = new SmartyView();

        // set the environment variable
        $this->env = Zend_Registry::get('config')->getSectionName();
        $this->view->env = $this->env;

        // set the module (the tab) we're on
        $this->module = $module;
        $this->view->module = $this->module;

        // set the base domain
        // e.g. returns "example.com" from "www.example.com"
        preg_match('/[^\.]+\.[^\.]+$/', $_SERVER['HTTP_HOST'], $matches);
        $this->domain = $matches[0];
        $this->view->domain = $this->domain;

        // are we on a mobile device?
        $this->view->isMobile = Utilities::isMobile($_SERVER['HTTP_USER_AGENT']);
    }

    /**
     * This method is called before the action. For example, use this function
     * to check for authorization.
     */

    public function preDispatch()
    {
    }

    /**
     * This method is called after the action. For example, use this function
     * for analytics code.
     */

    public function postDispatch()
    {
    }

    /**
     * This method is called if a non-existent method (i.e. action) is called on
     * this object.
     */

    public function __call($action, $args)
    {
        Router::notFound();
    }
}
<commit_msg> not used<commit_after><?php

/**
 * This is the parent controller class of all controllers. It sets up the view 
 * system (implemented by Smarty), and provides a catch-all method that returns 
 * a 404 Not Found. This catch-all method can be overridden in the child 
 * controller.
 */

abstract class Controller
{
    public $view;
    public $env;
    public $module;
    public $domain;

    protected $_logger;
    protected $_factory;

    public function __construct($module)
    {
        // convenience variables
        $this->_logger = Zend_Registry::get('logger');
        $this->_factory = Zend_Registry::get('factory');

        $this->view = new SmartyView();

        // set the environment variable
        $this->env = Zend_Registry::get('config')->getSectionName();
        $this->view->env = $this->env;

        // set the module (the tab) we're on
        $this->module = $module;
        $this->view->module = $this->module;

        // set the base domain
        // e.g. returns "example.com" from "www.example.com"
        preg_match('/[^\.]+\.[^\.]+$/', $_SERVER['HTTP_HOST'], $matches);
        $this->domain = $matches[0];
        $this->view->domain = $this->domain;
    }

    /**
     * This method is called before the action. For example, use this function
     * to check for authorization.
     */

    public function preDispatch()
    {
    }

    /**
     * This method is called after the action. For example, use this function
     * for analytics code.
     */

    public function postDispatch()
    {
    }

    /**
     * This method is called if a non-existent method (i.e. action) is called on
     * this object.
     */

    public function __call($action, $args)
    {
        Router::notFound();
    }
}

{'fraction_non_alphanumeric': 0.13390156722573548, 'fraction_numerical': 0.0021996150673632116, 'mean_word_length': 2.265709156193896, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2737117', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1010, 'n_words': 328}