Behat\Testwork\ServiceContainer\Configuration\ConfigurationLoader::loadConfiguration PHP 메소드

loadConfiguration() 공개 메소드

Reads configuration sequence for specific profile.
public loadConfiguration ( string $profile = 'default' ) : array
$profile string Profile name
리턴 array
    public function loadConfiguration($profile = 'default')
    {
        $configs = array();
        $this->profileFound = false;
        // first is ENV config
        foreach ($this->loadEnvironmentConfiguration() as $config) {
            $configs[] = $config;
        }
        // second is file configuration (if there is some)
        if ($this->configurationPath) {
            $this->debugInformation['configuration_file_path'] = $this->configurationPath;
            foreach ($this->loadFileConfiguration($this->configurationPath, $profile) as $config) {
                $configs[] = $config;
            }
        }
        // if specific profile has not been found
        if ('default' !== $profile && !$this->profileFound) {
            throw new ConfigurationLoadingException(sprintf('Can not find configuration for `%s` profile.', $profile));
        }
        return $configs;
    }

Usage Example

예제 #1
0
 /**
  * Configures container based on provided config file and profile.
  *
  * @param InputInterface $input
  *
  * @return array
  */
 private function loadConfiguration(InputInterface $input)
 {
     $profile = $input->getParameterOption(array('--profile', '-p')) ?: 'default';
     return $this->configurationLoader->loadConfiguration($profile);
 }