Config the index.

@param IndexUUID $indexUUID
@param Config    $config

@throws ResourceNotAvailableException
552109
public function configureIndex(
        IndexUUID $indexUUID,
        Config $config
    ) {
        $this->load();
        parent::configureIndex(
            $indexUUID,
            $config
        );
        $this->save();
    }
311431
public function connect(array $config){

		// Defaults
		$defaults = array(
			'resource' => null,
			'charset' => 'utf8',
			'username' => ini_get('mysql.default_user'),
			'password' => ini_get('mysql.default_password'),
			'host' => ini_get('mysql.default_host'),
			'port' => ini_get('mysql.default_port'),
			'persistent' => false,
			'unbuffered' => false
		);

		$config += $defaults;
		if(isset($config['port']))
			$host = $config['host'] . ':' . $config['port'];
		else
			$host = $config['host'];

		// Connect
		if(is_resource($config['resource']))
			$connection = $config['resource'];
		elseif($config['persistent'])
			$connection = @mysql_pconnect($host, $config['username'], $config['password']);
		else
			$connection = @mysql_connect($host, $config['username'], $config['password']);

		if(!is_resource($connection))
			throw new DriverException("Connection to host '$host' failed.");

		// Select DB
		if(isset($config['database'])){
			$db = mysql_select_db($config['database']);
			if(!$db)
				throw new DriverException("Could not select database '$config[database]'.");
		}

		$this->resource = $connection;

		//Set charset
		if(is_resource($connection)){
			if(function_exists('mysql_set_charset'))
				@mysql_set_charset($config['charset'], $connection);
			else
				$this->runQuery("SET NAMES " . $config['charset']);
		}

		$this->unbuffered = $config['unbuffered'];
	}
639961
public function setConfig($config)
    {
        $this->config = $config;

        // Sanity check
        if (strpos($this->config['url'], '{id}') === false) {
            throw new Exception('Invalid Url: an id interpolation is required.', 1);
        }

        // Set media disk
        $this->config['disk'] = Arr::get(
            $this->config, 'disk', config('filesystems.default', 'local')
        );
    }
1329463
private function createIndexRepositories(
        ContainerBuilder $container,
        string $name,
        array $repositoryConfiguration,
        $indexId,
        $indexName
    ) {
        $this->createRepositoryReferenceServiceReference(
            $container,
            $name,
            $repositoryConfiguration,
            $indexId,
            $indexName
        );

        $this->createSearchRepository(
            $container,
            $name,
            $repositoryConfiguration,
            $indexName
        );
    }
206564
public function setUuid($uuid)
    {
        if (!is_null($uuid)) {
            $uuid = (string) $uuid;
        }

        $this->uuid = $uuid;
        return $this;
    }
1123623
public function checkIndex(IndexUUID $indexUUID): bool
    {
        return array_key_exists($this->getIndexKey($indexUUID), $this->indices);
    }
957343
public function configure(array $config, ConfigurationInterface $configuration, ContainerBuilder $container)
    {
        $processor = new Processor();
        $config    = $processor->processConfiguration($configuration, $config);

        $loader = new XmlFileLoader($container, new FileLocator($this->getConfigurationDirectory()));

		foreach(WallPosterBundle::getAvailableProviders() as $service)
		{
			if(isset($config[$service]))
			{
				$this->mapParameters($service, $config[$service], $container);
				$this->loadConfigurationFile($service,$loader);
			}
		}

        return array($config, $loader);
    }
524790
public function injectIndexClient(\Flowpack\SimpleSearch\Domain\Service\IndexInterface $indexClient) {
		$this->indexClient = $indexClient;
	}
