Loads the internal website_id and environment

@return ConfigLoaderRepository
547661
public function loadEnvironment()
    {
        // Fetch the current application environment.
        $this->environment = app()->environment();
        $this->website_id  = null;

        // Fetch the current web site data and check to see if it has an
        // alternative environment.
        $website_data = WebsiteModel::currentWebsiteData();
        if (! empty($website_data)) {
            if (! empty($website_data['environment'])) {
                $this->environment = $website_data['environment'];
            }
            // We also want the website ID
            $this->website_id = $website_data['id'];
        }

        $this->cache_key = 'site-config.' . $this->environment . '.' . $this->website_id;

        return $this;
    }
989593
public function load()
    {
        if (!is_file($this->filename)) {
            throw new \Mix\Exception\ConfigException("Environment file does not exist: {$this->filename}");
        }
        $this->_data = array_merge(parse_ini_file($this->filename), $_SERVER, $_ENV);
        return true;
    }
173347
public function environment()
    {
        $env = $this->getEnv();
        $name = 'Config/Environment/' . ucfirst($env) . '.php';

        foreach ($this->loader->find($name) as $file) {
            require_once $file->getRealPath();
            $class = $file->getClassName();
            $initializer = new $class();
            $initializer->configure($this);
        }
    }
1210216
function load()
    {
        if ( $this->_isProcessingLoad() )
            throw new \RuntimeException(sprintf(
                'Conflict while loading config (%s); another process interrupt loading (%s).'
                    , $this->path
                    , static::$isProcessingLoading
            ));

        $this->_setFlagProcessingLoad();


        $path = $this->path;

        ## Try to load specified config
        #
        $config = $this->_loadGlobPattern($path);


        $fallBackDirectories = [];

        ## First try too load on initial system directory
        #
        $fallBackDir = rtrim( PT_DIR_CONFIG_INITIAL , '\\/' );
        if (strpos($fallBackDir, dirname($path)) !== 0)
            array_push(
                $fallBackDirectories
                , $fallBackDir
            );

        ## Looking in Default Config Directory
        #
        $fallBackDir = rtrim( PT_DIR_CONFIG , '\\/' );
        if (strpos($fallBackDir, dirname($path)) !== 0)
            array_push(
                $fallBackDirectories
                , $fallBackDir
            );


        if ($preConfig = $this->_loadFromDirectories($fallBackDirectories) )
            $config = ($config) ? $preConfig->withMergeRecursive($config) : $preConfig;


        $this->_setFlagProcessingLoad(false);
        return $config;
    }
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;
    }
1252381
public function load() {
        $this->dictProvider->setLangsPath($this->path);
        $dict = $this->dictProvider->load($this->getUserLangs());
        $this->loadedLang = $this->dictProvider->getLoadedLang();

        if ($dict === null) {
            throw new CantLoadDictionaryException(CantLoadDictionaryException::NO_MATCHING_FILES);
        }

        $this->setlocale();

        return $dict;
    }
481710
private function loadApplication()
    {
        $app = require $this->module->config['bootstrap_file'];
        $app->loadEnvironmentFrom($this->module->config['environment_file']);
        $app->instance('request', new Request());

        return $app;
    }
475431
private function loadConfigurations($environment)
    {
        $configs = new ConfigObject([]);
        $configFolder = $this->applicationAbsolutePath . 'App/Config/' . $environment;
        $h = scandir($configFolder);

        foreach ($h as $configFile) {
            if (strpos($configFile, 'yaml') === false) {
                continue;
            }

            $configs->mergeWith($this->config()->yaml($configFolder . DIRECTORY_SEPARATOR . $configFile));
        }

        return $configs;
    }
