/** * {@inheritdoc} * * Merges created config instance in project config instance. * * @param array $files * @param Config $config * * @return ProjectConfig */ public function load(array $files, Config $config = null) { $deploymentConfig = new ProjectConfig(); return $deploymentConfig->merge(parent::load($files, $config)); }
<?php /* * This file is part of the andreas-weber/php-config library. * * (c) Andreas Weber <*****@*****.**> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ use AndreasWeber\Config\Core\ConfigLoader; require_once __DIR__ . '/../resources/bootstrap.php'; $configLoader = new ConfigLoader(); $config = $configLoader->loadArray(array('custom1' => array('logPath' => '/tmp/logfile.txt'), 'custom2' => true)); var_export($config->toArray());
<?php /* * This file is part of the andreas-weber/php-config library. * * (c) Andreas Weber <*****@*****.**> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ use AndreasWeber\Config\Core\ConfigLoader; require_once __DIR__ . '/../resources/bootstrap.php'; $configLoader = new ConfigLoader(); $config = $configLoader->load(array(BASEPATH . '/examples/resources/fixtures/config1.yml')); var_export($config->toArray()); $configMerged = $configLoader->load(array(BASEPATH . '/examples/resources/fixtures/config2.yml'), $config); var_export($configMerged->toArray());
<?php /* * This file is part of the andreas-weber/php-config library. * * (c) Andreas Weber <*****@*****.**> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ use AndreasWeber\Config\Core\ConfigLoader; require_once __DIR__ . '/../resources/bootstrap.php'; $configLoader = new ConfigLoader(array('version' => '1.1.3', 'basepath' => BASEPATH)); $config = $configLoader->load(array(BASEPATH . '/examples/resources/fixtures/config3.yml')); var_export($config->toArray());