api\v1\Init::initialize PHP Method

initialize() public method

public initialize ( string $type )
$type string The type of init to load, possible values: Backend, BackendAjax, BackendCronjob
    public function initialize($type)
    {
        $type = (string) $type;
        // check if this is a valid type
        if (!in_array($type, $this->allowedTypes)) {
            throw new InvalidInitTypeException($type, $this->allowedTypes);
        }
        // set type
        $this->type = $type;
        // set a default timezone if no one was set by PHP.ini
        if (ini_get('date.timezone') == '') {
            date_default_timezone_set('Europe/Brussels');
        }
        \SpoonFilter::disableMagicQuotes();
        $this->initSession();
    }