Инициализация дебаггера

@return void
430223
private function initDebug()
    {
        if (!$this->getVar('debug_level') && !isset($_REQUEST['debug_level'])) return;

		$this->debugMode = $this->getVar('debug_level') | $_REQUEST['debug_level'];
		
        $this->_debug_writer = new \Zend_Log_Writer_Firebug();
        $this->_debugger_request  = new \Zend_Controller_Request_Http();
        $this->_debugger_response = new \Zend_Controller_Response_Http();
        $this->_debugger_channel  = \Zend_Wildfire_Channel_HttpHeaders::getInstance();
        $this->_debugger_channel->setRequest($this->_debugger_request);
        $this->_debugger_channel->setResponse($this->_debugger_response);
        $this->_debugger = new \Zend_Log($this->_debug_writer);
        $this->_debugger->addPriority('SQL', DEBUG_SQL);
        $this->_debugger->addPriority('CACHE', DEBUG_CACHE);
        $this->_debugger->addPriority('BANNER', DEBUG_BANNER);
        
        ob_start();
		
		ini_set('display_errors', 1);
    }
1292550
private function init()
    {
        $this->title(
            new Entities\Title($this->getConfig('title', []))
        );
        $this->description(
            new Entities\Description($this->getConfig('description', []))
        );
        $this->keywords(
            new Entities\Keywords($this->getConfig('keywords', []))
        );
        $this->misc(
            new Entities\MiscTags($this->getConfig('misc', []))
        );
        $this->webmasters(
            new Entities\Webmasters($this->getConfig('webmasters', []))
        );
        $this->analytics(
            new Entities\Analytics($this->getConfig('analytics', []))
        );
    }
70286
private function initialize()
    {
        $this->tablename = sprintf('%s%s', $this->app['config']->get('general/database/prefix', 'bolt_'), 'log_change');
        $this->allowed = ['INSERT', 'UPDATE', 'DELETE'];
        $this->initialized = true;
    }
760320
public static function init()
    {
        /* Разрешаем только однократный вызов этого метода */
        if (self::$inited)
        {
            return;
        }

        // Устанавливаем кодировку по умолчанию для операций mb_*
        mb_internal_encoding('utf-8');

        /* Предотвращает появление ошибок, связанных с неустановленной временной зоной */
        @$timezone = date_default_timezone_get();
        date_default_timezone_set($timezone);

        self::initExceptionHandling();

        self::$inited = true;
    }
245395
protected function init()
    {
        $this->attributes = [];
        $this->groupAttributes = [];

        $this->attributes['id'] = $this->open->name . '-' . $this->name;

        if($this->name) {
            $this->attributes['name'] = $this->name;
        }
    }
1313558
private function initialize()
    {
        $this->pdo->exec(
            'CREATE TABLE IF NOT EXISTS `'.$this->table.'` '
            .'(id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, channel VARCHAR(255), level INTEGER, message LONGTEXT, time INTEGER UNSIGNED, INDEX(channel) USING HASH, INDEX(level) USING HASH, INDEX(time) USING BTREE)'
        );

        //Read out actual columns
        $actualFields = array();
        $rs = $this->pdo->query('SELECT * FROM `'.$this->table.'` LIMIT 0');
        for ($i = 0; $i < $rs->columnCount(); $i++) {
            $col = $rs->getColumnMeta($i);
            $actualFields[] = $col['name'];
        }

        //Calculate changed entries
        $removedColumns = array_diff(
            $actualFields,
            $this->additionalFields,
            $this->defaultfields
        );
        $addedColumns = array_diff($this->additionalFields, $actualFields);

        //Remove columns
        if (!empty($removedColumns)) {
            foreach ($removedColumns as $c) {
                $this->pdo->exec('ALTER TABLE `'.$this->table.'` DROP `'.$c.'`;');
            }
        }

        //Add columns
        if (!empty($addedColumns)) {
            foreach ($addedColumns as $c) {
                $this->pdo->exec('ALTER TABLE `'.$this->table.'` add `'.$c.'` TEXT NULL DEFAULT NULL;');
            }
        }

        // merge default and additional field to one array
        $this->defaultfields = array_merge($this->defaultfields, $this->additionalFields);

        $this->initialized = true;
    }
920094
protected function prepareForValidation(): void
    {
        $data = $this->all();

        // Set abilities
        if (! empty($data['abilities'])) {
            if ($this->user($this->route('guard'))->can('grant', \Cortex\Auth\Models\Ability::class)) {
                $abilities = array_map('intval', $this->get('abilities', []));
                $data['abilities'] = $this->user($this->route('guard'))->isA('superadmin') ? $abilities
                    : $this->user($this->route('guard'))->getAbilities()->pluck('id')->intersect($abilities)->toArray();
            } else {
                unset($data['abilities']);
            }
        }

        $this->replace($data);
    }
678484
public function initialize()
    {
        if($this->initialized)
            return;

        $this->data = $this->session->get(self::BASE_KEY, array());

        $this->clear();

        $this->initialized = true;
    }
