Init Login Required
342456
protected function initLoginRequired()
    {
        $routeInfo = $this->route_info;
        if (!in_array($routeInfo['controller'], Route::KERNEL_WEB_CTR) 
            || !in_array($routeInfo['action'], Route::KERNEL_WEB_ACTIONS)
        ) {
            $login_required_filter = Lb::app()->getLoginRequiredFilter();
            if (!isset($login_required_filter['controllers'][$routeInfo['controller']][$routeInfo['action']]) 
                || !$login_required_filter['controllers'][$routeInfo['controller']][$routeInfo['action']]
            ) {
                $login_default_url = Lb::app()->getLoginDefaultUrl();
                if (Lb::app()->isLoginRequired() && $login_default_url) {
                    Lb::app()->loginRequired($login_default_url, $this->request, $this->response);
                }
            }
        }
    }
678291
public static function _init()
	{
		// load the auth config
		\Config::load('ormauth', true);

		// deal with invalid column selections
		if ($columns = \Config::get('ormauth.table_columns', array()) == array('*') or ! is_array($columns))
		{
			\Config::set('ormauth.table_columns', array());
		}

		// setup the remember-me session object if needed
		if (\Config::get('ormauth.remember_me.enabled', false))
		{
			static::$remember_me = \Session::forge(array(
				'driver' => 'cookie',
				'cookie' => array(
					'cookie_name' => \Config::get('ormauth.remember_me.cookie_name', 'rmcookie'),
				),
				'encrypt_cookie' => true,
				'expire_on_close' => false,
				'expiration_time' => \Config::get('ormauth.remember_me.expiration', 86400 * 31),
			));
		}
	}
751231
function init(ctx) {
        var server = ctx.server;

        if (!privateKey) {
            throw new Error('Please set config.security.token.privateKey');
        }

        server.ext('onPreAuth', validateToken);

        return new Q(ctx);
    }
1237339
function init() {
    var debugFile = path.join(__dirname, 'debug.js');

    if (debug) {
        if (fs.existsSync(debugFile)) { fs.unlinkSync(debugFile); }
        debugFD = fs.openSync(debugFile, 'a');
    }

    getFileList(modelsPath).forEach(defineModel);
    processAllRelations(defineRelation);

    if (debug) {
        fs.closeSync(debugFD);
    }
}
77895
public function initCliAction()
    {
        clearstatcache();

        $app = 'app/' . Config::get('app.name') . '/';

        $assets = array(
            BASE_PATH . $app . '_session/',
            BASE_PATH . $app . '_cache/',
            BASE_PATH . $app . '_database/',
            BASE_PATH . $app . '_templates/',
        );

        echo 'Check app assets' . PHP_EOL;

        foreach ($assets as $asset) {

            if (!is_dir($asset)) {
                echo "[ Please create '$asset' directory! ]" . PHP_EOL;
            }

            if (!is_writable($asset)) {
                echo "[ Please make '$asset' writable! ]" . PHP_EOL;
            }
        }

        echo 'Secure root directory' . PHP_EOL;
        chmod(BASE_PATH, 0755);

        echo 'Secure .htaccess' . PHP_EOL;
        chmod(BASE_PATH . '.htaccess', 0644);

        echo 'Secure index.php' . PHP_EOL;
        chmod(BASE_PATH . 'index.php', 0644);

        echo 'Secure autoload.core.php' . PHP_EOL;
        chmod(BASE_PATH . 'pimf-framework/autoload.core.php', 0644);

        echo 'Create logging files' . PHP_EOL;

        $directory = Config::get('bootstrap.local_temp_directory');

        $handle = fopen($file = $directory . 'pimf-logs.txt', "at+");
        fclose($handle);
        chmod($file, 0777);
        $handle = fopen($file = $directory . 'pimf-warnings.txt', "at+");
        fclose($handle);
        chmod($file, 0777);
        $handle = fopen($file = $directory . 'pimf-errors.txt', "at+");
        fclose($handle);
        chmod($file, 0777);

        clearstatcache();
    }
53271
private void initialize() {
        createKeysIfNotExist();
        if (keyPair == null) {
            try {
                loadKeyPair();
            } catch (IOException | NoSuchAlgorithmException | InvalidKeySpecException e) {
                LOGGER.error("An error occurred loading key pair");
                LOGGER.error(e.getMessage());
            }
        }
        if (secretKey == null) {
            try {
                loadSecretKey();
            } catch (IOException | ClassNotFoundException e) {
                LOGGER.error("An error occurred loading secret key");
                LOGGER.error(e.getMessage());
            }
        }
    }
25836
public function init()
    {
        $filename = $this->getDirectory().DIRECTORY_SEPARATOR.$this->initFilename;

        if (File::exists($filename)) {
            File::requireOnce($filename);
        }
    }
