Initializes the object.
This method is invoked at the end of the constructor after the object is initialized with the
given configuration.

@throws InvalidConfigException
340312
public function init()
    {
        if (empty($this->clientConfig['credentials'])) {
            throw new InvalidConfigException('Credentials are not set.');
        }

        if (empty($this->clientConfig['region'])) {
            throw new InvalidConfigException('Region is not set.');
        }

        if (empty($this->defaultBucket)) {
            throw new InvalidConfigException('Default bucket name is not set.');
        }

        foreach ($this->defaultComponentDefinitions() as $name => $definition) {
            $this->components[$name] = $this->components[$name] ?? $definition;
        }
    }
1177306
protected void initialize() {
        this.mappedFields = new HashMap<String, PropertyDescriptor>();
        PropertyDescriptor[] pds = BeanUtils.getPropertyDescriptors(mappedClass);
        if (checkProperties) {
            mappedProperties = new HashSet<String>();
        }
        for (int i = 0; i < pds.length; i++) {
            PropertyDescriptor pd = pds[i];
            if (pd.getWriteMethod() != null) {
                if (checkProperties) {
                    this.mappedProperties.add(pd.getName());
                }
                this.mappedFields.put(pd.getName().toLowerCase(), pd);
                for (String underscoredName : underscoreName(pd.getName())) {
                    if (underscoredName != null
                            && !pd.getName().toLowerCase().equals(underscoredName)) {
                        this.mappedFields.put(underscoredName, pd);
                    }
                }
            }
        }
    }
916712
public void init(String configuration) {

        // initialize the members
        m_additionalButtons = new ArrayList<String>(OPTIONAL_BUTTONS_LIST.size());
        m_configuration = configuration;
        m_editorHeight = EDITOR_DEFAULTHEIGHT;
        m_hiddenButtons = new ArrayList<String>();
        // initialize the widget options
        parseOptions(configuration);
    }
855541
protected function initOptions()
    {
        if (!($this->model instanceof Model)) {
            throw new InvalidConfigException('Model is required');
        }

        if (!($this->model->getPrimaryKey())) {
            throw new InvalidConfigException('Model has empty primary key');
        }

        if ($this->button !== false) {
            $this->button['position'] = isset($this->button['position']) ? $this->button['position'] : static::BUTTON_OUTSIDE;
        }

        if (empty($this->scenario)) {
            $this->scenario = $this->model->scenario;
        } else {
            $this->_oldScenario = $this->model->scenario;
            $this->model->scenario = $this->scenario;
        }

        if ($this->form !== false) {
            $formConfig = [
                'method' => 'POST',
                'action' => $this->scenario,
                'options' => [
                    'class' => 'inline',
                    'data' => [
                        'modal-form' => true,
                    ],
                ],
            ];
            if ($this->submit === static::SUBMIT_PJAX) {
                $formConfig['options'] = ArrayHelper::merge($formConfig['options'], [
                    'data' => ['pjax' => 1, 'pjax-push' => 0],
                ]);
            } elseif ($this->submit === static::SUBMIT_AJAX) {
                $formConfig['options'] = ArrayHelper::merge($formConfig['options'], [
                    'data' => ['ajax-submit' => 1],
                ]);

                $this->registerAjaxSubmit();
            }

            $this->form = ArrayHelper::merge($formConfig, $this->form);
        }

        if (is_array($footer = $this->modal['footer'])) {
            $tag = ArrayHelper::remove($footer, 'tag', 'input');
            $label = ArrayHelper::remove($footer, 'label', 'OK');
            $footer = ArrayHelper::merge([
                'data-modal-submit' => true,
                'data-loading-text' => '<i class="fa fa-circle-o-notch fa-spin"></i> ' . Yii::t('hipanel', 'loading'),
            ], $footer);

            if ($tag === 'input') {
                $footer['type']  = 'submit';
                $footer['value'] = $label;
            }

            $this->modal['footer'] = Html::tag($tag, $label, $footer);
            $this->registerFooterButtonScript();
        }

        $this->modal = ArrayHelper::merge([
            'id' => $this->getModalId(),
            'toggleButton' => ($this->button['position'] === static::BUTTON_IN_MODAL) ? $this->button : false,
        ], $this->modal);
    }
