Get configuration block.

@throws \Robo\Exception\TaskException
Thrown when configuration key does not exists.
491011
protected function getConfigurationBlock() {
    $line[] = '';
    $line[] = $this->blockStart;
    $line[] = '';

    if (!$this->configObject->has($this->configKey)) {
      throw new TaskException($this, "Configuration key '{$this->configKey}' not found on current Robo configuration.");
    }

    foreach ($this->configObject->get($this->configKey) as $variable => $values) {
      foreach ($values as $name => $value) {
        $line[] = $this->getStatement($variable, $name, $value);
      }
      $line[] = '';
    }

    $line[] = $this->blockEnd;
    $line[] = '';
    return implode($line, "\n");
  }
1178921
public static function getConfiguration()
    {
        if (self::$configuration === null && file_exists(self::$configFilePath)) {
//            $jsonConfig = file_get_contents(self::$configFilePath_depr);
//            self::$configuration = json_decode($jsonConfig);

            $settings = include __DIR__ . '/../../config/configuration.php';

            self::$configuration = DWDUtil::array_to_object($settings);

            if (DWDConfiguration::$configuration === null)
                throw new ParseError('Error, configuration file could not be found or contains invalid lines.');
        }
        return DWDConfiguration::$configuration;

    }
227474
public function getConfig($key = '')
    {
        $config = $this->getParam('config');
        if (empty($key)) {
            return $config;
        }

        if (!\array_key_exists($key, $config)) {
            throw new InvalidException('Config key is not set: '.$key);
        }

        return $config[$key];
    }
1280510
public function get_setting($name) {
        $namewithprefix = 'section_' . $this->sectionid . '_' . $name;
        $result = null;
        foreach ($this->settings as $key => $setting) {
            if ($setting->get_name() == $namewithprefix) {
                if ($result != null) {
                    throw new base_task_exception('multiple_settings_by_name_found', $namewithprefix);
                } else {
                    $result = $setting;
                }
            }
        }
        if ($result) {
            return $result;
        } else {
            // Fallback to parent
            return parent::get_setting($name);
        }
    }
579499
public function getConfig($key = null, $default = null)
    {

        $configurator = $this->getConfigurator();
        if (null === $key) {
            return $configurator;
        }

        return $configurator->get($key, $default);
    }
998347
public function getConfig($key = null, $default = null)
    {
        $name = $this->current ?: 'default';

        $configs = $this->configs[$name];
        if ($key === null) {
            return $configs;
        }

        return isset($configs[$key]) ? $configs[$key] : $default;
    }
239708
public function getConfig(string $key, ?Configuration $default = null): Configuration
    {
        $resolved = false;
        $value = $this->getByKey($key, $this->data, $resolved);
        
        if ($resolved) {
            return new static($value);
        }
        
        return $default ?? new static();
    }
837154
public function getConfiguration(){
        $rest = $this->getService( self::API_DOWNLOAD_CONFIG);
        $rest->GET();

        return $rest->getResult( models\Download\Config\DownloadConfig::class);
    }
1362230
private function getTemplate()
    {
        if ($this->template) {
            return $this->template;
        }

        try {
            $this->template = $this->environment->load($name = $this->config['template']);
        } catch (\Twig_Error $e) {
            throw new Exception\RenderingException("Failed to load $name template.");
        }

        // TODO : hasBlock() does not use template inheritance.

        if (!$this->template->hasBlock('cms_content')) {
            throw new Exception\RenderingException('Unable to find "cms_content" twig block.');
        }
        if (!$this->template->hasBlock('cms_container')) {
            throw new Exception\RenderingException('Unable to find "cms_container" twig block.');
        }
        if (!$this->template->hasBlock('cms_row')) {
            throw new Exception\RenderingException('Unable to find "cms_row" twig block.');
        }
        if (!$this->template->hasBlock('cms_block')) {
            throw new Exception\RenderingException('Unable to find "cms_block" twig block.');
        }

        return $this->template;
    }