297
public function init()
    {
        $host =getenv('PDO_HOST');
        if($host) {
            $this->setHost(trim($host));
        }

        $database = getenv('PDO_DATABASE');
        if($database) {
            $this->setDatabase(trim($database));
        }
        $user = getenv('PDO_USER');
        if($user) {
            $this->setUser($user);
        }

        $password = getenv('PDO_PASSWORD');
        if($password) {
            $this->setPassword($password);
        }
    }
1160724
function init (router) {
  router.use((err, req, res, next) => {
    res._headers = res._headers || {}

    next(err)
  })
}
245156
function init()
    {
        // initialize curl handle
        $this->ch = curl_init();

        //set various options

        //set error in case http return code bigger than 400
        if ($this->failonerror) {
            curl_setopt($this->ch, CURLOPT_FAILONERROR, true);
        }

        // allow redirects
        curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);

        // use gzip if possible
        curl_setopt($this->ch, CURLOPT_ENCODING, 'gzip, deflate');

        // do not veryfy ssl
        // this is important for windows
        // as well for being able to access pages with non valid cert
        curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
    }
709948
public function init()
	{
		parent::init();
		$this->auth = new LightOpenID(Yii::$app->getRequest()->getHostInfo());
	}
1042726
function init(){

    // set NODE_ENV to --env value
    if (argv.env) {
        set('NODE_ENV', argv.env);
    }

    // load evironment files
    ['./.env', './config/.env', './env', './config/env'].map(file => {

        try {

            load(file);

        } catch(err) {

            if (env('DEBUG')) {
                console.error(`Env: ${err.message}`);
            }

        }

    });

    // set default vars
    set('NODE_ENV', 'development');

    ['DEVELOPMENT', 'PRODUCTION'].map(str => {
        set(str, get('NODE_ENV') === str.toLowerCase());
    });

}
647264
@Override
    public void initialize() {
        String adminUsername = "admin";
        String adminPassword = "123456";

        User param = new User();
        param.setUserName(adminUsername);
        User admin = baseDao.getUnique(User.class, param);
        if (admin != null) {
            LoggerHelper.info("database has been initialized.");
            return;
        }
        LoggerHelper.info("begin init database.");
        admin = new User();
        admin.setUserName(adminUsername);
        admin.setUserPassword(HashHelper.getHashedPassword(adminPassword, adminUsername));
        admin.setPasswordSalt(adminUsername);

        Role role = new Role();
        role.setRoleName("ROLE_ADMIN");
        role.setRoleDescription("Administrator");
        baseDao.save(role);

        admin.setRoleList(Arrays.asList(role));
        baseDao.save(admin);

        LoggerHelper.info("init database successfully.");
    }
910926
function default_init(user, password) {
  this.defaults.username = user;
  this.defaults.password = password;

  this.defaults.headers = {
    Accept: 'application/json'
  };
  this.defaults.headers['Content-Type'] = 'application/json';
}
12693
def init(self):
        """"""
        self.debug('Initializing %r', self)
        proto = self.server.split('://')[0]

        if proto == 'https':
            if hasattr(ssl, 'create_default_context'):
                context = ssl.create_default_context()

                if self.ssl_verify:
                    context.check_hostname = True
                    context.verify_mode = ssl.CERT_REQUIRED
                else:
                    context.check_hostname = False
                    context.verify_mode = ssl.CERT_NONE

                self._http_handler = urllib2.HTTPSHandler(debuglevel=0, context=context)
            else:
                self._http_handler = urllib2.HTTPSHandler(debuglevel=0)
        elif proto == 'http':
            self._http_handler = urllib2.HTTPHandler(debuglevel=0)
        else:
            raise ValueError('Invalid protocol %s' % proto)

        self._api_url = self.server + '/api_jsonrpc.php'
        self._http_headers = {
            'Content-Type': 'application/json-rpc',
            'User-Agent': 'python/zabbix_api',
        }

        if self.httpuser:
            self.debug('HTTP authentication enabled')
            auth = self.httpuser + ':' + self.httppasswd
            self._http_headers['Authorization'] = 'Basic ' + b64encode(auth.encode('utf-8')).decode('ascii')
753359
public void init(String username, Credentials credentials) {
        this.credentials = credentials;
        setIdentifier(username.toLowerCase());
    }
763004
protected function _initialize()
    {
        $config = $this->_config->get('joomla');

        if(is_null($config) || !is_array($config)) {
            $config = array();
        }

        $defaults = array(
            'name' => 'root',
            'username'  => 'root',
            'groups'    => array(8),
            'email'     => 'root@localhost.home'
        );

        $this->_credentials = array_merge($defaults, $config);

        $this->_bootstrap();
        $this->_loadFramework();
    }