Load configs from packages.

@return void
11188
private function loadConfigPackages()
    {
        $config = Container::getInstance()->get('config');
        $list   = $config->get('global.package');

        if (empty($list) || !is_array($list)) {
            return;
        }

        foreach ($list as $name => $data) {
            if (!isset($data['config'])) {
                continue;
            }

            $config->loadYamlFromDirectory($data['config']);
        }
    }
119951
protected function loadConfig()
    {
        $config = new Config(
            \Hail\Facade\Config::get('migrate')
        );

        $this->setConfig($config);
    }
1130522
public function loadSettings()
    {
        $extra = $this->composer->getPackage()->getExtra();
        $config = array_merge(
            array(
                'include' => array(),
                'require' => array(),
                'recurse' => true,
                'replace' => false,
                'ignore-duplicates' => false,
                'merge-dev' => true,
                'merge-extra' => false,
                'merge-extra-deep' => false,
                'merge-scripts' => false,
            ),
            isset($extra['merge-plugin']) ? $extra['merge-plugin'] : array()
        );

        $this->includes = (is_array($config['include'])) ?
            $config['include'] : array($config['include']);
        $this->requires = (is_array($config['require'])) ?
            $config['require'] : array($config['require']);
        $this->recurse = (bool)$config['recurse'];
        $this->replace = (bool)$config['replace'];
        $this->ignore = (bool)$config['ignore-duplicates'];
        $this->mergeDev = (bool)$config['merge-dev'];
        $this->mergeExtra = (bool)$config['merge-extra'];
        $this->mergeExtraDeep = (bool)$config['merge-extra-deep'];
        $this->mergeScripts = (bool)$config['merge-scripts'];
    }
469538
protected function setupPackage()
    {
        $source = realpath(__DIR__.'/../config/contact.php');

        $this->publishes([$source => config_path('contact.php')]);

        $this->mergeConfigFrom($source, 'contact');

        $this->loadViewsFrom(realpath(__DIR__.'/../views'), 'contact');
    }
286828
protected function setupPackage()
    {
        $configuration = realpath(__DIR__.'/../config/credentials.php');
        $migrations = realpath(__DIR__.'/../migrations');

        $this->publishes([
            $configuration => config_path('credentials.php'),
            $migrations    => base_path('database/migrations'),
        ]);

        $this->mergeConfigFrom($configuration, 'credentials');

        $this->loadViewsFrom(realpath(__DIR__.'/../views'), 'credentials');
    }
849047
protected function loadConfig()
    {
        $this->namespace = config('repository.generate.namespace', $this->namespace);
        $this->base      = config('repository.generate.base', $this->base);
        $this->suffix    = config('repository.generate.suffix', $this->suffix);
        $this->models    = config('repository.generate.models', $this->models);
    }
1253192
private function loadConfig()
    {
        $appBundle = null;
        $this->getEventManager()->dispatch(self::EVENT_BEFORE_LOAD_CONFIG, $this);

        foreach ($this->registerBundles() as $bundle) {
            if ($bundle instanceof \App\AppBundle) {
                $appBundle = $bundle;
                continue;
            }

            $bundle->loadConfig();
        }

        if (!$appBundle instanceof \App\AppBundle) {
            throw new BaseException('AppBundle does not exist.');
        }

        $appBundle->loadConfig();
        $this->getEventManager()->dispatch(self::EVENT_AFTER_LOAD_CONFIG, $this);
    }
395739
public function load_config() {
        $cfg = [];
        require __DIR__ . '/defaults.php';
        if (file_exists($this->config_path)) {
            require $this->config_path;
        }
        $this->data = $cfg;
    }
1269478
protected static function _loadModulesConfig( )
		{
			$config = array( '..' , '.' );
			foreach ( static::options( ) as $key => $val )
			{
				$config[ ] = $key . '.php';
			}
			foreach ( Module::all( ) as $k => $module )
			{
				$scanned_directory = array_diff( scandir( ptc_path( 'root' ) . '/modules/' . $k . '/config' ) , $config );
				if ( !empty( $scanned_directory ) )
				{
					foreach ( $scanned_directory as $file )
					{
						$option_name = str_replace( '.php' , '' , $file );
						$options = require( ptc_path( 'root' ) . '/modules/' . $k . '/config/' . $file );
						if ( ptc_array_get( $options , '_load' ) )
						{
							$options = call_user_func( ptc_array_get( $options , '_load' ) , $options );
						}
						static::option( $option_name , $options );
					}
				}
			}
		}
1046767
protected function loadConfig()
    {
        // Start with empty config
        $this->config = [];

        // Build a lit of all the paths
        $dir = config_path('decoy').'/';
        $files = [];
        if (is_readable($dir.'elements.yaml')) {
            $files[] = $dir.'elements.yaml';
        }
        if (is_dir($dir.'elements')) {
            $files = array_merge($files, glob($dir.'elements/*.yaml'));
        }
        if (!count($files)) {
            return;
        }

        // Loop though config files and merge them together
        foreach ($files as $file) {

            // If an array found ...
            if (($config = Yaml::parse(file_get_contents($file)))
                && is_array($config)) {

                // Merge it in
                $this->config = array_replace_recursive($this->config, $config);
            }
        }
    }
895748
protected function configHandle()
    {
        $packageConfigPath = __DIR__.'/config/config.php';
        $appConfigPath     = config_path('comment.php');

        $this->mergeConfigFrom($packageConfigPath, 'comment');

        $this->publishes([
            $packageConfigPath => $appConfigPath,
        ], 'config');
    }
464896
public function setupPackageAutoloaders()
    {
        $pla = \Concrete\Core\Package\PackageList::get();
        $pl = $pla->getPackages();
        $cl = ClassLoader::getInstance();
        /** @var \Package[] $pl */
        foreach ($pl as $p) {
            \Config::package($p);
            if ($p->isPackageInstalled()) {
                $pkg = $this->make('Concrete\Core\Package\PackageService')->getClass($p->getPackageHandle());
                if (is_object($pkg) && (!$pkg instanceof \Concrete\Core\Package\BrokenPackage)) {
                    $cl->registerPackage($pkg);
                    $this->packages[] = $pkg;
                }
            }
        }
    }
1305227
public function loadConfig()
    {
        if (!$this->registry->isRedirect()) {
            $storeId = $this->sgCoreConfig->getStoreId($this->getShopNumber());
            $this->storeManager->setCurrentStore($storeId);
        }
        $this->loadArray($this->toArray());
        $this->setExportTmpAndLogSettings();
    }
1210480
public function loadModuleDependencies($module)
    {
        $config = $module->getConfig();
        if (isset($config['modules'])) {
            $this->loadConfig($config, $module);
        }
    }
711068
public function loadConfig()
    {
        $fileName = $this->getPath() . DIRECTORY_SEPARATOR . 'config/config.php';
        if(is_file($fileName))
        {
            $name = '@' . $this->moduleName;
            Config::removeConfig($name);
            Config::addConfig($name, include $fileName);
        }
    }
998574
protected function loadConfiguration()
    {
        $configPath = __DIR__ . '/../config/onesky.php';

        $this->publishes([
            $configPath => config_path('onesky.php'),
        ], 'config');

        $this->mergeConfigFrom($configPath, 'onesky');
    }
468896
function loadConfig(done) {
  fs.stat('package.json', function(err) {
    if (err) return done(undefined, {});
    fs.readFile('package.json', function(err, contents) {
      if (err) return done(err);
      try {
        done(undefined, JSON.parse(contents).config || {});
      } catch(err) {
        done(err);
      }
    });
  });
}