Set options using an instance of type Zend_Config

@param Zend_Config $config
@return Zend_Cache_Core
165771
public function setConfig(Zend_Config $config)
    {
        $options = $config->toArray();
        while (list($name, $value) = each($options)) {
            $this->setOption($name, $value);
        }
        return $this;
    }
905735
public function setConfig(array $config)
    {
        foreach ($config as $name => $value) {
            $setter = 'set' . ucfirst($name);

            call_user_func_array(array($this, $setter), array($value));
        }
    }
1221366
public function setConfig(array $config)
    {
        if (empty($config)) {
            return $this;
        }

        foreach ($this->configurable as $setting) {
            if ( ! isset($config[$setting])) {
                continue;
            }

            if (property_exists($this, $setting)) {
                $this->$setting = $config[$setting];
            }
        }

        return $this;
    }
1191699
public function createService(Config $config)
    {
        $options = $config->getCacheOptions();

        $storage = new FileSystem($options->getStorageOptions());

        return $storage;
    }
1142485
public function setConfig(array $config)
    {
        if (!isset($config['thumbnailer'])) {
            $this->_thumbnailer = new Thumbnailer();
        } elseif (class_exists($config['thumbnailer'])) {
            $this->_thumbnailer = new $config['thumbnailer'];
        } else {
            throw new ConfigurationException('Class ' . $config['thumbnailer'] . ' does not exist.');
        }

        if (!($this->_thumbnailer instanceof ThumbnailerInterface)) {
            throw new ConfigurationException('Class ' . get_class($this->_thumbnailer) . ' must implement the interface \ysaroka\autothumb\ThumbnailerInterface.');
        }

        if (!isset($config['document_root'])) {
            throw new ConfigurationException('"document_root" key is required.');
        }

        if (!is_dir(realpath($config['document_root']))) {
            throw new ConfigurationException('"document_root": directory "' . $config['document_root'] . '" does not exist.');
        }

        if (!isset($config['types']) || count($config['types']) == 0) {
            throw new ConfigurationException('"types" key is required and should not be empty.');
        }

        foreach ($config['types'] as $type => $params) {
            if (!preg_match('#^[\w\d]+$#', $type)) {
                throw new ConfigurationException('"type": type name "' . $type . '" must contain only words and numbers.');
            }

            if (!isset($params['width'])) {
                $config['types'][$type]['width'] = 100;
            }

            if (!isset($params['height'])) {
                $config['types'][$type]['height'] = 100;
            }

            if (!isset($params['crop'])) {
                $config['types'][$type]['crop'] = true;
            }

            if (!isset($params['stretch'])) {
                $config['types'][$type]['stretch'] = false;
            }

            if (!isset($params['watermark'])) {
                $config['types'][$type]['watermark'] = false;
            } elseif (file_exists($params['watermark']) && !is_dir($params['watermark'])) {
                $config['types'][$type]['watermark'] = realpath($params['watermark']);
                if (isset($params['watermark_pos']) && defined('\ysaroka\autothumb\ThumbnailerInterface::POS_' . strtoupper($params['watermark_pos']))) {
                    $config['types'][$type]['watermark_pos'] = constant('\ysaroka\autothumb\ThumbnailerInterface::POS_' . strtoupper($params['watermark_pos']));
                } else {
                    $config['types'][$type]['watermark_pos'] = ThumbnailerInterface::POS_BOTTOM_RIGHT;
                }
            } else {
                throw new ConfigurationException('Image file "watermark": "' . $params['watermark'] . '" for type "' . $type . '" does not exist.');
            }
        }

        if (isset($config['allowed_extensions']) && is_array($config['allowed_extensions']) && count($config['allowed_extensions']) > 0) {
            $this->_allowedExtensions = $config['allowed_extensions'];
        }

        $this->_documentRoot = realpath($config['document_root']);
        $this->_types = $config['types'];

        return $this;
    }
91636
private function configureStorage(array $config, ContainerBuilder $container)
    {
        $container->register('doctrine.key_value.storage', 'Doctrine\KeyValueStore\Storage\DoctrineCacheStorage')
            ->setPublic(false)
            ->addArgument(new Reference('cache.' . $config['cache_driver']));
    }
1263792
public function setConfig(array $config)
    {
        foreach ($config as $key => $value) {
            switch ($key) {
                case 'verbose':
                case 'loadEnv':
                    if (!is_bool($value)) {
                        throw new ConfigurationException($key, 'This should be a boolean value.');
                    }

                    $this->config[$key] = $value;
                    break;

                default:
                    throw new ConfigurationException($key, 'This is an unknown configuration option.');
            }
        }
    }
563414
public static function configure($config)
    {
        if (is_null(static::$instance)) {
            static::$instance = new self();

            static::$name = $config['default'];

            static::$config = $config;
        }

        return static::$instance;
    }
745903
public function setConfig($config)
    {
        if (is_string($config)) {
            // Treat the parameter as a filepath
            $this->config = $this->createConfig($config);
        } elseif (is_array($config)) {
            $this->config = $this->createConfig($config);
        } elseif ($config instanceof ConfigInterface) {
            $this->config = $config;
        } else {
            throw new InvalidArgumentException(sprintf(
                'Configset must be an associative array, a file path, or an instance of %s',
                ConfigInterface::class
            ));
        }

        return $this;
    }
1180149
public function setConfig($config)
    {
        $this->config = $config instanceof Structure ? $config : new Structure($config);

        return $this;
    }
318368
protected function getOptionsFromConfig(Config $config)
    {
        $options = $this->options;

        if ($visibility = $config->get('visibility')) {
            // For local reference
            $options['visibility'] = $visibility;
            // For external reference
            $options['ACL'] = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? 'public-read' : 'private';
        }

        if ($mimetype = $config->get('mimetype')) {
            // For local reference
            $options['mimetype'] = $mimetype;
            // For external reference
            $options['ContentType'] = $mimetype;
        }

        foreach (static::$metaOptions as $option) {
            if ( ! $config->has($option)) {
                continue;
            }
            $options[$option] = $config->get($option);
        }

        return $options;
    }
211340
public function setConfig(Config $config)
    {
        parent::setConfig($config);

        foreach ($this->sequence as $command) {
            $command->setConfig($config);
        }

        return $this;
    }
331391
public function setConfiguration($config)
    {
        $this->config = $config;
        $service = $this->getService();
        return $service->processConfiguration($this->config);
    }
1364674
public function loadConfiguration(array $config = [])
    {
        if (isset($config['login'])) {
            $this->setLogin($config['login']);
        }
        if (isset($config['password'])) {
            $this->setPassword($config['password']);
        }
        if (isset($config['dsn'])) {
            $this->setDSN($config['dsn']);
        }
        return $this;
    }
68207
protected function configure(array $config = [])
    {
        foreach ($config as $key => $value) {
            $method = 'set' . $key;
            if (method_exists($this, $method)) {
                $this->$method($value);
            }
        }
    }
1263868
public function setConfig($config)
    {
        $this->config = $config;

        $this->routes = $config['routes'];
        $this->templates = $config['templates'];
        $this->options = $config['options'];
        $this->layoutView = $config['layout'];

        return $this;
    }
161583
public function setConfigs(iterable $config): self
    {
        foreach ($config as $name => $value) {
            $this->setConfig($name, $value);
        }
        return $this;
    }