Issue certificate using standalone webroot

@throws InvalidArgumentException
@param string $config Path to sami.php configuration to use
@return string
429418
public function certonly($email, $webroot, $domains)
    {

        $result = $this->command . ' certonly --webroot --debug --agree-tos';
        $result .= ' --email ' . $email;
        $result .= ' -w ' . $webroot;

        foreach ($domains as $domain) {
            $result .= ' -d ' . $domain;
        }

        return $result;
    }
71202
public static function get($config = array()) {
        $hash = md5(serialize($config));
        if (!isset(self::$_instances[$hash]))
            self::$_instances[$hash] = new static($config);
        return self::$_instances[$hash];
    }
262454
protected function validateConnectionConfig($connectionConfig)
    {
        if (!is_array($connectionConfig)) {
            throw new InvalidArgumentException($this->translate(
                'Db driver configuration should be an array or Traversable.'
            ));
        }

        if (!isset($connectionConfig['type'])) {
            throw new InvalidArgumentException($this->translate(
                'Cannot find connection type in configuration.'
            ));
        } else {
            if (!in_array($connectionConfig['type'], $this->supportedConnectionTypes)) {
                throw new InvalidArgumentException('Wrong connection type: ' . $connectionConfig['type']);
            }
        }

        if (isset($connectionConfig['options'])) {
            if (!(is_array($connectionConfig['options']))) {
                throw new InvalidArgumentException($this->translate(
                    'Db driver options should be an array or Traversable.'
                ));
            }
        }
    }
893505
protected function buildConnectionString(array $config): string
    {
        if (isset($config['connection_string'])) {
            return $config['connection_string'];
        }

        $result = 'mongodb://';

        // If username is present, append "<username>:<password>@"
        if (isset($config['username'])) {
            $result .= sprintf(
                '%s:%s@',
                $config['username'],
                $config['password'] ?? ''
            );
        }

        // Append "<hostname>/<database>"
        $result .= sprintf(
            '%s/%s',
            $this->buildHostname($config),
            $config['database'] ?? 'mongolid'
        );

        if (isset($config['cluster']['replica_set'])) {
            $result .= '?replicaSet='.$config['cluster']['replica_set'];
        }

        return $result;
    }
407082
protected function validateServerConfig($config)
    {
        if (!is_array($config)) {
            throw new InvalidArgumentException($this->translate(
                'Server configuration should be an array or Traversable.'
            ));
        }
        if (!isset($config['id']) || empty($config['id'])) {
            throw new InvalidArgumentException($this->translate(
                'Cannot find server id in configuration.'
            ));
        }
        if (!isset($config['connection']) || empty($config['connection'])) {
            throw new InvalidArgumentException($this->translate(
                'Cannot find connection type in configuration.'
            ));
        }
    }
330499
protected function getDSN(Array $config)
    {
        $dsn = "pgsql:host={$config['host']};dbname={$config['dbname']}";

        if (isset($config['port'])) {
            $dsn .= ";port={$config['port']}";
        }

        if (isset($config['sslmode'])) {
            $dsn .= ";sslmode={$config['sslmode']}";
        }

        return $dsn;
    }
222430
protected function getSqlSrvDsn(array $config)
    {
        $arguments = [
            'Server' => $this->buildHostString($config, ','),
        ];

        if (isset($config['database'])) {
            $arguments['Database'] = $config['database'];
        }

        if (isset($config['readonly'])) {
            $arguments['ApplicationIntent'] = 'ReadOnly';
        }

        if (isset($config['pooling']) && $config['pooling'] === false) {
            $arguments['ConnectionPooling'] = '0';
        }

        if (isset($config['appname'])) {
            $arguments['APP'] = $config['appname'];
        }

        if (isset($config['encrypt'])) {
            $arguments['Encrypt'] = $config['encrypt'];
        }

        if (isset($config['trust_server_certificate'])) {
            $arguments['TrustServerCertificate'] = $config['trust_server_certificate'];
        }

        if (isset($config['multiple_active_result_sets']) && $config['multiple_active_result_sets'] === false) {
            $arguments['MultipleActiveResultSets'] = 'false';
        }

        if (isset($config['transaction_isolation'])) {
            $arguments['TransactionIsolation'] = $config['transaction_isolation'];
        }

        if (isset($config['multi_subnet_failover'])) {
            $arguments['MultiSubnetFailover'] = $config['multi_subnet_failover'];
        }

        return $this->buildConnectString('sqlsrv', $arguments);
    }
1187737
public static function configure(ServicesConfig $config)
    {
        $config->validate();

        $gateway = null;
        if (isset($config->merchantId) && !empty($config->merchantId)) {
            $gateway = new RealexConnector();
            $gateway->merchantId = $config->merchantId;
            $gateway->sharedSecret = $config->sharedSecret;
            $gateway->accountId = $config->accountId;
            $gateway->channel = $config->channel;
            $gateway->rebatePassword = $config->rebatePassword;
            $gateway->refundPassword = $config->refundPassword;
            $gateway->timeout = $config->timeout;
            $gateway->serviceUrl = $config->serviceUrl;
            $gateway->hostedPaymentConfig = $config->hostedPaymentConfig;
            $gateway->curlOptions = $config->curlOptions;
            static::$instance = new static($gateway, $gateway);
        } else {
            $gateway = new PorticoConnector();
            $gateway->siteId = $config->siteId;
            $gateway->licenseId = $config->licenseId;
            $gateway->deviceId = $config->deviceId;
            $gateway->username = $config->username;
            $gateway->password = $config->password;
            $gateway->secretApiKey = $config->secretApiKey;
            $gateway->developerId = $config->developerId;
            $gateway->versionNumber = $config->versionNumber;
            $gateway->timeout = $config->timeout;
            $gateway->serviceUrl = $config->serviceUrl . '/Hps.Exchange.PosGateway/PosGatewayService.asmx';
            $gateway->curlOptions = $config->curlOptions;

            $payplanEndPoint = (strpos(strtolower($config->serviceUrl), 'cert.') > 0) ?
                                '/Portico.PayPlan.v2/':
                                '/PayPlan.v2/';
            
            $recurring = new PayPlanConnector();
            $recurring->siteId = $config->siteId;
            $recurring->licenseId = $config->licenseId;
            $recurring->deviceId = $config->deviceId;
            $recurring->username = $config->username;
            $recurring->password = $config->password;
            $recurring->secretApiKey = $config->secretApiKey;
            $recurring->developerId = $config->developerId;
            $recurring->versionNumber = $config->versionNumber;
            $recurring->timeout = $config->timeout;
            $recurring->serviceUrl = $config->serviceUrl . $payplanEndPoint;
            $recurring->curlOptions = $config->curlOptions;

            static::$instance = new static($gateway, $recurring);
        }
    }