15506
public function init() {

        parent::init();
        $this->registerTranslations();
        
        if(!$this->secure)
            $this->uploadAction = '/uploader/one-file/create';

        // set min & max file sizes
        if(is_null($this->minFileSize))
            $this->minFileSize = isset(\Yii::$app->params['fileSize']['min']) ? \Yii::$app->params['fileSize']['min'] : 0.01;
        if(is_null($this->maxFileSize))
            $this->maxFileSize = isset(\Yii::$app->params['fileSize']['max']) ? \Yii::$app->params['fileSize']['max'] : 2;

        // errors of the file uploading
        $this->errors['size'] = Yii::t('byone', 'File size can be from {minFileSize} to {maxFileSize}Mb', ['minFileSize' => $this->minFileSize, 'maxFileSize' => $this->maxFileSize]);
        $this->errors['type'] = Yii::t('byone', 'There is not right file type! Allowed types - {acceptFileTypes}.', ['acceptFileTypes' => $this->acceptFileTypes]);
        $this->errors['maxFiles'] = Yii::t('byone', 'Only {maxFiles} file(s) can be uploaded.', ['maxFiles' => $this->maxFiles]);

        // captions of the buttons and other strings that should be translated
        self::$defaults['choose']['label'] = Yii::t('byone', 'Photo');
        self::$defaults['choose']['caption'] = Yii::t('byone', 'Choose a file');
        self::$defaults['delete']['question'] = Yii::t('byone', 'Are you shure you want to delete this element?');
        self::$defaults['crop']['caption'] = Yii::t('byone', 'Upload');
        
        // set buttons by widget parameters or defaults
        foreach(self::$defaults as $name => $values) {
            foreach($values as $property => $value)
                if(!isset($this->btns[$name][$property]))
                    $this->btns[$name][$property] = $property == 'action' && !$this->secure 
                        ? str_replace('-secure', '', self::$defaults[$name][$property])
                        : self::$defaults[$name][$property];
        }
        
        // full path server side handlers
        $this->btns['delete']['action'] = Url::toRoute($this->btns['delete']['action']);
        $this->btns['save']['action'] = Url::toRoute($this->btns['save']['action']);
        $this->btns['crop']['action'] = Url::toRoute($this->btns['crop']['action']);
        $this->btns['swap']['action'] = Url::toRoute($this->btns['swap']['action']);
        
        $this->blueimp['url'] = Url::toRoute($this->uploadAction);
        
        $this->blueimp['minFileSize'] = $this->minFileSize;
        $this->blueimp['maxFileSize'] = $this->maxFileSize;
        
        // max files that can be uploaded
        $this->blueimp['maxFiles'] = $this->maxFiles;

        // if model name is not set, set it
        if(!isset($this->modelName))
            $this->modelName = get_class($this->model);
        // parent_id has to exist
        if(is_null($this->model->id))
            $this->model->id = false;
        if(is_null($this->parent_id))
            $this->parent_id = $this->model->id;
        if(is_null($this->subdir))
            $this->subdir = $this->model->id;
        // POST-type data for the handler
        $this->blueimp['formData'] = [
            'model' => $this->modelName,
            'parent_id' => $this->parent_id,
            'subdir' => $this->subdir,
            'cropAllowed' => ($this->cropAllowed ? 1 : 0),
        ];
        
        // min pixels for X and Y when cropping
        $minW = $this->model->getMin();
        $aspectRatio = $this->model->getAspectRatio();
        $minH = $minW * $aspectRatio;

        // send params to JavaScript environment
        $options = [
            'btns' => $this->btns,
            'barClass' => $this->barClass,
            'cropAllowed' => $this->cropAllowed,
            'minW' => $minW,
            'minH' => $minH,
            'aspectRatio' => $aspectRatio,
            'appendixView' => $this->appendixView,
            'acceptFileTypes' => $this->acceptFileTypes,
            'errors' => $this->errors,
        ];
        $this->view->registerJs(
            "editLine.options = " . json_encode($options) . ";", 
            View::POS_READY, 
            'editLineOptions'
        );
        
        // assets 
        BlueimpAsset::register($this->view);
        EditLineAsset::register($this->view);
        if($this->draggable) {
            JQueryUiAsset::register($this->view);
            DraggableAsset::register($this->view);
        }
        if($this->cropAllowed) 
            JcropAsset::register($this->view);
        // plugin
        $selector = $name = $this->blueimp['name'];
        $option = json_encode($this->blueimp);
        $script = "jQuery('#{$selector}').{$name}({$option});";
        $this->view->registerJs($script, View::POS_END, 'byone-plugin');
    }
