Initializes this class. This means, the request and input data will be
loaded and parsed.
424353
public static function initialize()
    {
        switch($_SERVER['REQUEST_METHOD']) {
            case "POST":
                self::$_method = self::POST;
                break;
            case "GET":
                self::$_method = self::GET;
                break;
            case "PUT":
                self::$_method = self::PUT;
                break;
            case "DELETE":
                self::$_method = self::DELETE;
                break;
            default:
                self::$_method = self::HEAD;
        }
        self::$_data = array();
        self::_parseData($_GET);
        self::_parseData($_POST);
        
        if(
            isset($_SERVER['HTTPS']) &&
            $_SERVER['HTTPS'] !== null &&
            $_SERVER['HTTPS'] !== "off"
        ) {
            self::$_https = true;
        } else {
            self::$_https = false;
        }
        
        self::$_domain = (string) $_SERVER['HTTP_HOST'];
        self::$_file = (string) $_SERVER['SCRIPT_FILENAME'];
        if(isset($_SERVER['PATH_INFO'])) {
            self::$_pathInfo = (string) $_SERVER['PATH_INFO'];
        } else {
            self::$_pathInfo = "";
        }
    }
653625
@PostConstruct
    private void initialize() {
        final MultivaluedMap<String, String> queryParams = uriInfo.getQueryParameters();
        final String offset = multiParam(queryParams, "offset");
        final String page = multiParam(queryParams, "page", "pageNumber");
        final String size = multiParam(queryParams, "size", "pageSize", "limit");
        final String filter = multiParam(queryParams, "filter", "searchText");
        final String sort = multiParam(queryParams, "sort", "sortOrder");
        final OrderDirection orderDirection;
        String orderBy = multiParam(queryParams, "orderBy", "sortName");

        if (StringUtils.isBlank(orderBy) || !RegexSequence.Pattern.ALPHA_NUMERIC.matcher(orderBy).matches()) {
            orderBy = null;
        }

        if ("asc".equalsIgnoreCase(sort)) {
            orderDirection = OrderDirection.ASCENDING;
        } else if ("desc".equalsIgnoreCase(sort)) {
            orderDirection = OrderDirection.DESCENDING;
        } else {
            orderDirection = OrderDirection.UNSPECIFIED;
        }

        final Pagination pagination;
        if (StringUtils.isNotBlank(offset)) {
            pagination = new Pagination(Pagination.Strategy.OFFSET, offset, size);
        } else if (StringUtils.isNotBlank(page) && StringUtils.isNotBlank(size)) {
            pagination = new Pagination(Pagination.Strategy.PAGES, page, size);
        } else {
            pagination = new Pagination(Pagination.Strategy.OFFSET, 0, 100); // Always paginate queries from resources
        }
        this.alpineRequest = new AlpineRequest(getPrincipal(), pagination, filter, orderBy, orderDirection);
    }
1116483
protected function init()
    {
        $this->checkDatabaseFile();

        $this->reader = new Reader(
            $this->getDatabasePath(),
            $this->getLocales()
        );
    }
877972
public void init()
    {
        this.leading = 0;
        while (this.leading < this.value.length() && this.value.charAt(this.leading) == ' ')
        {
            this.leading++;
        }

        if (this.leading == this.value.length())
        {
            this.setEmpty();
        }
        else
        {
            this.isEmpty = false;
            this.trailing = 0;
            while (this.value.charAt(this.value.length() - this.trailing - 1) == ' ')
            {
                this.trailing++;
            }
        }
    }
792115
public function init()
    {
        parent::init();

        $request = $this->getRequest();

        if (in_array($request->getActionName(), $this->tokenReturnActions)) {
            // Tell the system where to return to after a survey has been taken
            $this->currentUser->setSurveyReturn($request);
        }
    }