485980
public static function get($config = null) {
		if (!isset($config['driver'])) {
			throw new ConnectionException("Unknown driver");
		}
		if (!isset($config['host']) || !isset($config['port'])) {
			throw new ConnectionException("Host and Port is required");
		}
		$type = $config['driver'];
		$hash = md5($type . ':' . $config['host'] . ':' . $config['port']);
		if (!isset(self::$created_driver[$hash])) {
			if (isset(self::$driver[$type])) {
				$className = self::$driver[$type];
			} else {
				$className = __NAMESPACE__ . '\\Driver\\' . ucfirst($type);
			}
			self::$created_driver[$hash] = new $className($config);
		}
		return self::$created_driver[$hash];
	}
988662
public function make(array $config)
    {
        $driver = $this->getDriver($config);

        // First we will check by the server driver type to see if an extension
        // has been registered specifically for that server.
        if (isset($this->serverExtensions[$driver])) {
            $server = call_user_func($this->serverExtensions[$driver], $config);
        }

        // Create a built-in server with given driver type.
        elseif (method_exists($this, $method = 'create'.Str::studly($driver).'Driver')) {
            $server = $this->$method($config);
        }

        // Otherwise, if the driver type does not support, an exception will be thrown.
        else {
            throw new InvalidArgumentException("Driver [{$driver}] is not supported.");
        }

        $this->configureServer($server, $config);

        return $server;
    }
657553
public function setConfig(array $config)
    {
        // Verify that method is provided
        if (!isset($config['method'])) {
            throw new InvalidAuthenticateMethod('Invalid authentification method, you must provide one');
        }

        // Verify that exists
        if (!in_array($config['method'], $this->methods)) {
            throw new UnknownAuthenticateMethod('Unknown authentification method');
        }

        // Create the url to request using base_url parameter
        if (!isset($config['base_url'][0])) {
            throw new \Exception('Error processing, invalid base url provided, it must be the first one parameter without index, at position [0]', 1);
        }

        $this->config = $config;

        return $this;
    }
259965
public function WebRoot($WebRoot = NULL) {
      $Path = (string)$this->_ParsedRequestElement('WebRoot', $WebRoot);
      $WebRootFromConfig = $this->_EnvironmentElement('ConfigWebRoot');

      $RemoveWebRootConfig = $this->_EnvironmentElement('ConfigStripUrls');
      if ($WebRootFromConfig && $RemoveWebRootConfig) {
         $Path = str_replace($WebRootFromConfig, '', $Path);
      }
      return $Path;
   }
220329
private function getRootFolderName(SiteConfig $siteConfig)
    {
        return ($this->owner->has_extension('RootFolder')) ? $this->owner->getRootFolderName() : $siteConfig->getRootFolderName();
    }
3643
public static function config($configName, $config = null)
    {
        $_this = Purifier::getInstance();

        if (empty($config)) {
            if (!isset($_this->_configs[$configName])) {
                throw new \InvalidArgumentException(sprintf('Purifier configuration `%s` does not exist!', $configName));
            }
            return $_this->_configs[$configName];
        }

        if (is_array($config)) {
            $purifierConfig = \HTMLPurifier_Config::createDefault();
            foreach ($config as $key => $value) {
                $purifierConfig->set($key, $value);
            }

            return $_this->_configs[$configName] = $purifierConfig;
        } elseif (is_object($config) && is_a($config, 'HTMLPurifier_Config')) {
            return $_this->_configs[$configName] = $config;
        } else {
            throw new \InvalidArgumentException('Invalid purifier config passed!');
        }
    }
562804
public function connect(array $config, string $name = 'main'): Connection
    {
        if (isset($this->connections[$name])) {
            throw new InvalidArgumentException("Connection [$name] is already configured.");
        }

        $this->connections[$name] = new Connection($config);

        return $this->connections[$name];
    }
1278608
private function requestCancel($config)
    {
        \PagSeguro\Configuration\Configure::setEnvironment(
            $this->_library->getEnvironment()
        );
        try {
            return \PagSeguro\Services\Transactions\Cancel::create(
                $this->_library->getPagSeguroCredentials(),
                $config->pagseguro_id
            );
        } catch (\Exception $exception) {
            throw $exception;
        }
    }
1275937
public function authenticate(array $config)
    {
        if (!$this->client) {
            throw new InvalidArgumentException('The client instance was not given to the token authenticator.');
        }

        if (!array_key_exists('token', $config)) {
            throw new InvalidArgumentException('The token authenticator requires a token.');
        }

        $this->client->authenticate($config['token'], Client::AUTH_HTTP_TOKEN);

        return $this->client;
    }