addConfiguration

Add configuration settings. If settings exist, they are overridden.

@param  array      $configuration
@return Connection $this
963845
public function addConfiguration(array $configuration)
    {
        $this ->configuration->setParameter(
            'configuration',
            array_merge(
                $this->configuration->getParameter('configuration'),
                $configuration
            )
        );

        return $this;
    }
275669
private function checkTransitionsConfiguration(array $configuration)
    {
        foreach ($configuration as $transitionConfiguration) {
            if (
                is_array($transitionConfiguration) &&
                (count($transitionConfiguration) === 3) &&
                isset($transitionConfiguration[0]) &&
                is_string($transitionConfiguration[0]) &&
                $transitionConfiguration[0] &&
                isset($transitionConfiguration[1]) &&
                is_string($transitionConfiguration[1]) &&
                $transitionConfiguration[1] &&
                isset($transitionConfiguration[2]) &&
                is_string($transitionConfiguration[2]) &&
                $transitionConfiguration[2]
            ) {
                return $this;
            }
        }

        throw new TransitionNotValidException();
    }
978089
public function add(string $name, array $value)
    {
        $this->config->add($name, $value);
        return $this;
    }
858592
private function flushConfiguration(ConfigurationInterface $configuration)
    {
        $this
            ->configurationObjectManager
            ->persist($configuration);

        $this
            ->configurationObjectManager
            ->flush($configuration);

        return $this;
    }
1262222
public function checkMethods(array $configuration)
    {
        foreach ($configuration as $classNamespace => $classConfiguration) {
            if (
                !isset($classConfiguration['idGetter']) ||
                !method_exists($classNamespace, $classConfiguration['idGetter']) ||
                !isset($classConfiguration['fields']) ||
                !is_array($classConfiguration['fields'])
            ) {
                throw new TranslationDefinitionException();
            }

            foreach ($classConfiguration['fields'] as $fieldName => $fieldConfiguration) {
                if (
                    $fieldName &&
                    $fieldConfiguration &&
                    is_array($fieldConfiguration) &&
                    isset($fieldConfiguration['getter']) &&
                    method_exists($classNamespace, $fieldConfiguration['getter']) &&
                    isset($fieldConfiguration['setter']) &&
                    method_exists($classNamespace, $fieldConfiguration['setter'])
                ) {
                    continue;
                }

                throw new TranslationDefinitionException(
                    'Field ' . $classNamespace . ' not found, or methods [' . $fieldConfiguration['getter'] . ', ' . $fieldConfiguration['setter'] . '] not found inside the class'
                );
            }
        }

        return $this;
    }
67144
public void addConfiguration(I_CmsXmlConfiguration configuration) {

        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_ADD_CONFIG_1, configuration));
        }
        m_configurations.add(configuration);
        cacheDtdSystemId(configuration);
    }
1011146
public function setConfig(array $config = [])
    {
        $config = $config + $this->config;

        foreach ($this->defaults as $key => $value) {
            if (!array_key_exists($key, $config)) {
                $config[$key] = $value;
            }
        }

        $this->config = $config;

        return $this;
    }
9474
public function setConfiguration($configuration)
    {
        $this->configuration = (string) $configuration;

        $message = sprintf("Set configuration to [%s].", $this->configuration);
        $this->log($message, Project::MSG_DEBUG);
    }
1281813
public function configure(array $configuration) : bool
    {
        //====================================================================//
        // Setup Connector Configuration
        $this->getConnector()->configure(
            $this->getWebserviceId(),
            $this->getWebserviceId(),
            $configuration
        );
        //====================================================================//
        // Mark Connector as Configured
        return $this->identified = true;
    }
557560
public function add(array $config) : self
    {
        $this->config = array_replace_recursive($this->config, $config);

        return $this;
    }
331348
protected function setEnv(array $configuration)
    {
        if (isset($configuration[static::CONFIG_ENV])) {
            $this->configuration->setEnv($configuration[static::CONFIG_ENV]);
        }
    }
230843
public function add($key, $value)
    {
        $array = array_get($this->configs, $key);

        if (is_array($array)) {
            $array[] = $value;
            array_set($this->configs, $key, $array);
        }


        return $this;
    }
541037
public function createConnection(HostConfiguration $configuration)
    {
        if ($this->cache->offsetExists($configuration)) {
            return $this->cache->offsetGet($configuration);
        }
        $connection = new SocketConnection();
        $connection->setConfiguration($configuration);
        $connection->open();
        $this->cache->attach($configuration, $connection);
        return $connection;
    }
1342211
public function setup($configurations = array())
    {
        foreach ($configurations as $key => $value) {
            if (!$this->registry->config->has($key)) {
                throw new \RuntimeException(sprintf('Unknown setup key %s.', $key));
            }
            if ($this->registry->validator->has($key)) {
                $validator = $this->registry->validator->get($key);
                if (!$validator->isValid($value)) {
                    if (count($choices = $validator->getChoices())) {
                        throw new \RuntimeException(sprintf('Invalid value %s for %s, values are %s.', var_export($value, true), $key, implode(', ', $choices)));
                    } else {
                        throw new \RuntimeException(sprintf('Invalid value %s for %s.', var_export($value, true), $key));
                    }
                }
            }
            $this->registry->config->set($key, $value);
        }

        return $this;
    }
747957
protected function mapConfiguration(array $configuration)
    {
        array_walk($configuration, function ($value, $key) use (&$configuration) {
            $newKey = lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $key))));
            $configuration[$newKey] = $value;
        });

        return $configuration;
    }
372486
public function setConfig(array $config)
    {
        $this->config = array_merge($this->config, $config);

        if ($this->config[ 'responsive' ]) {
            $this->responsive();
        }

        return $this;
    }
60792
protected function setConfig(array $config = array())
    {
        $this->config = $config;

        if (isset($config['prefix'])) {
            $this->prefix = $config['prefix'];
        }

        if (isset($config['host'])) {
            $this->host = $config['host'];
        }

        if (isset($config['port'])) {
            $this->port = $config['port'];
        }

        return $this;
    }