10326
public void initialize()
    {
        super.initialize();

        //
        // Register the ServletService classes associated with the ServletServiceProvider
        //
        ServletServiceProvider ssp = ServletServiceProvider.getProvider();
        addService(ServletContext.class, ssp);
        addService(ServletRequest.class, ssp);
        addService(ServletResponse.class, ssp);
        addService(HttpServletRequest.class, ssp);
        addService(HttpServletResponse.class, ssp);

        //
        // Register an *internal* service that is used to create ControlBeanContext objects for
        // children of this control container
        //
        _bcsp = WebContextFactoryProvider.getProvider();
        addService(ControlBeanContextFactory.class, _bcsp);
    }
512778
public function init()
    {
        // Status
        $processed = false;

        // Receive information from: Store, Request and process it to a valid state representation

        // We can do the following without any side effects ...
        //   a) Load data pool from session - fall back to default one for first call
        //   b) Generate a fresh token used at least for next/first render()
        //   c) Detect if the form was in any kind submitted to here - maybe through a satellite form entry

        $this
            ->initializeDataPool()
            ->submitted($this->isASubmittedFormInRequest())
            ->jumped($this->receiveJumpFieldValueFromRequest());

        // We can now check for submitted data which can either control the flow (e.g. JUMP) or required to correctly bootstrap the form
        if (true === $this->wasSubmitted()) {

            // Collect data from request cause we have one!
            $step   = (int) $this->receiveStepFieldValueFromRequest();
            $steps  = (int) $this->receiveStepsFieldValueFromRequest();
            $token  = $this->receiveTokenFieldValueFromRequest();
            $upload = (int) $this->receiveUploadFieldValueFromRequest();
            $valid  = true;

            // When submitted we must have also this information! So we can use to check this as well
            $stepFromDataPool  = (int) $this->getDataPoolValue(Doozr_Form_Service_Constant::IDENTIFIER_STEP);
            $stepsFromDataPool = (int) $this->getDataPoolValue(Doozr_Form_Service_Constant::IDENTIFIER_STEPS);
            $lastValidStep     = (int) $this->getDataPoolValue(Doozr_Form_Service_Constant::IDENTIFIER_LASTVALIDSTEP);

            // Adjust by following rule:
            // On a switch from one step to the next we need to adjust the step
            $step  = ($stepFromDataPool > $step)   ? $stepFromDataPool  : $step;
            $steps = ($stepsFromDataPool > $steps) ? $stepsFromDataPool : $steps;

            // If validation now fails for basic manipulation protection fallback to default
            if (
                $step                        <=  0                    ||    // ~ e.g. no valid step found
                $steps                       <=  0                    ||    // ~ e.g. no valid steps limit/end found
                null                         === $token               ||    // ~ e.g. no token submitted
                $step                        >   $steps               ||    // ~ e.g. stepped over goal
                ($lastValidStep              === 0      && $step > 1) ||    // ~ e.g. If no last valid step but where in a step > 1
                (abs($lastValidStep - $step) !=  1      && $step > 1)       // ~ e.g. More than 1 step diff is only allowed for jump
            ) {
                $valid = false;
            }

            if (true === $valid) {
                // Store the detected values for further processing
                $this->setStep($step);
                $this->setSteps($steps);
                $this->setToken($token);
                $this->setUpload($upload);

                // Check for form has file upload (in general not on current request limited) - and getMetaComponents it ...
                if (true === $this->hasFileUpload()) {
                    // ... getMetaComponents in this context is to ensure that we can't
                    $fileUploadHandler = $this->getFileUploadHandler();

                    // Retrieve files for this step (either from pool or fresh uploaded)
                    $files = $fileUploadHandler->getUploadedFiles(
                        $step,
                        $this->getDataPool(),
                        $this->getRequest()->getUploadedFiles()
                    );
                } else {
                    $files = [];
                }

                // Store files ...
                $this->setFiles($files);

                // Extract components for validation in this steps
                $validationRules = $this->getDataPool()[Doozr_Form_Service_Constant::IDENTIFIER_COMPONENTS][$step];

                // Manually inject validation for method
                $validationRules[Doozr_Form_Service_Constant::PREFIX.Doozr_Form_Service_Constant::IDENTIFIER_METHOD] = [
                    'validation' => ['value' => [$this->getDataPool()[Doozr_Form_Service_Constant::IDENTIFIER_METHOD]]],
                    'type'       => Doozr_Form_Service_Constant::COMPONENT_TYPE_GENERIC,
                ];

                $submittedValues = $this->buildValueArray(array_keys($validationRules));

                $submittedValues[Doozr_Form_Service_Constant::PREFIX.Doozr_Form_Service_Constant::IDENTIFIER_METHOD] = $this->getRequest()->getMethod();

                // Manually inject validation for token
                $validationRules[Doozr_Form_Service_Constant::PREFIX.Doozr_Form_Service_Constant::IDENTIFIER_TOKEN] = [
                    'validation' => ['value' => [$this->getDataPool()[Doozr_Form_Service_Constant::IDENTIFIER_TOKEN]]],
                    'type'       => Doozr_Form_Service_Constant::COMPONENT_TYPE_GENERIC,
                ];

                $submittedValues[Doozr_Form_Service_Constant::PREFIX.Doozr_Form_Service_Constant::IDENTIFIER_TOKEN] = $this->getToken();

                // Run validation by using validation handler ...
                $this->setValid(
                    $this->getValidationHandler()->validate(
                        $submittedValues,
                        $validationRules
                    )
                );

                /**
                 * Required to handle
                 *
                 * Token-Behavior -> comes from history
                 * $invalidTokenBehavior = $this->getDataPoolValue(Doozr_Form_Service_Constant::IDENTIFIER_TOKENBEHAVIOR)
                 *
                 */
                $invalidTokenBehavior = $this->getDataPoolValue(Doozr_Form_Service_Constant::IDENTIFIER_TOKENBEHAVIOR);
                $tokenValid           = $this->getError(
                    Doozr_Form_Service_Constant::PREFIX.Doozr_Form_Service_Constant::IDENTIFIER_TOKEN,
                    true
                );

                // Handle outsourced to token handler
                $this->getTokenHandler()->handleToken(
                    $invalidTokenBehavior,
                    $tokenValid
                );

                // Transfer valid data ...
                $this->transferValidDataAndFilesToPool($step);

                // If valid we must increase active step to the next one :)
                if (true === $this->isValid()) {
                    // We only accept completion of forms on a submit. This is a condition which prevent us from
                    // running into raise conditions with jumped forms which are valid ... and it makes the rule easy:
                    $this->setComplete($step === $steps);

                    if (true === $this->isComplete()) {
                        $data = $this->getDataHandler()->enrichWithMetaInformation($this->getDataPool());
                        $this->invalidateDataPool();
                        $this->setResult($data);
                    }

                    $this->setActiveStep($step + 1);
                } else {
                    $this->setActiveStep($step);
                }

                $processed = true;
            }

            // We can also check if form was not submitted - maybe it was jumped to this place!!!
            // The we must! have a valid data pool entry for each single element and restore the values from there to emulate a valid request
        } elseif (true === $this->wasJumped()) {

            // Collect data from store ...
            $step   = (int) $this->getDataPoolDataValue($this->getJumped(), $this->getFieldnameStep());
            $steps  = (int) $this->getDataPoolDataValue($this->getJumped(), $this->getFieldnameSteps());
            $token  = $this->getDataPoolDataValue($this->getJumped(), $this->getFieldnameToken());
            $data   = $this->getDataPoolValue(Doozr_Form_Service_Constant::IDENTIFIER_DATA);
            $upload = (int) $this->getDataPoolValue(Doozr_Form_Service_Constant::IDENTIFIER_UPLOAD);
            $valid  = true;
            $jumped = $this->getJumped();

            $lastValidStep = (int) $this->getDataPoolValue(Doozr_Form_Service_Constant::IDENTIFIER_LASTVALIDSTEP);

            // If validation now fails for basic manipulation protection fallback to default
            if (
                $step                        <=  0                    ||    // ~ e.g. no valid step found
                $steps                       <=  0                    ||    // ~ e.g. no valid steps limit/end found
                null                         === $token               ||    // ~ e.g. no token ever stored
                $step                        >   $steps               ||    // ~ e.g. stepped over goal
                ($lastValidStep              === 0      && $step > 1) ||    // ~ e.g. If no last valid step but where in a step > 1
                (abs($lastValidStep - $step) !=  1      && $step > 1)       // ~ e.g. More than 1 step diff is only allowed for jump
            ) {
                $valid = false;
            }

            if (
                (null !== $lastValidStep && 0 !== $lastValidStep) &&
                (abs($jumped - $lastValidStep) <= 1)
            ) {
                $valid = true;
                $step  = $jumped;
                $steps = (int) $this->getDataPoolDataValue($lastValidStep, $this->getFieldnameSteps());
                $token = $this->getDataPoolDataValue($lastValidStep, $this->getFieldnameToken());
            }

            //
            if (true === $valid) {
                // Store the detected values for further processing
                $this->setStep($step);
                $this->setSteps($steps);
                $this->setToken($token);
                $this->setUpload($upload);

                // Check for form has file upload (in general not on current request limited) - and getMetaComponents it ...
                if (true === $this->hasFileUpload()) {
                    // ... getMetaComponents in this context is to ensure that we can't
                    $fileUploadHandler = $this->getFileUploadHandler();

                    // Retrieve files for this step (either from pool or fresh uploaded)
                    $files = $fileUploadHandler->getUploadedFiles(
                        $step,
                        $this->getDataPool()
                    );

                } else {
                    $files = [];
                }

                // Store files ...
                $this->setFiles($files);

                // Validate only if we ...
                if ($jumped <= $lastValidStep) {

                    // Extract components for validation in this steps
                    $validationRules = $this->getDataPool()[Doozr_Form_Service_Constant::IDENTIFIER_COMPONENTS][$step];

                    $submittedValues = $this->buildValueArray(
                        array_keys($validationRules)
                    );

                    // Run validation by using validation handler ...
                    $this->setValid(
                        $this->getValidationHandler()->validate(
                            $submittedValues,
                            $validationRules
                        )
                    );
                }

                // Transfer valid data ...
                $this->transferValidDataAndFilesToPool($step);

                // If valid we must increase active step to the next one :)
                if (true === $this->isValid()) {
                    // We only accept completion of forms on a submit. This is a condition which prevent us from
                    // running into raise conditions with jumped forms which are valid ... and it makes the rule easy:
                    $this->setComplete($step === $steps);

                    if (true === $this->isComplete()) {
                        $data = $this->getDataHandler()->enrichWithMetaInformation($this->getDataPool());
                        $this->invalidateDataPool();
                        $this->setResult($data);
                    }

                    $this->setActiveStep($step);
                } else {
                    $this->setActiveStep($step);
                }

                $processed = true;
            }


            /*
            // At this point the basic validation must be done!
            if (true === $valid) {
                // Store the detected values for further processing
                $this->setStep($step);
                $this->setSteps($steps);
                $this->setToken($token);
                $this->setUpload($upload);

                // We could now call the validation. But why? We validated that the call to here is correct (validation)
                // and the data we would now validation ir already validated. The request method will probably fail cause
                // we jumped via ?...Step=x to here ;) So we do not validation again!
                $this->setValid(true);
                $this->setComplete(false);
                $this->setActiveStep($step);

                $processed = true;
            }*/
        }

        // If neither submit nor successful jump step back to defaults!
        if (false === $processed) {
            $step       = Doozr_Form_Service_Constant::DEFAULT_STEP_FIRST;
            $activeStep = $step;
            $steps      = Doozr_Form_Service_Constant::DEFAULT_STEP_FIRST;
            $upload     = Doozr_Form_Service_Constant::DEFAULT_HAS_FILE_UPLOAD;

            // Store the detected values for further processing
            $this->setStep($step);
            $this->setActiveStep($activeStep);
            $this->setSteps($steps);
            $this->setUpload($upload);
            $this->setFiles([]);
            $this->setValid(false);
            $this->setComplete(false);
        }

        return $this;
    }
