Init beans
@throws \InvalidArgumentException
@throws \ReflectionException
491097
public static function init()
    {
        $properties = self::getProperties();

        self::$container = new Container();
        self::$container->setProperties($properties);
        self::$container->autoloadServerAnnotation();

        $definition = self::getServerDefinition();
        self::$container->addDefinitions($definition);
        self::$container->initBeans();
    }
556362
public function init()
	{
		//assert proper model is set
		if ($this->subject === null || !ComponentConfig::isActiveRecord($this->subject, false)) {
			$msg = Yii::t('app', 'Setting the model property of type ActiveRecord is mandatory');
			throw new InvalidConfigException($msg);
		}
		ComponentConfig::hasBehavior($this->subject, CommentsBehavior::className(), true);

		//load the comments
		$this->loadComments();

		//prepare options
		Html::addCssClass($this->options, 'widget-comments');
		Html::addCssClass($this->commentOptions, 'comment');
	}
687696
public function init()
    {

        // initialize the prepared statements
        $this->productVarcharsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_VARCHARS));
        $this->productVarcharByAttributeCodeAndEntityTypeIdAndStoreIdAndValueStmt =
                $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_VARCHAR_BY_ATTRIBUTE_CODE_AND_ENTITY_TYPE_ID_AND_STORE_ID_AND_VALUE));
    }
1148002
public function init()
	{
		// Use Reflection::getProperties(PROTECTED) to get protected properties from the passed model
		$reflection = new ReflectionClass($this->model);
		$this->properties = $reflection->getProperties(ReflectionProperty::IS_PROTECTED);

		return parent::init();
	}
1369043
protected function init()
    {
        $this->namespaces  = array();
        $this->currentPath = '/';
        $this->pathData    = array();
        $this->parse       = FALSE;
    }
30943
public function init()
    {
        if ($this->model === null) {
            throw new InvalidConfigException('Please specify the "model" property.');
        }

        $this->dataProvider = new ArrayDataProvider(['allModels' => [$this->model]]);
        parent::init();
    }
720354
@SuppressWarnings("unchecked")
    protected void initialise() {
        if (getBean() == null) {
            return;
        }

        this.beanClass = (Class<T>) bean.getClass();
        if (!(getBean() instanceof Map)) {
            Class currentClass = beanClass;

            List<Class> classes = Lists.newLinkedList();

            while (currentClass != null) {
                classes.add(0, currentClass);
                currentClass = currentClass.getSuperclass();
            }

            for (Class clazz : classes) {
                for (Method m : clazz.getMethods()) {
                    String name = m.getName();
                    Class rtype = m.getReturnType();
                    if (void.class != rtype && !name.equals("getClass")) {
                        boolean getType = name.startsWith(HandleType.GET.name().toLowerCase());
                        boolean isType = false;
                        if (!getType) {
                            isType = name.startsWith(HandleType.IS.name().toLowerCase())
                                    && (Boolean.class.isAssignableFrom(rtype) || rtype == boolean.class);
                        }
                        if (getType || isType) {
                            String fn = transformPropertyName(StringUtils.uncapitalize(name.substring(isType ? 2 : 3)));
                            if (StringUtils.isNotBlank(fn)) {
                                types.put(fn, rtype);
                                readHandleType.put(fn, isType ? HandleType.IS : HandleType.GET);
                            }
                        }
                    }
                }
            }
        } else {
            if (getBean() instanceof BeanMap) {
                types = ((BeanMap) getBean()).types;
                readInvokers = ((BeanMap) getBean()).readInvokers;
                writeInvokers = ((BeanMap) getBean()).writeInvokers;
                beanClass = (Class<T>) bean.getClass();
                bean = (T) ((BeanMap) bean).getBean();
            } else {
                Set<Map.Entry> entries = ((Map) getBean()).entrySet();
                for (Map.Entry entry : entries) {
                    String name = transformPropertyName((String) entry.getKey());
                    if (StringUtils.isNotBlank(name) && entry.getValue() != null) {
                        types.put(name, entry.getValue().getClass());
                    }
                }
            }
        }
    }
402732
protected function initInstances()
    {
        if (empty($this->instances)) {
            foreach ($this->servers as $server) {
                if ($server instanceof \Redis) {
                    if ($server->isConnected()) {
                        $redis = $server;
                    } else {
                        throw new \InvalidArgumentException("If you use \\Redis objects as argument, the object must be connected.");
                    }
                } else {
                    if (empty($server[0])) {
                        throw new \InvalidArgumentException("A server hostname or IP is required");
                    }

                    if (empty($server[1])) {
                        $server[1] = 6379;
                    }
                    if (empty($server[2])) {
                        $server[2] = 0;
                    }
                    list($host, $port, $timeout) = $server;
                    $redis = new \Redis();
                    $redis->connect($host, $port, $timeout);
                }
                $this->instances[] = $redis;
            }
        }
    }
