****************************************** PRIVATE FUNCTIONS *******************************************
 
Initialize nodeCacheModule given the provided constructor params
325056
function init(){
    try {
      self.db = new nodeCache();
      log(false, 'Node-cache client created with the following defaults:', {expiration: this.expiration, verbose: this.verbose, readOnly: this.readOnly});
    } catch (err) {
      log(true, 'Node-cache client not created:', err);
      self.db = false;
    }
    self.type = config.type || 'node-cache';
  }
212314
function nodeDomainInitialized(reset) {
        initState()
            .done(function () {
                var inProgress = updateJsonHandler.get(updateProgressKey);
                if (inProgress && reset) {
                    setUpdateStateInJSON(updateProgressKey, !reset)
                        .always(checkUpdateStatus);
                 } else if (!inProgress) {
                    checkUpdateStatus();
                }
            });
    }
949937
public void init()
    {
        ServletContext config=getServletContext();
        _servletHandler=((ServletHandler.Context)config).getServletHandler();

        Enumeration e = getInitParameterNames();
        while(e.hasMoreElements())
        {
            String param=(String)e.nextElement();
            String value=getInitParameter(param);
            String lvalue=value.toLowerCase();
            if ("nonContextServlets".equals(param))
            {
                _nonContextServlets=value.length()>0 && lvalue.startsWith("t");
            }
            if ("verbose".equals(param))
            {
                _verbose=value.length()>0 && lvalue.startsWith("t");
            }
            else
            {
                if (_parameters==null)
                    _parameters=new HashMap();
                _parameters.put(param,value);
            }
        }
    }
1177942
function ConstructorBuilder(module, tlSchema, notRegisterByName) {
    this.module = module;
    if (!this.module) {
        logger.warn(' Target \'module\' parameter is mandatory!');
        console.trace();
        return;
    }
    this.tlSchema = tlSchema;
    if (!this.tlSchema) {
        logger.warn('\'tlSchema\' parameter is mandatory!');
        return;
    }
    this._methods = [];
    this._type = build.call(this);
    registerTypeById(this._type);
    if (!notRegisterByName) {
        registerTypeByName(this._type);
    }
}
640402
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            for ($i = 0, $paramsCount = count($params); $i < $paramsCount; $i++) {
                if (self::REGEXP_KEY === $params[$i]->getType()) {
                    $pattern = $params[$i]->getValue();
                    $regexp = new RegularExpression();
                    $regexp->setPattern($pattern);
                    $this->_regexps[] = $regexp;
                } elseif (self::NEGATE_KEY === $params[$i]->getType()) {
                    $this->setNegate(Project::toBoolean($params[$i]->getValue()));
                } elseif (self::CS_KEY === $params[$i]->getType()) {
                    $this->setCaseSensitive(Project::toBoolean($params[$i]->getValue()));
                }
            }
        }
    }
899318
function init(pluginInterface) {
    pi = pluginInterface;
    log = pi.log;
    localStorage = pi.localStorage;

    pollLog = localStorage.getItem('pollLog', []);

    resetPolling();
}
1136871
function initModule (args) {
    debug('new ImmutableCoreController', args)
    // require object for args
    assert.equal(typeof args, 'object', 'argument must be object')
    // get name from args if set
    if (args.name) {
        // require name to be string
        assert.equal(typeof args.name, 'string', 'name must be string')
        // set name
        this.name = args.name
    }
    else {
        // use model name if set
        if (args.model) {
            this.name = args.model.name
        }
        // require name
        else {
            throw new Error('name required')
        }
    }
    // set model
    this.model = args.model
    // module name is model name with Controller appended
    this.moduleName = this.name+'Controller'
    // create new immutable module for model - this will throw error
    // if moduleName is already defined
    this.module = immutable.module(this.moduleName, {})
    // add info to module meta
    this.module.meta.class = 'ImmutableCoreController'
    this.module.meta.instance = this
    // set default limit for index results
    this.defaultLimit = args.defaultLimit || DEFAULT_LIMIT
}
559304
public void init() {
		if (initDepth.get() == null) {
			initDepth.set(1);
		} else {
			initDepth.set(initDepth.get() + 1);
		}

		if (resourceCache.get() == null) {
			resourceCache.set(new HashMap<String, Object>());
		}

		if (cacheLocked.get() == null) {
			cacheLocked.set(Boolean.FALSE);
		}
	}