106579
@Override
  protected void initRequest()
  {
    super.initRequest();
    
    _state = _state.toActive();
    
    // HttpBufferStore httpBuffer = getHttpBufferStore();
    HttpBufferStore bufferStore = getHttpBufferStore();

    _method.clear();
    _methodString = null;
    _protocol.clear();

    _uriLength = 0;
    if (bufferStore == null) {
      // server/05h8
      _uri = getSmallUriBuffer(); // httpBuffer.getUriBuffer();
      
      _headerBuffer = getSmallHeaderBuffer(); // httpBuffer.getHeaderBuffer();
      _headerKeys = getSmallHeaderKeys();     // httpBuffer.getHeaderKeys();
      _headerValues = getSmallHeaderValues(); // httpBuffer.getHeaderValues();
    }

    _uriHost.clear();
    _host = null;
    _keepalive = KeepaliveState.INIT;

    _headerSize = 0;
    _headerLength = 0;
    
    _inOffset = 0;
    _isChunkedIn = false;
    _isFirst = true;
  }
1334724
public function init()
    {
        if (isset($this->view)) {
            $controller = $this->getController();
            if (isset($controller) && $controller->getViewFile($this->view) !== false) {
                $this->content = $this->controller->renderPartial($this->view, $this->viewData, true);
            }
        }
        $this->htmlOptions['headingOptions'] = $this->headingOptions;
    }