134435
public function getConfig($key = '')
    {
        if (empty($key)) {
            return $this->_config;
        }

        if (!\array_key_exists($key, $this->_config)) {
            throw new InvalidException('Config key is not set: '.$key);
        }

        return $this->_config[$key];
    }
1352506
public function findById($id)
    {
        /** @var PluginInstance $pluginInstance */
        $pluginInstance = $this->pluginInstanceRepository->find($id);

        if (empty($pluginInstance)) {
            return null;
        }

        $configFromDb = $pluginInstance->getInstanceConfig();

        $blockConfig = $this->blockConfigRepository->findById($pluginInstance->getPlugin());

        if (empty($blockConfig)) {
            throw new \Exception(
                'Block Config not found for: ' . $pluginInstance->getPlugin()
            );
        }

        $defaultConfig = $blockConfig->getDefaultConfig();
        $mergedConfig = $this->instanceConfigMerger->__invoke($defaultConfig, $configFromDb);

        $blockInstance = $this->getNew(
            $id,
            $pluginInstance->getPlugin(),
            $mergedConfig,
            []
        );

        return $blockInstance;
    }
879712
public function getConfig($key)
    {
        if (null === $this->configs) {
            $this->loadConfigs();
        }

        if (false == array_key_exists($key, $this->configs)) {
            $availableKeys = implode(', ', array_keys($this->configs));
            throw new \RuntimeException(sprintf('Config "%s" could not be found. Found: %s', $key, $availableKeys));
        }

        $config = $this->configs[$key];

        return $config;
    }
829810
public function getConfig()
    {
        if ($this->cache instanceof Cache\CacheInterface && !empty($configs = $this->cache->getConfig())) {
            return $configs;
        }

        $configs = $this->moduleHandler->getModulesConfig();
        foreach ($this->files as $file) {
            $config = require $file;
            if (!is_array($config)) {
                throw new Exception\RuntimeException(sprintf('The config in "%s" file must be array data type', $file));
            }
            $configs = ArrayUtils::merge($configs, require $file);
        }

        return $this->cleanUp($configs);
    }
954008
public function getConfigRoot(): string
    {
        return $this->getAppRoot().Constants::DS.$this->config[ConfigurationInterface::KEY_CONFIG_ROOT];
    }
89365
protected function getConfigBlock()
    {
        $designPackage = Mage::getSingleton('core/design_package');
        $designPackage->setArea('shell');
        $block = Mage::app()->getLayout()->createBlock('ecomdev_varnish/vcl_config');
        return $block;
    }
430669
protected function getConfiguration($key = null)
    {
        return $key ? static::$config[$this->getProtocol()][$key] : static::$config[$this->getProtocol()];
    }
448783
public function getConfiguration()
    {
        if (!$this->_configuration) {

            //If model is using
            if ($this->modelClass) {

                $this->_configuration = $this->_keyStorage->get($this->getKey()) ?: [];
                $modelClass = $this->modelClass;
                if (!$this->_configuration || !($this->_configuration instanceof $modelClass)) {
                    //Initialize new model. Default values must be set in model (init method)
                    $this->_configuration = Yii::createObject($modelClass, $this->modelConfig);
                }

                //Default values from 'attributes'
                if (is_array($this->attributes)) {
                    foreach ($this->attributes as $key => $default) {
                        if ($this->_configuration->{$key} === null) {
                            $this->_configuration->{$key} = $default;
                        }
                    }
                }

            } else {

                //Array configuration
                $dbConfig = $this->_keyStorage->get($this->getKey()) ?: [];

                if (is_array($this->attributes)) {
                    //Needs to filter
                    $config = [];
                    foreach ($this->attributes as $key => $default) {
                        $config[$key] = (isset($dbConfig[$key]) && $dbConfig[$key] !== null) ? $dbConfig[$key] : $default;
                    }
                    $this->_configuration = $config;
                } else {
                    $this->_configuration = $dbConfig;
                }

            }
        }
        return $this->_configuration;
    }