1255262
public function init()
    {
        $containerPath = __DIR__ . '/../../../../../www/cache';
        $containerName = 'ContainerCore';
        $containerNamespace = 'samsonphp\core\loader';
        /** @var Module $module */
        $modules = $this->moduleManager->getRegisteredModules();

        $localModulesPath = '../src';
        ResourceMap::get('cache');
        $resourceMap = ResourceMap::get($localModulesPath);
        $localModules = $resourceMap->modules;

        if (false || !file_exists($containerPath . '/' . $containerName . '.php')) {

            $builder = new DefinitionBuilder(new ParameterBuilder());
            $xmlResolver = new XmlResolver();
            $xmlResolver->resolveFile($builder, __DIR__ . '/../../../../../app/config/config.xml');

            new Service('');
            new InjectService('');
            new InjectClass('');
            new InjectParameter('');

            foreach ($modules as $module) {
                if ($module->className && !$builder->hasDefinition($module->className)) {
                    // Fix samson.php files
                    if (!class_exists($module->className)) {
                        require_once($module->pathName);
                    }
                    /** @var ClassDefinition $classDefinition */
                    $classDefinition = $builder->addDefinition($module->className);
                    if ($id = $this->getModuleId($module->pathName)) {
                        $classDefinition->setServiceName($id);
                    } else {
                        // Generate identifier from module class
                        $classDefinition->setServiceName(
                            strtolower(ltrim(str_replace(__NS_SEPARATOR__, '_', $module->className), '_'))
                        );
                    }
                    $classDefinition->addScope(new ModuleScope())->setIsSingleton(true);
                    $this->defineConstructor($classDefinition, $module->path);
                }
            }

            $classDefinition = $builder->addDefinition(VirtualModule::class);
            $classDefinition->addScope(new ModuleScope())->setServiceName('local')->setIsSingleton(true);
            $this->defineConstructor($classDefinition, getcwd());

            foreach ($localModules as $moduleFile) {
                if (!$builder->hasDefinition($moduleFile[0])) {

                    /** @var ClassDefinition $classDefinition */
                    $classDefinition = $builder->addDefinition($moduleFile[0]);
                    $classDefinition->addScope(new ModuleScope());
                    $classDefinition->setIsSingleton(true);
                    if ($id = $this->getModuleId($moduleFile[1])) {
                        $classDefinition->setServiceName($id);
                    } else {
                        throw new \Exception('Can not get id of local module');
                    }

                    $modulePath = explode('/', str_replace(realpath($localModulesPath), '', $moduleFile[1]));
                    $this->defineConstructor($classDefinition, $localModulesPath . '/' . $modulePath[1]);
                }
            }


            /**
             * Add implementors
             */
            foreach ($this->moduleManager->implements as $interfaceName => $class) {
                $builder->defineImplementors($interfaceName, new ClassReference($class));
            }

            // Init compiler
            $reader = new AnnotationReader();
            $compiler = new DefinitionCompiler(
                new DefinitionGenerator(new ClassGenerator()),
                (new DefinitionAnalyzer())
                    ->addClassAnalyzer(new AnnotationClassAnalyzer($reader))
                    ->addClassAnalyzer(new ReflectionClassAnalyzer())
                    ->addMethodAnalyzer(new AnnotationMethodAnalyzer($reader))
                    ->addMethodAnalyzer(new ReflectionMethodAnalyzer())
                    ->addPropertyAnalyzer(new AnnotationPropertyAnalyzer($reader))
                    ->addPropertyAnalyzer(new ReflectionPropertyAnalyzer())
                    ->addParameterAnalyzer(new ReflectionParameterAnalyzer())
            );

            $container = $compiler->compile($builder, $containerName, $containerNamespace, $containerPath);

        } else {

            $containerClassName = $containerNamespace. '\\' . $containerName;
            require_once($containerPath . '/' . $containerName . '.php');
            $container = new $containerClassName();
        }

        $GLOBALS['__core'] = $container->get('core');

        $this->prepareModules($modules, $container);

        /** @var array $module */
        foreach ($localModules as $module) {
            $instance = $container->get($module[0]);
            $instance->parent = $this->getClassParentModule($container, get_parent_class($instance));
        }

//        $container->get('core')->active($container->get('local'));

        return $container;
    }