1344122
protected function initialize() {
		foreach ( $this->apply_filters( 'filter', $this->app->config->load( 'filter' ) ) as $class => $tags ) {
			$this->register_class_filter( $class, $tags );
		}
	}
1186540
protected function init()
    {
        $this->data = new Collection();

        if ($this->defaultFile) {
            $file = $this->buildLangFilePath($this->defaultFile . '.' . $this->format);

            if (is_file($file)) {
                $this->data->load($file, $this->format);
            }
        }
    }
233606
public function initializeObject()
    {
        if ($this->cache->has($this->cacheKey)) {
            $this->parsedData = $this->cache->get($this->cacheKey);
        } else {
            $this->parsedData = $this->parseFiles($this->sourcePaths);
            $this->parsedData = $this->resolveAliases($this->parsedData, '');
            $this->cache->set($this->cacheKey, $this->parsedData);
        }
    }
995558
public function init()
    {
        if ($this->form->enableClientScript === true && $this->form->enableClientValidation === true) {
            Html::addCssClass($this->inputOptions, ['inputValidation' => 'validate']);
        }

        if ($this->model->hasErrors()) {
            Html::addCssClass($this->inputOptions, $this->form->errorCssClass);
        }

        if ($this->showCharacterCounter === true) {
            $this->inputOptions['showCharacterCounter'] = true;
        }
    }
