initialize

@see ClientInterface
420088
public function initialize(Session $session)
    {
        $this->session = $session;

        if ($this->structure === null) {
            throw new ModelException(sprintf("Structure not set while initializing Model class '%s'.", get_class($this)));
        }

        if ($this->flexible_entity_class == null) {
            throw new ModelException(sprintf("Flexible entity not set while initializing Model class '%s'.", get_class($this)));
        } elseif (!(new \ReflectionClass($this->flexible_entity_class))
            ->implementsInterface('\PommProject\ModelManager\Model\FlexibleEntity\FlexibleEntityInterface')
        ) {
            throw new ModelException(sprintf("Flexible entity must implement FlexibleEntityInterface."));
        }

        $session->getPoolerForType('converter')
            ->getConverterHolder()
            ->registerConverter(
                $this->flexible_entity_class,
                new PgEntity(
                    $this->flexible_entity_class,
                    $this->getStructure()
                ),
                [
                    $this->getStructure()->getRelation(),
                    $this->flexible_entity_class,
                ]
        );
    }
177577
public function init()
    {
        parent::init();
        if ($this->useNoUiSlider) {
            if (!ArrayHelper::keyExists('start', $this->clientOptions)) {
                $this->clientOptions['start'] = $this->start;
            }

            if (!ArrayHelper::keyExists('range', $this->clientOptions)) {
                $this->clientOptions['range'] = $this->range;
            }

            if (!ArrayHelper::keyExists('step', $this->clientOptions)) {
                $this->clientOptions['step'] = $this->step;
            }

            if ($this->vertical) {
                $this->clientOptions['orientation'] = 'vertical';
            }

            if (!isset($this->sliderOptions['id'])) {
                $this->sliderOptions['id'] = $this->getId();
            }

            $this->addUpdateEvent();
            $this->registerClientScripts();
        }
    }
1300093
public function initialize()
    {
        if ($this->mongoClient !== null) {
            return;
        }

        if ($this->eventManager->hasListeners(Events::preConnect)) {
            $this->eventManager->dispatchEvent(Events::preConnect, new EventArgs($this));
        }

        $server = $this->server ?: 'mongodb://localhost:27017';
        $options = $this->options;

        $options = isset($options['timeout']) ? $this->convertConnectTimeout($options) : $options;
        $options = isset($options['wTimeout']) ? $this->convertWriteTimeout($options) : $options;

        $this->mongoClient = $this->retry(function() use ($server, $options) {
            return new \MongoClient($server, $options, $this->driverOptions);
        });

        if ($this->eventManager->hasListeners(Events::postConnect)) {
            $this->eventManager->dispatchEvent(Events::postConnect, new EventArgs($this));
        }
    }
109482
public function init()
    {
        parent::init();
        $this->clientOptions = false;
        if ($this->defaultWrapClass)
            Html::addCssClass($this->wrapOptions, $this->defaultWrapClass);
        if ($this->defaultClass)
            Html::addCssClass($this->options, $this->defaultClass);
    }
137952
protected function initClient()
    {
        //get slack config
        $slack_config = config('slack-output');

        if (empty( $slack_config["endpoint"] )) {
            throw new Exception("The endpoint url is not set in the config");
        }

        //init client
        $this->client = new Client($slack_config["endpoint"], [
            "username" => $slack_config["username"],
            "icon"     => $slack_config["icon"]
        ]);
    }
1358698
public function init()
    {
        if ($this->isEnabled()) {
            $this->xmppclient = \PHPDaemon\Clients\XMPP\Pool::getInstance();
        }
    }
443877
private function initialize()
    {
        $this->entity = '';
        $this->source = '';
        $this->mode = self::RSMODE_NOTCONNECTED;
        $this->result = null;
        $this->originalValues = null;
        $this->datafields = [];
        $this->values = [];
        $this->idFields = [];
    }
1154202
public function initialise()
    {
        $this->key = null;
        $this->name = null;
        $this->secret = null;
        $this->ltiVersion = null;
        $this->consumerName = null;
        $this->consumerVersion = null;
        $this->consumerGuid = null;
        $this->cssPath = null;
        $this->protected = false;
        $this->enabled = false;
        $this->enableFrom = null;
        $this->enableUntil = null;
        $this->lastAccess = null;
        $this->idScope = ToolProvider::ID_SCOPE_ID_ONLY;
        $this->defaultEmail = '';
        $this->created = null;
        $this->updated = null;
    }
1053234
protected function initServiceClient()
    {
        if ($this->httpClient === null) {
            $this->initHttpClients();
        }

        $serviceDescription = new Description($this->config->getServiceDescriptionConfig());
        $serviceClient = new GuzzleClient($this->getHttpClient(), $serviceDescription);

        foreach ($this->config->getClientDefaultsConfig() as $option => $value) {
            $serviceClient->setConfig($option, $value);
        }

        $this->description = $serviceDescription;
        $this->serviceClient = $serviceClient;
    }
