<commit_before><?
require_once 'Acl.php';
require_once 'Emitter.php';


/**
 * Class Common
 * @property StdClass        $acl
 * @property Zend_Config_Ini $moduleConfig
 * @property CoreController  $modAdmin
 */
class Common extends \Core2\Acl {

	protected $module;
	protected $path;

    /**
     * @var StdClass
     */
	protected $auth;
	protected $actionURL;
	protected $resId;

    /**
     * @var Zend_Config_Ini
     */
	protected $config;
	private $_p = array();
	private $AR = array(
        'module',
        'action'
    );


    /**
     * Common constructor.
     */
	public function __construct() {
        $child = get_class($this);
        $child = strpos($child, "Controller") ? substr($child, 3, -10) : '';
		parent::__construct();
        $reg = Zend_Registry::getInstance();
		$context = $reg->get('context');
        if ($child) {
            $this->module = strtolower($child);
            if (!$reg->isRegistered('invoker')) {
                $reg->set('invoker', $this->module);
            }
        }
		else {
			$this->module = !empty($context[0]) ? $context[0] : '';
		}
        $this->path      = 'mod/' . $this->module . '/';
        $this->auth      = $reg->get('auth');
        $this->resId     = $this->module;
		$this->actionURL = "?module=" . $this->module;
		if (!empty($context[1]) && $context[1] !== 'index') {
			$this->resId .= '_' . $context[1];
			$this->actionURL .= "&action=" . $context[1];
		}
		$this->config = $reg->get('config');<commit_msg>Рефакторинг<commit_after><?
require_once 'Acl.php';
require_once 'Emitter.php';


/**
 * Class Common
 * @property StdClass        $acl
 * @property Zend_Config_Ini $moduleConfig
 * @property CoreController  $modAdmin
 */
class Common extends \Core2\Acl {

	protected $module;
	protected $path;

    /**
     * @var StdClass
     */
	protected $auth;
	protected $actionURL;
	protected $resId;

    /**
     * @var Zend_Config_Ini
     */
	protected $config;
	private $_p = array();
	private $AR = array(
        'module',
        'action'
    );


    /**
     * Common constructor.
     */
	public function __construct() {

        $child_class_name = get_class($this);

        if ($child_class_name == 'CoreController') {
            $child_class_name = 'admin';
        } else {
            $child_class_name = strpos($child_class_name, "Controller") ? substr($child_class_name, 3, -10) : '';
        }

		parent::__construct();
        $reg     = Zend_Registry::getInstance();
		$context = $reg->get('context');

        if ($child_class_name) {
            $this->module = strtolower($child_class_name);
            if (!$reg->isRegistered('invoker')) {
                $reg->set('invoker', $this->module);
            }

        } else {
			$this->module = ! empty($context[0]) ? $context[0] : '';
        }

        $this->path      = 'mod/' . $this->module . '/';
        $this->auth      = $reg->get('auth');
        $this->resId     = $this->module;
		$this->actionURL = "?module=" . $this->module;

		if ( ! empty($context[1]) && $context[1] !== 'index') {
			$this->resId     .= '_' . $context[1];
			$this->actionURL .= "&action=" . $context[1];
		}

		$this->config = $reg->get('config');
{'fraction_non_alphanumeric': 0.18847839699436444, 'fraction_numerical': 0.006261740763932373, 'mean_word_length': 2.363157894736842, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '3790215', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1046, 'n_words': 195}