1272191
public function init()
    {
        if ($this->attribute === null) {
            throw new InvalidConfigException('Please specify the "attribute" property.');
        }

        if (!isset($this->options['id'])) {
            $this->options['id'] = $this->getMdeditorId();
        }
    }
817597
protected function initialize() : void
    {
        $driver = $this->config->getMetadataDriverImpl();
        if ($driver === null) {
            throw ConfigurationException::noMetadataDriverConfigured();
        }

        $this->driver      = $driver;
        $this->evm         = $this->dm->getEventManager();
        $this->initialized = true;
    }
515819
public function init()
    {
        if (is_string($this->config)) {
            throw new InvalidConfigException('"config" must be of type array.');
        }
        $this->assets = array(
            'js' => YII_DEBUG ? 'foundation/foundation.alerts.js' : 'foundation.min.js'
        );

        if (!isset($this->config)) {
            $this->config = array(
                Enum::COLOR_REGULAR   => array(),
                Enum::COLOR_ALERT     => array(),
                Enum::COLOR_SECONDARY => array(),
                Enum::COLOR_SUCCESS   => array(),
            );
        }
        $this->htmlOptions = ArrayHelper::defaultValue('id', $this->getId(), $this->htmlOptions);
        parent::init();
    }
766716
public function init()
    {
        parent::init();

        if ($this->useSessionFlash) {
            $session = Yii::$app->getSession();
            $flashes = $session->getAllFlashes();

            foreach ($flashes as $type => $data) {
                $data = (array) $data;
                foreach ($data as $message) {
                    $this->options['type'] = $type;
                    $this->options['title'] = $message;
                }
                $session->removeFlash($type);
            }
        } else {
            if (!$this->hasTitle()) {
                throw new InvalidConfigException("The 'title' option is required.");
            }
        }
    }
632382
public static synchronized void initialize(GerritWorkersConfig config) {
        if (instance == null) {
            instance = new GerritSendCommandQueue();
        }
        getInstance().startQueue(config);
    }
1300311
protected function initConfiguration()
    {
        $this->initXmlConfiguration();

        $this->initApiGatewayConfiguration($this->version . '/' . $this->requestPath, false);
    }
630062
@PostConstruct
	public void initialize() {
		logger.debug("Initializing " + this.getClass().getSimpleName() + "(" + System.identityHashCode(this) + ")");

		attributesMap = Collections.synchronizedMap(new HashMap<String, Object>());
	}
416887
public function init()
    {
        if (empty($this->serviceUrl)) {
            throw new InvalidConfigException("service_url cannot be empty. Please configure.");
        }
        if (empty($this->apiKey)) {
            throw new InvalidConfigException("api_key cannot be empty. Please configure.");
        }
        if ($this->cache) {
            // If class was specified as name, try to instantiate on application
            if (is_string($this->cache) && Yii::$app->has($this->cache)) {
                $this->cache = Yii::$app->get($this->cache);
            } elseif (is_array($this->cache)) {
                $this->cache = Yii::createObject($this->cache);
            }
        } elseif ($this->cache !== false && isset(Yii::$app->cache)) {
            $this->cache = Yii::$app->cache;
        }
        $this->_client = new \yii\httpclient\Client([
            'baseUrl' => $this->serviceUrl,
            'requestConfig' => [
                'method' => 'POST',
                'data' => [
                    'ApiKey' => $this->apiKey
                ]
            ],
            'responseConfig' => [
                'format' => \yii\httpclient\Client::FORMAT_XML
            ]
        ]);

        if ($this->requestIp) {
            $validator = new IpValidator([
                'ipv6' => true,
                'ipv4' => true,
                'subnet' => false,
                'expandIPv6' => true
            ]);
            if ($validator->validate($this->requestIp)) {
                ArrayHelper::setValue($this->_client->requestConfig, 'options.bindto', $this->requestIp);
            }
        }

        $result = $this->checkApiKey();
        if (!is_array($result) || empty($result) || strpos($result[0], 'not accepted') !== false) {
            throw new InvalidConfigException(
                "Api Key seems to be invalid: {$result[0]}",
                Exception::E_API_INVALID_PARAMETER
            );
        }
    }