793621
function init(\CharlotteDunois\Livia\Client $client): \React\Promise\ExtendedPromiseInterface {
        $this->client = $client;
        $this->attachListeners();
        
        return $this->db->execute('CREATE TABLE IF NOT EXISTS settings (guild VARCHAR(20) NOT NULL, settings TEXT NOT NULL, PRIMARY KEY (guild))')
            ->then(function () {
                return $this->db->execute('SELECT * FROM settings')->then(function (\Plasma\StreamQueryResultInterface $result) {
                    return $result->all()->then(function (\Plasma\QueryResultInterface $result) {
                        $rows = $result->getRows();
                        
                        foreach($rows as $row) {
                            $this->loadRow($row);
                        }
                        
                        if($this->settings->has('global')) {
                            return null;
                        }
                        
                        return $this->create('global')->then(function () {
                            return null;
                        });
                    });
                });
            });
    }
788678
public function initialize()
    {
        //Loads components
        //The configuration for `AuthComponent`  takes place in the same class
        $this->loadComponent('MeCms.Auth');
        $this->loadComponent('MeTools.Flash');
        $this->loadComponent('RequestHandler', ['enableBeforeRedirect' => false]);
        $this->loadComponent('MeTools.Uploader');
        $this->loadComponent('Recaptcha.Recaptcha', [
            'sitekey' => getConfigOrFail('Recaptcha.public'),
            'secret' => getConfigOrFail('Recaptcha.private'),
            'lang' => substr(I18n::getLocale(), 0, 2),
        ]);

        parent::initialize();
    }
282136
protected function init()
    {
        $this->client = new Client(
            $this->getHttpClientConfig()
        );

        $this->continents = Continents::load();
    }
878233
private function initializeClient()
    {
        $this->client = new Client($this->guzzleConfig);

        if ($this->isInDebugMode()) {
            $this->setDebugger();
        }
        if ($this->needsAuthentication()) {
            $this->authenticate();
        }

        return $this->client;
    }
373809
protected function init()
    {
        $this->instantiatedServices = $this->arr();
        $this->registeredServices = $this->arr();
        $this->compiledConfig = $this->arr();
        $this->parameters = $this->arr();
        $this->references = $this->arr();
        $this->taggedServices = $this->arr();
    }
998644
public function getClient(): ClientInterface
    {
        if ($this->client === null) {
            $this->client = new Client();
        }

        return $this->client;
    }
413357
public function init()
    {
        $this->sessId = $this->attrs->sessId;
        $this->serverId = $this->attrs->serverId;
        $this->path = $this->attrs->path;

        // @TODO: revert timeout after request
        $this->upstream->setTimeouts($this->appInstance->config->networktimeoutread->value,
            $this->appInstance->config->networktimeoutwrite->value);

        $this->opts = $this->appInstance->getRouteOptions($this->attrs->path);
        $this->CORS();
        if ($this->isFinished()) {
            return;
        }
        if ($this->opts['cookie_needed'] && !$this instanceof Info) {
            if (isset($_COOKIE['JSESSIONID'])) {
                $val = $_COOKIE['JSESSIONID'];
                if (!is_string($val) || $val === '') {
                    $val = 'dummy';
                }
            } else {
                $val = 'dummy';
            }
            $this->setcookie('JSESSIONID', $val, 0, '/');
        }
        $this->contentType($this->contentType);
        if (!$this->cacheable) {
            $this->noncache();
            $this->header('X-Accel-Buffering: no');
        }
        if ($this->callbackParamEnabled) {
            if (!isset($_GET['c']) || !is_string($_GET['c']) || preg_match('~[^_\.a-zA-Z0-9]~', $_GET['c'])) {
                $this->header('500 Internal Server Error');
                $this->out('"callback" parameter required');
                $this->finish();
                return;
            }
        }
        if (($f = $this->appInstance->config->heartbeatinterval->value) > 0) {
            $this->heartbeatTimer = setTimeout(function ($timer) {
                if (in_array('one-by-one', $this->pollMode)) {
                    $this->heartbeatOnFinish = true;
                    $this->stop();
                    return;
                }
                $this->sendFrame('h');
                if ($this->gcEnabled) {
                    $this->gcCheck();
                }
            }, $f * 1e6);
        }
        $this->afterHeaders();
        if ($this->poll) {
            $this->acquire(function () {
                $this->poll();
            });
        }
    }
660395
public function initializeObject()
    {
        $clientOptions = $this->s3DefaultProfile;

        $this->s3Client = new S3Client($clientOptions);
        $this->s3Client->registerStreamWrapper();
    }