1178524
public static function init()
    {
        if(static::$isInited)
        {
            throw new \RuntimeException('MemoryTableManager can not repeated init');
        }
        foreach(static::$tables as $name => $option)
        {
            $table = new \Swoole\Table($option['size'] ?? 1024, $option['conflictProportion'] ?? 0.2);
            foreach($option['columns'] as $column)
            {
                $table->column($column['name'], $column['type'] ?? swoole_table::TYPE_STRING, $column['size'] ?? 0);
            }
            if(!$table->create())
            {
                throw new \RuntimeException('MemoryTableManager create table failed');
            }
            static::$tables[$name] = $table;
        }
        static::$isInited = true;
    }
328211
public function initialize()
    {
        if (true === $this->hasBeenInitialized) {
            return;
        }

        $this->hasBeenInitialized = true;

        foreach ($this->service as $service) {
            list($serviceClassName, $serviceOptions) = $this->manageServiceData($service);

            $this->serviceInstances[$serviceClassName] = $this->getServiceInstance($serviceClassName, $serviceOptions);
        }
    }
82779
public static function Initialize()
    {
        // Initialize the plugin loader and try to load any plugins.
        self::$plugin_loader = new Plugins\Loader();

        if(self::ValidExtension())
        {
            self::$plugin_loader->Start(self::GetCwd() . "/plugins");
            
            if(file_exists(self::GetCwd() . "/peg.conf"))
            {
                Settings::SetBackEnd(new Config\INI);
                Settings::Load(self::GetCwd(), "peg.conf");
            }
            else
            {
                Settings::SetBackEnd(new Config\JSON);
                Settings::Load(self::GetCwd(), "peg.json");
            }
        }
    }
27400
private void initAnnotatedFields() {
        final Set<Field> hiddenFields = Reflections.getHiddenFields(beanClass);
        inject(hiddenFields);

        final Set<Field> inheritedFields = Reflections.getInheritedFields(beanClass);
        inject(inheritedFields);

        final Set<Field> ownFields = Reflections.getOwnFields(beanClass);
        inject(ownFields);
    }
713447
public function initConstructorArgs()
    {
        $constructor = $this->reflected->getConstructor();

        if (!is_null($constructor)) {
            // Index parameters by their names
            foreach ($constructor->getParameters() as $param) {
                $name = Util::snakeToCamelCase($param->getName());
                $this->constructorArgs[$name] = $param;
            }
        }
    }
763004
protected function _initialize()
    {
        $config = $this->_config->get('joomla');

        if(is_null($config) || !is_array($config)) {
            $config = array();
        }

        $defaults = array(
            'name' => 'root',
            'username'  => 'root',
            'groups'    => array(8),
            'email'     => 'root@localhost.home'
        );

        $this->_credentials = array_merge($defaults, $config);

        $this->_bootstrap();
        $this->_loadFramework();
    }
1124003
public function init(): void
    {
        parent::init();

        if (!($this->contentFS instanceof Filesystem)) {
            throw new InvalidConfigException(sprintf('ContentFS must be instance of %s.', Filesystem::class));
        }
        if (!($this->cacheFS instanceof Filesystem)) {
            throw new InvalidConfigException(sprintf('CacheFS must be instance of %s.', Filesystem::class));
        }

        $this->iconGenerator = IconGenerator::build($this->iconSet);
        $this->formatterFactory = new FormatterFactory((array) $this->formatterConfigArray);
        $this->aliasFactory = AliasFactory::build($this->defaultAlias);
        $this->aliasFactory->addMultiple($this->aliasArray);
    }
400539
public function init()
    {
        parent::init();

        // check for BC
        if (!empty($this->cookieName)) {
            if (!preg_match("/^[a-zA-Z0-9-_]+$/", $this->cookieName)) {
                throw new InvalidConfigException('Invalid cookieName');
            }
            $this->cookie = [
                'name' => $this->cookieName,
                'value' => [$this->cookieName, $this->cookieValue],
                'options' => $this->cookieOptions,
            ];
        }
    }
965827
protected function initializable()
    {
        if (!$this->getParamAdapter()) {
            throw new Exception\LogicException('Param Adapter is required');
        }

        if (!$this->getSource()) {
            throw new Exception\LogicException('Source data is required');
        }

        $this->init = true;

        if (count($this->headers)) {
            $this->setHeaders($this->headers);
        }

        $this->init();

        $this->initFilters($this->getSource()->getSource());
    }