1149535
public function initialize()
    {
        $this->setSource($this->tableName);
        $this->keepSnapshots(true);
        $this->hasMany('id', __NAMESPACE__ . '\UserRole', 'authuserentity_id', array('alias' => 'UserRoles', 'foreignKey' => array('action' => Relation::ACTION_CASCADE)));
        $this->hasMany('id', __NAMESPACE__ . '\Option', 'user_id', array('alias' => 'Options', 'foreignKey' => array('action' => Relation::ACTION_CASCADE)));
        $this->hasMany('id', __NAMESPACE__ . '\Protocol', 'user_id', array('alias' => 'Protocols', 'foreignKey' => array('action' => Relation::ACTION_CASCADE)));
        $this->hasMany('id', __NAMESPACE__ . '\Token', 'user_id', array('alias' => 'Tokens', 'foreignKey' => array('action' => Relation::ACTION_CASCADE)));
    }
641283
public function init()
  {
    if(!Yii::$app->user->isGuest)
    {
      if(Yii::$app->user->identity->isAdmin && $this->enableAdmin){
        Html::addCssClass($this->htmlOptions,'widgetadmin');      
        Draggable::begin();
      }
    }
    ob_start();
    ob_implicit_flush(false);
    
    $this->htmlOptions['id']=$this->getId();

    echo Html::beginTag($this->tagName,$this->htmlOptions)."\n";

    if(!Yii::$app->user->isGuest)
    {
      if(Yii::$app->user->identity->isAdmin && $this->enableAdmin){
        $this->renderToolbar();
      }
    }

    $this->renderDecoration();
    echo "<div class=\"{$this->contentCssClass}\">\n";

    $this->_beginTag=ob_get_contents();

    ob_clean();
    if(!Yii::$app->user->isGuest)
    {
      if(Yii::$app->user->identity->isAdmin && $this->enableAdmin){
        Draggable::end();
      }
    }
  }
152786
public function init() {
        parent::init();

        $defaults = [
            self::TYPE_INFO => ['{class}' => 'alert alert-info alert-dismissible', '{icon}' => '<i class="icon fa fa-info-circle"></i>', '{title}' => Yii::t('cza', 'Tips'), '{content}' => ''],
            self::TYPE_DANGER => ['{class}' => 'alert alert-danger alert-dismissible', '{icon}' => '<i class="icon fa fa-ban"></i>', '{title}' => Yii::t('cza', 'Alert'), '{content}' => ''],
            self::TYPE_WARNING => ['{class}' => 'alert alert-warning alert-dismissible', '{icon}' => '<i class="icon fa fa-warning"></i>', '{title}' => Yii::t('cza', 'Warning'), '{content}' => ''],
            self::TYPE_SUCCESS => ['{class}' => 'alert alert-success alert-dismissible', '{icon}' => '<i class="icon fa fa-info"></i>', '{title}' => Yii::t('cza', 'Alert'), '{content}' => ''],
        ];
        $this->blockTypes = array_replace_recursive($defaults, $this->blockTypes);
    }
1318438
protected function init()
    {
        if (null === $this->items) {
            list($constraints, $sorting, $joins) = $this->translate($this->filter, $this->sorting);

            if (empty($constraints)) {
                $constraints = '';
            } else {
                $constraints = ' WHERE ' . implode(' AND ', $constraints);
            }

            if ($this->prefetch) {
                $this->initEntities($constraints, $this->makeJoins($joins), $this->makeOrderBy($sorting, $joins));
            } else {
                $this->initKeys($constraints, $this->makeJoins($joins), $this->makeOrderBy($sorting, $joins));
            }

            $this->rewind();
        }
    }
1023724
protected function init()
    {
        $this->setupContainer();
        $this->configure();
        $this->errorHandling();
        $this->registerServices();

        $this->initialized = true;
    }
773322
public function init()
    {
        parent::init();
        $that = $this;

        if ($this->owner instanceof Controller_Validator) {
            $this->owner->addHook('extraRules', array($this, 'extraRules'));

            return;  // no source, simply extend rules.
        }

        if ((
            $this->owner instanceof \Model ||
            $this->owner instanceof \Form

        ) && !$this->owner->hasMethod('is')) {
            $this->source = $this->owner; // must support set/get interface
            $this->owner->validator = $this;

            $this->source->addMethod('is', function ($m) use ($that) {
                $args = func_get_args();
                array_shift($args);

                call_user_func_array(array($that, 'is'), $args);
                $that->on('beforeSave', null, true);

                return $m;
            });
        }
    }
1049653
public function init(): void
    {
        // check if $iconSet implement all available icons from self::TYPE_TO_REGEX
        $diff1 = array_keys(\array_diff_assoc($this->iconSet, self::TYPE_TO_REGEX));
        $diff2 = array_keys(\array_diff_assoc(self::TYPE_TO_REGEX, $this->iconSet));
        if ($diff1 === $diff2) {
            \trigger_error('Icon set doesn\'t implement all range of icons.');
        }
    }
425119
private function init() {
        global $DB;
        if (!$this->category = $this->get_current_category($this->cat)) {
            return;
        }
        if ($this->recurse) {
            $categoryids = question_categorylist($this->category->id);
        } else {
            $categoryids = array($this->category->id);
        }
        list($catidtest, $this->params) = $DB->get_in_or_equal($categoryids, SQL_PARAMS_NAMED, 'cat');
        $this->where = 'q.category ' . $catidtest;
    }