535326
private function initializeConfig($config)
    {

        if (isset($config[self::ASSERT_VALID_IP_CONFIG])) {
            $this->assertValidIp = $config[self::ASSERT_VALID_IP_CONFIG];
        }

        // If we don't need to validate the service Ip, we're done here
        if ( ! $this->assertValidIp) {
            return;
        }

        /*
         *  If we should validate the service IP but there aren't
         *  any trusted IPs, throw an exception
         */
        if (empty($config[self::TRUSTED_IPS_CONFIG])) {
            throw new EmailServiceClientException(
                'The config entry for ' . self::TRUSTED_IPS_CONFIG .
                ' must be set (as an array) when ' .
                self::ASSERT_VALID_IP_CONFIG .
                ' is not set or is set to True.',
                1503511658
            );
        }

        /*
         * At this point, we need to validate the service Ip and we know
         * that the TRUSTED_IPS_CONFIG is not empty
         */
        $newTrustedIpRanges = $config[self::TRUSTED_IPS_CONFIG];
        if ( ! is_array($newTrustedIpRanges)) {
            throw new EmailServiceClientException(
                'The config entry for ' . self::TRUSTED_IPS_CONFIG .
                ' must be an array.',
                1503511659
            );
        }

        foreach ($newTrustedIpRanges as $nextIpRange) {
            $ipBlock = IPBlock::create($nextIpRange);
            $this->trustedIpRanges[] = $ipBlock;
        }

        $this->assertTrustedIp();
    }
210031
protected function findServiceIds(array $config, array &$serviceIds)
    {
        foreach ($config as $name => $value) {
            if (is_array($value)) {
                $this->findServiceIds($value, $serviceIds);
            } elseif ($name === 'service_id') {
                $serviceIds[] = $value;
            }
        }
    }
1192974
public function setConfig($config)
	{
		if (is_object($config)) {
			$config = get_object_vars($config);
		}
		foreach ($config as $index => $value) {
			$this->$index = $value;
		}
	}
613255
public function indexExists(IndexEvent $event)
    {
        $request = new Exists();
        $request->index($event->getIndexCode());

        /** @var \OpenSearchServer\Response\Response $response */
        $response = $this->getClient()->submit($request);

        if (true !== $response->isSuccess()) {
            throw new IndexNotFoundException(sprintf("The index '%s' doesn't exists with the current configuration", $event->getIndexCode()));
        }
    }
953445
public function resetIndex(IndexUUID $indexUUID)
    {
        if (!array_key_exists($this->getIndexKey($indexUUID), $this->indices)) {
            throw ResourceNotAvailableException::indexNotAvailable('Index not available in InMemoryRepository');
        }

        $this->indices[$this->getIndexKey($indexUUID)]['was_reset'] = true;
    }
776404
public static function create($id, array $config)
    {
        static::$databaseConnections[$id] = static::createDatabaseConnection($config);

        if (static::$activeDatabaseConnection === null) {
            static::select($id);
        }
    }
50115
public function loadConfig(array $config)
    {
        $this->devServerEnabled = $config['dev_server_enable'];
        $this->devServerHost = $config['dev_server_host'];
        $this->devServerPort = $config['dev_server_port'];
    }
712152
public void load(String config)
        throws IOException
    {
        _config=config;
        if(log.isDebugEnabled())log.debug("Load "+this+" from "+config);
        Properties properties = new Properties();
        Resource resource=Resource.newResource(config);
        properties.load(resource.getInputStream());

        Iterator iter = properties.entrySet().iterator();
        while(iter.hasNext())
        {
            Map.Entry entry = (Map.Entry)iter.next();

            String username=entry.getKey().toString().trim();
            String credentials=entry.getValue().toString().trim();
            String roles=null;
            int c=credentials.indexOf(',');
            if (c>0)
            {
                roles=credentials.substring(c+1).trim();
                credentials=credentials.substring(0,c).trim();
            }

            if (username!=null && username.length()>0 &&
                credentials!=null && credentials.length()>0)
            {
                put(username,credentials);
                if(roles!=null && roles.length()>0)
                {
                    StringTokenizer tok = new StringTokenizer(roles,", ");
                    while (tok.hasMoreTokens())
                        addUserToRole(username,tok.nextToken());
                }
            }
        }
    }
661739
public function setConfig($config = array()) 
    { 

    	if(is_array($config) ) {

    		if(!empty($config)) {
    			foreach($config as $key=>$value) {

    				$this->_config[$key] = $value;
    			}
    		}

     	} else {
    		
    		throw new Exception( "Invalid parameter");
    	}

    }