{@inheritdoc}

Sets the HMAC authentication plugin, sets the base_path to point to the
correct index.
15666
public static function factory($config = array())
    {
        // We just use this for validation. The configs are set in the parent's
        // factory methid.
        Collection::fromConfig($config, array(), array('index_id', 'derived_key'));
        $solr = parent::factory($config);

        // Get the configs relevant to Acquia Search.
        $indexId = $solr->getConfig('index_id');
        $derivedKey = $solr->getConfig('derived_key');

        // Set the base bath to point to the configured index.
        $solr->getConfig()->set('base_path', '/solr/' . $indexId);

        // Attach the Acquia Search HMAC Authentication plugin to the client.
        $signature = new Signature($derivedKey);
        $plugin = new AcquiaSearchAuthPlugin($indexId, $signature);
        $solr->addSubscriber($plugin);

        return $solr;
    }
38573
def set(ctx, key, value):
    
    if key == "default_account" and value[0] == "@":
        value = value[1:]
    ctx.blockchain.config[key] = value
662038
def set_base_path(self, value):
        
        if config.PATHS not in self.config.application:
            self.config.application[config.PATHS] = dict()

        if config.BASE not in self.config.application[config.PATHS]:
            self.config.application[config.PATHS][config.BASE] = value
1129025
function _setEngine()
    {
        $this->engine = null;

        $candidateEngines = array(
            $this->preferredEngine,
            CRYPT_ENGINE_OPENSSL,
            CRYPT_ENGINE_MCRYPT
        );
        foreach ($candidateEngines as $engine) {
            if ($this->isValidEngine($engine)) {
                $this->engine = $engine;
                break;
            }
        }
        if (!$this->engine) {
            $this->engine = CRYPT_ENGINE_INTERNAL;
        }

        if ($this->engine != CRYPT_ENGINE_MCRYPT && $this->enmcrypt) {
            // Closing the current mcrypt resource(s). _mcryptSetup() will, if needed,
            // (re)open them with the module named in $this->cipher_name_mcrypt
            @mcrypt_module_close($this->enmcrypt);
            @mcrypt_module_close($this->demcrypt);
            $this->enmcrypt = null;
            $this->demcrypt = null;

            if ($this->ecb) {
                @mcrypt_module_close($this->ecb);
                $this->ecb = null;
            }
        }

        $this->changed = true;
    }
753887
protected function setConnectionRoot()
	{
		$root = $this->getRoot();

		if (!$root) {
			return;
		}

		if (!$this->root = @\ssh2_sftp_realpath($this->sftp, $root)) {
			throw new \RuntimeException('Root is invalid or does not exist: ' . $root);
		}

		$this->root = $root . $this->separator;
	}
1307776
public function setSslCertificate($path, $password=false)
	{
		$this->options[CURLOPT_SSLCERT] = $path;

		if ($password) {
			$this->options[CURLOPT_SSLCERTPASSWD] = $password;
		}
	}
586921
function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '', $proxyauthtype = 'basic') {
		if ($proxyhost) {
			$this->proxy = array(
				'host' => $proxyhost,
				'port' => $proxyport,
				'username' => $proxyusername,
				'password' => $proxypassword,
				'authtype' => $proxyauthtype
			);
			if ($proxyusername != '' && $proxypassword != '' && $proxyauthtype = 'basic') {
				$this->setHeader('Proxy-Authorization', ' Basic '.base64_encode($proxyusername.':'.$proxypassword));
			}
		} else {
			$this->debug('remove proxy');
			$proxy = null;
			unsetHeader('Proxy-Authorization');
		}
	}
950691
private static function setClient()
    {
        if (self::$client === null) {
            self::$client = new Client([
                'base_uri'  => self::$environment,
                'timeout'   => self::TIMEOUT,
                'verify'    => self::VERIFY,
            ]);
        }
    }
630355
void setAttribute(CryptoPath cleartextPath, String attribute, Object value, LinkOption... options) throws IOException {
		readonlyFlag.assertWritable();
		fileAttributeByNameProvider.setAttribute(cleartextPath, attribute, value, options);
	}
