Initialise and configure the app, database, scheduler, etc.

    This should be called once at application startup or at tests startup
    (and not e.g. called once for each test case).
762749
def init():
    
    global _users, _names
    _configure_app(app)
    _users, _names = _init_login_manager(app)
    _configure_logger()
    init_scheduler(app.config.get('SQLALCHEMY_DATABASE_URI'))
    db.init(app.config.get('SQLALCHEMY_DATABASE_URI'))
1323142
private void init()
    {
        jdbcProperties = new Properties();
        dbcpProperties = new Properties();
        setFetchSize(0);
        this.setTestOnBorrow(true);
        this.setTestOnReturn(false);
        this.setTestWhileIdle(false);
        this.setLogAbandoned(false);
        this.setRemoveAbandoned(false);
    }
95884
def init_app(self, app, config_prefix='MONGOALCHEMY'):
        """"""

        self.config_prefix = config_prefix
        def key(suffix):
            return '%s_%s' % (config_prefix, suffix)

        if key('DATABASE') not in app.config:
            raise ImproperlyConfiguredError("You should provide a database name "
                                            "(the %s setting)." % key('DATABASE'))

        uri = _get_mongo_uri(app, key)
        rs = app.config.get(key('REPLICA_SET'))
        timezone = None
        if key('TIMEZONE') in app.config:
            timezone = pytz.timezone(app.config.get(key('TIMEZONE')))
        self.session = session.Session.connect(app.config.get(key('DATABASE')),
                                               safe=app.config.get(key('SAFE_SESSION'),
                                                                   False),
                                               timezone = timezone,
                                               host=uri, replicaSet=rs)
        self.Document._session = self.session
1094698
def initdb(config):
    
    engine = sa.engine_from_config(config, 'sqlalchemy.')
    Session.configure(bind=engine)
43934
def init_app(self, app, session_kvstore=None):
        """"""
        app.config.setdefault('SESSION_KEY_BITS', 64)
        app.config.setdefault('SESSION_RANDOM_SOURCE', SystemRandom())

        if not session_kvstore and not self.default_kvstore:
            raise ValueError('Must supply session_kvstore either on '
                             'construction or init_app().')

        # set store on app, either use default
        # or supplied argument
        app.kvsession_store = session_kvstore or self.default_kvstore

        app.session_interface = KVSessionInterface()
1045377
def init_app(self, app, decorators=None):
        
        self.decorators = decorators or self.decorators
        self.app = app

        self.load_config(app)
        # self.load_apispec(app)
        if self.template_file is not None:
            self.template = self.load_swagger_file(self.template_file)
        self.register_views(app)
        self.add_headers(app)

        if self.parse:
            if RequestParser is None:
                raise RuntimeError('Please install flask_restful')
            self.parsers = {}
            self.schemas = {}
            self.format_checker = jsonschema.FormatChecker()
            self.parse_request(app)

        self._configured = True
        app.swag = self
913059
def init_config(self, app):
        """"""
        for k in dir(config):
            if k.startswith('JSONSCHEMAS_'):
                app.config.setdefault(k, getattr(config, k))

        host_setting = app.config['JSONSCHEMAS_HOST']
        if not host_setting or host_setting == 'localhost':
            app.logger.warning('JSONSCHEMAS_HOST is set to {0}'.format(
                host_setting))
681992
def init_app(self, app):
        """"""
        self.init_config(app)
        self.cache = Cache(app)
        self.is_authenticated_callback = _callback_factory(
            app.config['CACHE_IS_AUTHENTICATED_CALLBACK'])
        app.extensions['invenio-cache'] = self
75510
def init_app(self, app):
        
        # The connection related config values
        self.redis_url = app.config.setdefault(
            'RQ_REDIS_URL',
            self.redis_url,
        )
        self.connection_class = app.config.setdefault(
            'RQ_CONNECTION_CLASS',
            self.connection_class,
        )
        # all infos to create a Redis connection are now avaiable.
        self._ready_to_connect = True

        self.queues = app.config.setdefault(
            'RQ_QUEUES',
            self.queues,
        )
        self.queue_class = app.config.setdefault(
            'RQ_QUEUE_CLASS',
            self.queue_class,
        )
        self.worker_class = app.config.setdefault(
            'RQ_WORKER_CLASS',
            self.worker_class,
        )
        self.job_class = app.config.setdefault(
            'RQ_JOB_CLASS',
            self.job_class,
        )
        self.scheduler_class = app.config.setdefault(
            'RQ_SCHEDULER_CLASS',
            self.scheduler_class,
        )
        self.scheduler_queue = app.config.setdefault(
            'RQ_SCHEDULER_QUEUE',
            self.scheduler_queue,
        )
        self.scheduler_interval = app.config.setdefault(
            'RQ_SCHEDULER_INTERVAL',
            self.scheduler_interval,
        )

        #: Whether or not to run RQ jobs asynchronously or not,
        #: defaults to asynchronous
        _async = app.config.setdefault('RQ_ASYNC', True)
        if self._is_async is None:
            self._is_async = _async

        # register extension with app
        app.extensions = getattr(app, 'extensions', {})
        app.extensions['rq2'] = self

        if hasattr(app, 'cli'):
            self.init_cli(app)