1219223
public function init()
    {
        parent::init();

        Html::addCssClass($this->options, ['widget' => 'chip']);

        if ($this->imageOptions && !isset($this->imageOptions['src'])) {
            throw new InvalidConfigException('The "src" attribute for the image is required.');
        }

        if ($this->renderIcon && !isset($this->icon['name'])) {
            $this->icon['name'] = 'close';
        }
    }
556080
public function init()
    {
        $this->adapter = new Adapter();

        if (!is_array($this->config)) {
            throw new InvalidConfigException('Mailer config should be set in terms of array');
        }

        if (!empty($this->config)) {
            //special handling of language
            $this->adapter->setLanguage(ArrayHelper::remove($this->config, 'language', Yii::$app->language));

            //special handling of callback (see definition of \PHPMailer::$action_function)
            $this->adapter->setCallback(ArrayHelper::remove($this->config, 'callback', 'zyx\phpmailer\Mailer::processResult'));

            //special hadling of charset. Note: PHPMailer in [[createBody()]] overrides charset and sets 'us-ascii' if no 8-bit chars are found!
            $this->adapter->setCharset(!empty($this->messageConfig['charset']) ? $this->messageConfig['charset'] : ArrayHelper::remove($this->config, 'charset', Yii::$app->charset));

            //special handling of our 'global' isHTML switch
            $this->adapter->isHTML((bool)ArrayHelper::remove($this->config, 'ishtml', false));

            //set other properties, compliant with PHPMailer's configuration public properties
            foreach (get_object_vars($this->adapter) as $prop => $value) {
                $key = strtolower($prop);
                if (array_key_exists($key, $this->config)) {
                    $this->adapter->$prop = $this->config[$key];
                }
            }
        }

        //Set current message date initially - a workaround for MessageDate bug in PHPMailer <= 5.2.7
        //see https://github.com/PHPMailer/PHPMailer/pull/227

        if (version_compare($this->adapter->getVersion(), '5.2.7', '<=') && $this->adapter->getMessageDate() == '') {
            $this->adapter->setMessageDate();
        }

    }
552206
public function init()
    {
        if ($this->query === null) {
            throw new InvalidConfigException(get_class($this) . '::$query must be set.');
        }

        if ($this->formatData === null) {
            $this->formatData = function ($query, $columns) {
                $rows = [];
                foreach ($query->all() as $obj) {
                    $row = [];
                    foreach ($columns as $column) {
                    	if ($column['data']) {
		                    $value = ArrayHelper::getValue($obj, $column['data'], null);
		                    if (($pos = strrpos($column['data'], '.')) !== false) {
			                    $keys = explode('.', $column['data']);
			                    $a = $value;
			                    foreach (array_reverse($keys) as $key) {
				                    $a = [$key => $a];
			                    }
			                    $row[$keys[0]] = $a[$keys[0]];
		                    } else {
			                    $row[$column['data']] = $value;
		                    }
	                    }
                    }
                    $rows[] = $row;
                }

                return $rows;
            };
        }
    }
725508
@PostConstruct
  public void initialize() {

    if (this.pojoDescriptorBuilderFactory == null) {
      this.pojoDescriptorBuilderFactory = PojoDescriptorBuilderFactoryImpl.getInstance();
    }
    if (this.pojoDescriptorBuilder == null) {
      this.pojoDescriptorBuilder = this.pojoDescriptorBuilderFactory.createPrivateFieldDescriptorBuilder();
    }
    this.descriptor = this.pojoDescriptorBuilder.getDescriptor(EntityTo.class);
  }
1092930
private final static void loadConfig() {
		try {
			conf = Configurations.loadConfig(configFilePath);
		} catch (ConfigurationException e) {
			terminate();
			throw new InitializationException(INIT_FAILED, e);
		}
	}