910843
function setKey($key) {
		$this->cnxn->confirmTransaction('setKey');
		$currKey = $this->key;
		if (!is_null($currKey) && is_null($key)) {
			$this->cnxn->unregisterStructWithKey($this, $currKey);
		} else if (is_null($currKey) && !is_null($key)) {
			$this->cnxn->registerStructWithKey($this, $key);
		} else if ($currKey != $key) {
			$this->cnxn->unregisterStructWithKey($this, $currKey);
			$this->cnxn->registerStructWithKey($this, $key);
		}
		$this->key = $key;
	}
524014
private function configure()
    {
        $keyCert = SignatureUtils::generateKeyCert($this->settings);
        $dir = dirname($this->settings['sp_key_file']);
        if (!is_dir($dir)) {
            throw new \InvalidArgumentException('The directory you selected for sp_key_file does not exist. Please create ' . $dir);
        }
        $dir = dirname($this->settings['sp_cert_file']);
        if (!is_dir($dir)) {
            throw new \InvalidArgumentException('The directory you selected for sp_cert_file does not exist. Please create ' . $dir);
        }
        file_put_contents($this->settings['sp_key_file'], $keyCert['key']);
        file_put_contents($this->settings['sp_cert_file'], $keyCert['cert']);
    }
1295795
@SuppressWarnings({ "rawtypes", "unchecked" })
    public boolean setDocBase(String basePath)
    {
        proxyDirContext = null;
        if (basePath == null)
            return false;
        Hashtable env = new Hashtable();
                    
        File file = new File(basePath);
        if (!file.exists())
            return false;
        if (!file.isDirectory())
            return false;
      
        env.put(ProxyDirContext.CONTEXT, file.getPath());
        FileDirContext fileContext = new FileDirContext(env);
        fileContext.setDocBase(file.getPath());
        proxyDirContext = new ProxyDirContext(env, fileContext);
          /* Can't figure this one out
        InitialContext cx = null;
          try {
              cx.rebind(RESOURCES_JNDI_NAME, obj);
          } catch (NamingException e) {
              e.printStackTrace();
          }
          */
        // Load the proxy dir context.
        return true;
    }
771050
public function setBasePath($path) {
		$path = rtrim($path, '\/');
		
		if (preg_match('~^[a-z]+:~', $path)) {
			$this->basePath = $path;
			$this->isLocal  = false;
			return;
		}
		
		$this->basePath = realpath($path);
		$this->isLocal  = true;
		
		return $this;
	}
1317792
public function setAutoEtag()
    {
        $this->setEtag(base64_encode(hash_file('sha256', $this->file->getPathname(), true)));

        return $this;
    }
417619
protected function setUserContext()
    {
        $objectManager = Bootstrap::$staticObjectManager;
        $securityContext = $objectManager->get(SecurityContext::class);

        $userContext = [];

        if ($securityContext->isInitialized()) {
            $account = $securityContext->getAccount();
            if ($account !== null) {
                $userContext['username'] = $account->getAccountIdentifier();
            }
            $externalUserContextData = $this->userContextService->getUserContext($securityContext);
            if ($externalUserContextData !== []) {
                $userContext = array_merge($userContext, $externalUserContextData);
            }
        }

        if ($userContext !== []) {
            $this->client->user_context($userContext);
        }

        if ($this->release !== '') {
            $this->client->setRelease($this->release);
        }
    }
184465
public function set()
    {
        $args  = func_get_args();
        $count = func_num_args();

        if ( is_array($args[0]) )
        {
            foreach ($args[0] as $key => $value)
            {
                if ($key === 'path')
                {
                    $this->setPath($value);
                    continue;
                }

                if (property_exists($this, $key))
                {
                    $this->$key = $value;
                }
            }
        }
        elseif ($count === 2)
        {
            if ($args[0] === 'path')
            {
                $this->setPath($args[1]);
                return ;
            }

            if (property_exists($this, $args[0]))
            {
                $this[$args[0]] = $args[1];
            }
        }
    }
497206
protected function initBaseDir($basePath)
    {
        if ($basePath) {
            $this->setBaseDir($basePath);
        } elseif (defined('BASE_PATH')) {
            $this->setBaseDir(BASE_PATH);
        } else {
            throw new BadMethodCallException("No BASE_PATH defined");
        }
    }