662270
public function init()
	{
		parent::init();

		self::$plugin = $this;

		$requestService = Craft::$app->getRequest();

		$this->setComponents([
            'methods' => Service::class,
        ]);

		$this->_configureTemplateVariable();

		if ($requestService->getIsCpRequest())
		{
			$this->_configureCpResources();
			$this->_configureAssetThumbnails();
			$this->_configureAssetIndexAttributes();
		}
	}
1363826
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params) {
            foreach ($params as $param) {
                if ($param->getType() == "config") {
                    $this->configParameters[] = $param;
                } else {
                    if ($param->getName() == "encoding") {
                        $this->setEncoding($param->getValue());
                    }
                }
            }
        }
    }
363103
public function init() {
		
		parent::init();

		if (empty($this->url))
			$this->url = Yii::app()->getRequest()->requestUri;

		$this->registerClientScript();
	}
980767
public function initialize()
    {
        parent::initialize();
        $this->loadHelper('Html', [
            'className' => 'MyHtml'
        ]);
        $this->loadHelper('Time', [
            'className' => 'MyTime'
        ]);
        $this->loadHelper('Number', [
            'className' => 'MyNumber'
        ]);
        $this->loadHelper('Form');
        $this->loadHelper('Menu');
        $this->loadHelper('Slug');
        $this->loadHelper('Text');
        $this->loadHelper('AssetCompress.AssetCompress');
        $this->loadHelper('TimebasedCurrency');
        $this->loadHelper('PricePerUnit');
    }