459042
function init(){
    if(!cacheServiceConfig) {
      cacheServiceConfig = {};
    }
    self.nameSpace = cacheServiceConfig.nameSpace || '';
    self.verbose = (typeof cacheServiceConfig.verbose === 'boolean') ? cacheServiceConfig.verbose : false;
    self.writeToVolatileCaches = (typeof cacheServiceConfig.writeToVolatileCaches === 'boolean') ? cacheServiceConfig.writeToVolatileCaches : true;
    self.caches = new CacheCollection({nameSpace: self.nameSpace, verbose: self.verbose}, cacheModules).caches;
    self.cachesLength = self.caches.length;
  }
656963
def init_submodules(self, cache):
    """"""
    self.cache = CacheService(cache, weakref.proxy(self)) 
    self.mesh = PrecomputedMeshService(weakref.proxy(self))
    self.skeleton = PrecomputedSkeletonService(weakref.proxy(self))
869257
private function initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            foreach ($params as $param) {
                if (self::CONTAINS_KEY === $param->getType()) {
                    $cont = new Contains();
                    $cont->setValue($param->getValue());
                    $this->contains[] = $cont;
                } elseif (self::NEGATE_KEY === $param->getType()) {
                    $this->setNegate(Project::toBoolean($param->getValue()));
                }
            }
        }
    }
77227
public static void init(Context context, String name, int version, int cacheSize, LogLevel logLevel) {
		sLogLevel = logLevel;

		if (sInitialized) {
			if (sLogLevel.log(LogLevel.BASIC)) {
				Log.d(TAG, "Already initialized.");
			}
			return;
		}

		try {
			Class adapterClass = Class.forName(AdapterHolder.IMPL_CLASS_FQCN);
			sAdapterHolder = (AdapterHolder) adapterClass.newInstance();
		} catch (Exception e) {
			if (sLogLevel.log(LogLevel.BASIC)) {
				Log.e(TAG, "Failed to initialize.", e);
			}
		}

		sContext = context.getApplicationContext();
		sDatabaseHelper = new DatabaseHelper(sContext, name, version);
		sSQLiteDatabase = sDatabaseHelper.getWritableDatabase();
		sCache = new LruCache<String, Model>(cacheSize);

		sInitialized = true;
	}
595093
public void init (String nodeName, String sharedSecret, String hostName,
        String publicHostName, int port)
    {
        init(nodeName, sharedSecret, hostName, publicHostName, port, "");
    }
1234728
public void initialise(Identifier rootId, boolean enableCache)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(cclass, "initialise", new Object[] {rootId, new Boolean(enableCache)});

    switch (rootId.getType()) {
      case Selector.UNKNOWN :
      case Selector.OBJECT :
        matchTree = new EqualityMatcher(rootId);
        break;
      case Selector.STRING :
      case Selector.TOPIC :
        matchTree = new StringMatcher(rootId);
        break;
      case Selector.BOOLEAN :
        matchTree = new BooleanMatcher(rootId);
        break;
      default:
        matchTree = new NumericMatcher(rootId);
        break;
    }
    if (enableCache) {
      this.rootId = rootId;
      matchCache = new MatchCache(MATCH_CACHE_INITIAL_CAPACITY);
      matchCache.setRehashFilter(this);
      ((EqualityMatcher) matchTree).setCacheing(true);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.exit(cclass, "MatchSpaceImpl", this);
  }