531944
public function getParameter(\Twig_Environment $environment, $parameterName, $configAlias = null, $debug = false)
    {
    	$defaultConfig = $this->configManager->getRepository()->getDefaultConfiguration();
    	$this->config = count($defaultConfig) > 0 ? $defaultConfig[0] : null;
    	$parameters = array();

    	if ( $configAlias === null && $this->config !== null ) {
    		$params = $this->config->getParameters();
    	} elseif ( $this->config !== null ) {
    		$config = $this->configManager->getRepository()->findOneBy(array('alias' => $configAlias));
    		if ( $config === null ) {
    			throw new \Exception(sprintf('The configuration with name "%s" not found.', $configAlias));
    		}
    		$params = $config->getParameters();
    	}
    	
    	if ( !isset($params) ) {
    		return;
    	}
    	
   		foreach($params as $p) {
   			$parameters[$p->getName()] = $p->getValue();
   		}
    	
    	if ( $debug === true && !isset($parameters[$parameterName]) ) {
    		throw new \Exception(sprintf('The parameter with name "%s" not found.', $parameterName));
    	}
    	
        return isset($parameters[$parameterName]) ? $parameters[$parameterName] : '';
    }
136276
public function loadConfigs()
    {
        $configs = [];
        foreach ($this->getRepository()->findAll() as $config) {
            $configs[$config->getName()] = $config;
        }

        $this->configs = $configs;

        return $configs;
    }
827228
private static function getTwigEnvironment()
    {
        $skeletonsDirs = array(
            __DIR__.'/../Resources'
        );

        $twigEnvironment = new \Twig_Environment(new \Twig_Loader_Filesystem($skeletonsDirs), array(
            'debug'            => true,
            'cache'            => false,
            'strict_variables' => true,
            'autoescape'       => false,
        ));

        return $twigEnvironment;
    }
763792
public function getEnvironment()
    {
        if (!empty($this->environnement)) {
            $host      = gethostname();
            $authority = $this->request->getUri()->getAuthority();

            foreach ($this->environnement as $key => $env) {
                if (in_array($host, $env) || in_array($authority, $env)) {
                    return $key;
                }
            }
        }

        return '';
    }
164806
public function load()
	{
		if( $this->cacheType() === "data" )
		{
			$ref = new \ReflectionClass($this);
			$cache_name = Str::snake($ref->getShortName());
			$cache_data = $this->cacheData();

			if( isset($cache_data["id"]) )
			{
				$id = $cache_data["id"];
				unset($cache_data["id"]);
			}
			else
			{
				$id = $cache_data;
			}

			$cache = new Cache( $id, "plugin/" . $cache_name, $cache_data );
			if( $cache->ready() )
			{
				$this->plugin_data = $cache->import();
			}
			else
			{
				$this->loadPluginData();
				$cache->export($this->plugin_data);
			}
		}
		else
		{
			$this->loadPluginData();
		}

		return $this;
	}
935003
public function load()
    {
        list($paths, $excludedPaths) = $this->loadBundleNamespaceMap($this->kernelBundles, $this->bundles);
        $paths = array_merge($paths, $this->loadResourceNamespaceMap($this->rootDir, $this->resources));

        return $this->parseNamespaceMap($this->finder, $this->reader, $paths, $excludedPaths);
    }
148904
protected function loadCollection(EnvironmentInterface $environment)
    {
        $dataConfig    = $environment->getBaseConfigRegistry()->getBaseConfig();
        $listingConfig = $this->getViewSection($environment->getDataDefinition())->getListingConfig();
        $panel         = $environment->getView()->getPanel();

        ViewHelpers::initializeSorting($panel, $dataConfig, $listingConfig);

        return $environment->getDataProvider()->fetchAll($dataConfig);
    }
212945
protected function loadDynamicConfig()
    {
        $className = $this->dynamicConfigClass();
        if ($className) {
            $config = $this->modelFactory()->get($className);

            if ($config instanceof StorableInterface && !$config->id()) {
                $config->load(1);
            }

            return $config;
        }

        return null;
    }
44932
protected function load_config() {
        global $DB;

        if (!$config = $DB->get_record('workshopform_rubric_config', array('workshopid' => $this->workshop->id), 'layout')) {
            $config = (object)array('layout' => 'list');
        }
        return $config;
    }