Set service options

@param  array|Traversable|string $config
@return Service
760247
public function setConfig($config)
    {
        if(is_string($config) && file_exists($config)){
            $options = \Zend\Config\Factory::fromFile($config);
            $this->setOptions($options);
        }
        elseif(!is_array($config) && !($config instanceof \Traversable)){
            throw new \InvalidArgumentException('Invalid parameter $config or config file not found');
        }
        
    	$this->options = new SetupUtilsOptions($config);
    	return $this;
    }
902116
public function setOptions($options)
	{
		if (!is_array($options) && !$options instanceof Traversable) {
			throw new \InvalidArgumentException(sprintf(
				'Expected an array or Traversable; received "%s"',
				(is_object($options) ? get_class($options) : gettype($options))
			));
		}
		
		foreach ($options as $key => $value){
			
			$key = strtolower($key);
			
			switch ($key) {
			    case 'services':
			        $this->registerServices($value);
			        break;
			    case 'locator':
			    case 'service_locator':
			        $this->setServiceLocator($value);
			        break;
		        case 'service_manager':
		            $this->configureServiceManager($value);
		            break;
			}
		}
		
		return $this;
	}
846864
public function loadServices(array $config)
    {
        foreach ($this->loaders as $loader) {
            $loader->load($config, $this->container);
        }
        return $this;
    }
777206
public function setOptions(? Iterable $config = null): self
    {
        if (null === $config) {
            return $this;
        }

        foreach ($config as $option => $value) {
            switch ($option) {
                case 'options':
                    $this->options = $value;

                    break;
                case 'uri':
                case 'binddn':
                case 'bindpw':
                case 'basedn':
                    $this->{$option} = (string) $value;

                    break;
                case 'tls':
                    $this->tls = (bool) $value;

                    break;
                default:
                    throw new Exception('unknown option '.$option.' given');
            }
        }

        return $this;
    }
76487
public function withPurifierConfig($config)
    {
        $this->purifierConfig = is_array($config) ? array_merge($this->purifierConfig, $config) : $config;

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

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

        return $this;
    }
149428
protected function setBasicOptions(array $config)
    {
        if (!isset($config['timeout'])) {
            $config['timeout'] = static::DEFAULT_REQUEST_TIMEOUT;
        }

        if (isset($config['base_uri']) && strpos($config['base_uri'], 'http') === false) {
            $config['base_uri'] = 'https://' . $config['base_uri'];
            return $config;
        }
        return $config;
    }
229211
public function setConfig($config)
    {
        $this->config = $config;

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

        return $this;
    }
413757
public function setConfig(array $config) {
        if (!$config) {
            return $this;
        }

        foreach ($config as $key => $value) {
            switch ($key) {
                case 'open':
                case 'close':
                    $this->setBrackets($config['open'], $config['close']);
                break;
                case 'locale':
                    $this->setLocale($value);
                break;
                case 'disable':
                case 'disabled':
                    $this->disable($value);
                break;
                case 'shorthand':
                case 'shorthandLinks':
                    $this->setShorthand($value);
                break;
                case 'xhtml':
                case 'xhtmlOutput':
                    $this->setXhtml($value);
                break;
                case 'escape':
                case 'escapeHtml':
                    $this->setEscaping($value);
                break;
                case 'strict':
                case 'strictMode':
                    $this->setStrict($value);
                break;
                case 'newlines':
                case 'maxNewlines':
                    $this->setMaxNewlines($value);
                break;
                case 'standaloneTags':
                    $this->setStandaloneTags($value);
                break;
                case 'lineBreaks':
                    $this->setLineBreaks($value);
                break;
                case 'removeEmpty':
                    $this->setRemoveEmptyTags($value);
                break;
                case 'cacheExpires':
                    $this->setCacheExpiration($value);
                break;

                // Doesn't need a setter as it's only used in the constructor
                case 'configPath':
                    $this->_config['configPath'] = $value;
                break;
            }
        }

        return $this;
    }
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;
    }
1336508
public function setOptions($options = array())
    {
        if ($options instanceof Traversable) {
            $options = ArrayUtils::iteratorToArray($options);
        }

        if (!is_array($options)) {
            throw new \Exception('Config parameter is not a valid');
        }

        foreach ($options as $key => $value) {
            $this->options[$key] = $value;
        }

        return $this;
    }
992429
public function setConfig($config)
    {
        if(is_string($config)){
            if (file_exists($config)) {
                $config = \Zend\Config\Factory::fromFile($config);
            } else {
                throw new \InvalidArgumentException(
                    sprintf('Unable to read configurations from file %s',$config));
            }
        }
    
        if(!is_array($config) && !($config instanceof \Traversable)){
            throw new \InvalidArgumentException(
                    sprintf('Config must be an array, Traversable object or filename; %s received',
                            is_object($config) ? get_class($config) : gettype($config)));
        }
    
        $this->setOptions($config);
    }
734991
protected function parseConfig(array $config)
    {
        $config = $this->setHost($config);
        $config = $this->setPort($config);
        $config = $this->setProtocol($config);
        $config = $this->setServiceId($config);
        $config = $this->setTNS($config);
        $config = $this->setCharset($config);

        return $config;
    }
1325038
public function put(array $config)
    {
        foreach ($config as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
775852
public static function createServiceManager(array $config = [])
    {
        $serviceManager = new ServiceManager(new Config($config));

        $serviceManager->addInitializer(
            function ($instance, ServiceLocatorInterface $serviceLocator) {
                if ($instance instanceof ModelManagerAwareInterface) {
                    $instance->setModelManager($serviceLocator->get('modelmanager'));
                }
            }
        );

        $serviceManager->addInitializer(
            function ($instance, ServiceLocatorInterface $serviceLocator) {
                if ($instance instanceof ServiceLocatorAwareInterface) {
                    $instance->setServiceLocator($serviceLocator);
                }
            }
        );

        return $serviceManager;
    }
256514
public static function factory($config = array()) {
        $defaults = array(
            'base_url' => self::API_URL,
            'version' => 'v2.1',
            'command.params' => array(
                'command.on_complete' => function($command) {
                    $response = $command->getResult();

                    // We don't need the meta blocks
                    unset($response['meta']);

                    // If we're down to a single element (events, talks etc)
                    // return only this element
                    if (count($response) == 1) {
                        $command->setResult(reset($response));
                    }
                }
            )
        );

        $required = array(
            'base_url',
            'version',
        );

        $config = Collection::fromConfig($config, $defaults, $required);

        $client = new self($config->get('base_url'), $config);

        // Attach a service description to the client
        $description = ServiceDescription::factory(__DIR__ . '/client.json');
        $client->setDescription($description);

        return $client;
    }
1329193
public function setConfig($config = [])
    {
        if (!empty($config) && is_array($config)) {
            $this->config = $config;
        } else {
            $this->config = NULL;
        }
        $this->debug->debug(__FUNCTION__, '$this->config: ' . json_encode($this->config));

        return $this;
    }