Calendar initialization
Should be called from the project _config.php file
@param array|null $settings
357292
public static function init($settings = null)
    {
        if (is_array($settings)) {
            //merging settings (and setting the global settings)
            //settings should be submitted via an array
            $settings = self::settings($settings);
        } else {
            $settings = self::settings();
        }

        if ($settings['enabled']) {
            $ssversion = self::subpackage_settings('ssversion');

            //Enabling calendars
            if (self::subpackage_enabled('calendars')) {
                if ($ssversion == '3.0') {
                    Object::add_extension('Event', 'EventCalendarExtension');
                } else {
                    Event::add_extension('EventCalendarExtension');
                }
                $s = self::subpackage_settings('calendars');
                if ($s['colors']) {
                    if ($ssversion == '3.0') {
                        Object::add_extension('Calendar', 'CalendarColorExtension');
                    } else {
                        Calendar::add_extension('CalendarColorExtension');
                    }
                }
                if ($s['shading']) {
                    if ($ssversion == '3.0') {
                        Object::add_extension('Calendar', 'ShadedCalendarExtension');
                    } else {
                        Calendar::add_extension('ShadedCalendarExtension');
                    }
                }
            }
            //Enabling categories
            if (self::subpackage_enabled('categories')) {
                if ($ssversion == '3.0') {
                    Object::add_extension('Event', 'EventCategoryExtension');
                } else {
                    Event::add_extension('EventCategoryExtension');
                }
            }
            //Enabling Event Page
            if (self::subpackage_setting('pagetypes', 'enable_eventpage')) {
                if ($ssversion == '3.0') {
                    Object::add_extension('Event', 'EventHasEventPageExtension');
                } else {
                    Event::add_extension('EventHasEventPageExtension');
                }
            }
            //Enabling debug mode
            if (self::subpackage_enabled('debug')) {
                if ($ssversion == '3.0') {
                    Object::add_extension('Event', 'EventDebugExtension');
                } else {
                    Event::add_extension('EventDebugExtension');
                }
            }
            //Enabling registrations
            if (self::subpackage_enabled('registrations')) {
                if ($ssversion == '3.0') {
                    Object::add_extension('Event', 'EventRegistrationExtension');
                } else {
                    Event::add_extension('EventRegistrationExtension');
                }
            }

            //Adding URL Segment extension to Calendar (currently done for all but could be made configurable later)
            Object::add_extension('Calendar', 'DoURLSegmentExtension');
            if ($ssversion == '3.0') {
                Object::add_extension('Calendar', 'DoURLSegmentExtension');
            } else {
                Calendar::add_extension('DoURLSegmentExtension');
            }
        }
    }
355796
public function setSettings(array $settings = []) : self
    {
        $this->settings = array_merge($this->settings, $settings);
        // loop through checking each setting
        foreach ($this->allowedSettings as $name => $allowed) {
            $this->validateSettings->__invoke($name, $this->settings[$name], $allowed);
        }

        return $this;
    }
1363700
public function settings(array $settings = null)
    {
        if ($settings) {
            $this->_settings = array_merge($this->_settings, $settings);
        }
        return $this->_settings;
    }
968284
protected function storeMiscSettings($settings)
    {
        if (isset($settings['set'])) {
            $this->set = $settings['set'];
        }
        if (isset($settings['metadataPrefix'])) {
            $this->metadataPrefix = $settings['metadataPrefix'];
        }
        if (isset($settings['dateGranularity'])) {
            $this->granularity = $settings['dateGranularity'];
        }
    }
770851
public function injectSettings(array $settings)
    {
        $this->settings = $settings['persistence'];
        if (!is_array($this->settings['backendOptions'])) {
            throw new InvalidConfigurationException(sprintf('The Neos.Flow.persistence.backendOptions settings need to be an array, %s given.', gettype($this->settings['backendOptions'])), 1426149224);
        }
        if (!is_array($this->settings['doctrine']['secondLevelCache'])) {
            throw new InvalidConfigurationException(sprintf('The TYPO3.Flow.persistence.doctrine.secondLevelCache settings need to be an array, %s given.', gettype($this->settings['doctrine']['secondLevelCache'])), 1491305513);
        }
    }
1029240
private function setSettings($settings)
    {
        if ($settings) {
            foreach ($this->settings as $key => &$value) {
                if (!empty($settings->{$key}) && $settings->{$key}) {
                    $value = $settings->{$key};
                }
            }
        }
    }
810152
public function set($settings) {

        if (!$this->simple) {
            if (is_a($this->source, 'ToolConsumer')) {
                $type = 'ToolProxy';
            } else if (is_a($this->source, 'ToolConsumer')) {
                $type = 'ToolProxyBinding';
            } else {
                $type = 'LtiLink';
            }
            $obj = new \stdClass();
            $obj->{'@context'} = 'http://purl.imsglobal.org/ctx/lti/v2/ToolSettings';
            $obj->{'@graph'} = array();
            $level = new \stdClass();
            $level->{'@type'} = $type;
            $level->{'@id'} = $this->endpoint;
            $level->{'custom'} = $settings;
            $obj->{'@graph'}[] = $level;
            $body = json_encode($obj);
        } else {
            $body = json_encode($settings);
        }

        $response = parent::send('PUT', null, $body);

        return $response->ok;

    }