43554
def init_app(self, app):
        
        app.config.setdefault('OPENERP_SERVER', 'http://localhost:8069')
        app.config.setdefault('OPENERP_DATABASE', 'openerp')
        app.config.setdefault('OPENERP_DEFAULT_USER', 'admin')
        app.config.setdefault('OPENERP_DEFAULT_PASSWORD', 'admin')

        app.jinja_env.globals.update(
            get_data_from_record=get_data_from_record
        )

        cnx = Client(
            server=app.config['OPENERP_SERVER'],
            db=app.config['OPENERP_DATABASE'],
            user=app.config['OPENERP_DEFAULT_USER'],
            password=app.config['OPENERP_DEFAULT_PASSWORD']
        )

        self.default_user = cnx.user

        app.before_request(self.before_request)
141314
public function init()
    {
        // Duplicated init protection
        if ($this->_blInit) {
            return;
        }
        $this->_blInit = true;

        try {
            // config params initialization
            $this->initVars($this->getShopId());

            // application initialization
            $this->initializeShop();
            $this->_oStart = oxNew(\OxidEsales\Eshop\Application\Controller\OxidStartController::class);
            $this->_oStart->appInit();
        } catch (\OxidEsales\Eshop\Core\Exception\DatabaseException $exception) {
            $this->_handleDbConnectionException($exception);
        } catch (\OxidEsales\Eshop\Core\Exception\CookieException $exception) {
            $this->_handleCookieException($exception);
        }
    }
1198218
protected function init()
	{
		$this->environment = $this->getConfig('app.settings.environment');

		// locale and timezone set
		\Locale::setDefault($this->getConfig('app.settings.locale'));
		date_default_timezone_set($this->getConfig('app.settings.timezone'));


		// load objects
		$this->eventDispatcher = $this->container->get('Emitter');
	}
177668
def _init_application(self, application=None):
        """"""
        if application:
            self.application = application
        else:
            self.application = self.make_application()
116450
def init_app(self, app):
        '''
        
        '''

        self._config = app.config.get('LDAP', {})
        app.ldap_login_manager = self

        self.config.setdefault('BIND_DN', '')
        self.config.setdefault('BIND_AUTH', '')
        self.config.setdefault('URI', 'ldap://127.0.0.1')
        self.config.setdefault('OPTIONS', {})
        # Referrals are disabled by default
        self.config['OPTIONS'].setdefault(ldap.OPT_REFERRALS, ldap.OPT_OFF)

        if self.config.get('USER_SEARCH') and not isinstance(self.config['USER_SEARCH'], list):
            self.config['USER_SEARCH'] = [self.config['USER_SEARCH']]
201379
function(callback) {
                self.configureDatabases(function(err) {

                    if (err) {
                        process.exit(111);
                        return;
                    }

                    self.configureApplicationStack(
                        app, server, callback
                    );
                });
            }
794581
public function actionInit() : void
    {
        $this->initSURole();
        $config = $this->loadConfig();
        $this->applyConfig($config);
        $this->applyAssignConfig($config);
        $this->addAssignmentsToSu();
        $this->log(true);
    }
1081890
function initialize(app, options) {
  var log = logger.get(options);
  app._mukoan = app._mukoan || {};
  if (!app._mukoan.initialized) {
    var config = defaults({}, options, DEFAULT_CONFIGURATION);
    log.info('Starting and configuring Koa server');

    // Setup global error handler and logger
    app.use(middlewares.error(config.error));
    app.on('error', (error) => log.error('Unexpected exception ', error));
    app._mukoan.initialized = true;
  } else {
    log.warn('Trying to initialize the same Koa instance twice (ignoring action)');
  }
}