198197
function inits() {
  log( "init", "step="+step+" ajaxOngoing="+ajaxOngoing );
  if ( getParam( 'nc' ) == 'true' ) {
    noCache = "?nc="+ Math.random();
  }

  if ( ajaxOngoing == 0 ) { 
    if ( step == "load-lang" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load module list...');
      loadLang();
      step = "loadmodulemap";
    } else if ( step == "loadmodulemap" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load module list...');
      loadModuleList();
      step = "loaddecor";
    } else if ( step == "loaddecor" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load decor config...');
      loadDecorList();
      step = "loadstructure";
    } else  if ( step == "loadstructure" ) {
      ajaxOngoing++;
      log( 'init', 'Load Structure File ...');
      loadStructure();
      step = "loadincludes";
    } else if ( step == "loadincludes" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load include JS modules ...');
      checkModules( );
      loadIncludes();
      step = "loadmodules";
    } else if ( step == "loadmodules" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load JS modules ...');
      loadModules();
      if ( layout.theme != null ) {
        loadCSSrelPath( 'css-custom/'+layout.theme+'.css' );
        //jQuery('head').append('<link rel="stylesheet" rel="nofollow" href="css-custom/'+layout.theme+'.css" type="text/css" />');        
      }
      loadCSSrelPath( "css-custom/custom.css" );
      if ( pageInfo["layoutMode"] == 'tablet' ) {
        loadCSSrelPath( "css-custom/custom-t.css" );
        //jQuery('head').append('<link rel="stylesheet" rel="nofollow" href="css-custom/custom-t.css" type="text/css" />');        
      } else if ( pageInfo["layoutMode"] == 'mobile' ) {
        loadCSSrelPath( "css-custom/custom-m.css" );
        //jQuery('head').append('<link rel="st<ylesheet" rel="nofollow" href="css-custom/custom-m.css" type="text/css" />');
      } 
      step = "initmodules";
    } else  if ( step == "initmodules" ) {
      ajaxOngoing++;
      log( 'init', 'Load Structure File ...');
      initModules( layout );
      step = "buildstructure";
    } else  if ( step == "buildstructure" ) {
      ajaxOngoing++;
      log( 'init', 'Start to build HTML ...');
      buildStructure( layout );
      step = "loadres-ht";
    } else  if ( step == "loadres-ht" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load resources HTML ...');
      loadResourcesHT();
      step = "call-hooks";
    } else  if ( step == "call-hooks" ) {
      log( 'init', 'Call module hooks ...');
      callHooks();
      step = "loadres-js";
    } else  if ( step == "loadres-js" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load resources JS ...');
      loadResourcesJS();
      step = "callbacks";
    } else  if ( step == "callbacks" ) {
      log( 'init', 'Start callback methods for resources...');
      resourceCallbacks();
      step = "dialogs";
    } else  if ( step == "dialogs" ) {
      log( 'init', 'Start load dialogs for resources...');
      resourceDialogs();
      step = "afterInit";
    } else  if ( step == "afterInit" ) {
      log( 'init', 'Start load dialogs for resources...');
      startModulesAfterPageLoad( layout );
      clearInterval( initTimerId );
      step = "done";
    }
  }  
}
279458
private static void initializeSchemaIds() {

		final Map<String, Class> interfaces = StructrApp.getConfiguration().getInterfaces();

		// add Structr interfaces here
		for (final Class type : interfaces.values()) {

			// only register node types
			if (type.isInterface() && NodeInterface.class.isAssignableFrom(type) && !type.getName().startsWith("org.structr.dynamic.")) {

				registerType(type);
			}
		}
	}