1243830
protected function connect(array $settings): void
  {
    $host     = $this->getSetting($settings, true, 'database', 'host');
    $user     = $this->getSetting($settings, true, 'database', 'user');
    $password = $this->getSetting($settings, true, 'database', 'password');
    $database = $this->getSetting($settings, true, 'database', 'database');

    MetadataDataLayer::setIo($this->io);
    MetadataDataLayer::connect($host, $user, $password, $database);
  }
506076
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setTable('calendar_events');
        $this->setDisplayField('title');
        $this->setPrimaryKey('id');

        $this->addBehavior('Timestamp');
        $this->addBehavior('Muffin/Trash.Trash');

        $this->belongsTo('Calendars', [
            'foreignKey' => 'calendar_id',
            'joinType' => 'INNER',
            'className' => 'Qobo/Calendar.Calendars'
        ]);

        $this->belongsToMany('CalendarAttendees', [
            'joinTable' => 'events_attendees',
            'foreignKey' => 'calendar_event_id',
        ]);

        /** @var \Qobo\Calendar\Model\Table\CalendarsTable $table */
        $table = TableRegistry::get('Qobo/Calendar.Calendars');
        $this->Calendars = $table;
    }
1139110
public function addSettings(array $settings)
    {
        foreach ($settings as $key => $value) {
            $this->addSetting($key, $value);
        }
    }
630949
public function injectSettings(array $settings)
    {
        if (isset($settings['security']['cryptography']['RSAWalletServicePHP']['openSSLConfiguration'])
            && is_array($settings['security']['cryptography']['RSAWalletServicePHP']['openSSLConfiguration'])) {
            $this->openSSLConfiguration = $settings['security']['cryptography']['RSAWalletServicePHP']['openSSLConfiguration'];
        }

        if (isset($settings['security']['cryptography']['RSAWalletServicePHP']['keystorePath'])) {
            $this->keystorePathAndFilename = $settings['security']['cryptography']['RSAWalletServicePHP']['keystorePath'];
        } else {
            throw new MissingConfigurationException('The configuration setting Neos.Flow.security.cryptography.RSAWalletServicePHP.keystorePath is missing. Please specify it in your Settings.yaml file. Beware: This file must not be accessible by the public!', 1305711354);
        }

        if (isset($settings['security']['cryptography']['RSAWalletServicePHP']['paddingAlgorithm']) && is_int($settings['security']['cryptography']['RSAWalletServicePHP']['paddingAlgorithm'])) {
            $this->paddingAlgorithm = $settings['security']['cryptography']['RSAWalletServicePHP']['paddingAlgorithm'];
        } else {
            throw new SecurityException('The padding algorithm given in security.cryptography.RSAWalletServicePHP.paddingAlgorithm is not available.', 1556785429);
        }
    }
935974
public function addSettings( $settings )
    {
        $this->settings = ArrayUtils::merge(
            $this->settings,
            ArrayUtils::iteratorToArray( $settings )
        );

        return $this;
    }
1009192
private function applyFilters(array $settings): void
    {
        foreach ($settings as $column => $filters) {
            foreach ($filters as $filter => $value) {
                if ($filter === Grid\Grid::FILTER_LIKE) {
                    $value = '%' . $value . '%';
                }
                $this->getSource()->andWhere($column . ' ' . $this->filters[$filter] . ' ?', $value);
            }
        }
    }
183341
protected function registerEntityManagers(array $settings)
    {
        if (array_key_exists('connection', $settings)) {
            $settings = [$settings];
        }

        foreach ($settings as $name => $config) {
            if (!is_string($name)) {
                $name = $this->getOption(static::RELATIONAL_MANAGER_NAME);
            }

            $this->addBuilder(new RelationalBuilder($config, $name));
        }
    }
771393
public function initialize(Server $server)
    {
        $this->server = $server;
        $server->on('method:POST', [$this, 'httpPost']);
        $server->on('propFind', [$this, 'propFind']);
        $server->on('propPatch', [$this, 'propPatch']);
        $server->on('calendarObjectChange', [$this, 'calendarObjectChange']);
        $server->on('beforeUnbind', [$this, 'beforeUnbind']);
        $server->on('schedule', [$this, 'scheduleLocalDelivery']);
        $server->on('getSupportedPrivilegeSet', [$this, 'getSupportedPrivilegeSet']);

        $ns = '{'.self::NS_CALDAV.'}';

        /*
         * This information ensures that the {DAV:}resourcetype property has
         * the correct values.
         */
        $server->resourceTypeMapping['\\Sabre\\CalDAV\\Schedule\\IOutbox'] = $ns.'schedule-outbox';
        $server->resourceTypeMapping['\\Sabre\\CalDAV\\Schedule\\IInbox'] = $ns.'schedule-inbox';

        /*
         * Properties we protect are made read-only by the server.
         */
        array_push($server->protectedProperties,
            $ns.'schedule-inbox-URL',
            $ns.'schedule-outbox-URL',
            $ns.'calendar-user-address-set',
            $ns.'calendar-user-type',
            $ns.'schedule-default-calendar-URL'
        );
    }
583535
protected function loadScript($settings)
    {
        if ($this->scripts !== null) {
            $this->scripts->add($settings);
        }

        return $this;
    }
1220236
private function checkSetting($setting)
    {
        if (array_key_exists($setting, $this->getDefaults())) {
            if (! $this->getSetting($setting)) {
                $this->addSetting($setting);
            }
            
            return true;
        }
    }