Automates the server-side component of the provider-specific domain
verification mechanism.

@param array $params
350750
public function verifyDomain(array $params)
	{
		if (!isset($params['provider'])) {
			throw new MissingArgumentException('provider');
		}

		if (!isset($params['code'])) {
			throw new MissingArgumentException('code');
		}

		if (!isset($params['filename'])) {
			throw new MissingArgumentException('filename');
		}

		return $this->post('app/verify_domain', $params);
	}
163611
protected function prepareParams($params)
    {
        if (isset($params['dsn'])) {
            $params['dsn'] = str_replace('oracle:', 'oci:', $params['dsn']);
        }

        return parent::prepareParams($params);
    }
617352
public function setUp(array $params)
    {
        if (empty($params['endpoint'])) {
            throw new \RuntimeException('Parameter "endpoint" cannot be empty.');
        }

        if (empty($params['ssl_pem_path'])) {
            throw new \RuntimeException('Parameter "ssl_pem_path" cannot be empty.');
        }

        if (!is_readable($params['ssl_pem_path'])) {
            throw new \RuntimeException('"ssl_pem_path" file does not exist or is not readable.');
        }

        $this->params = $params;
    }
354278
protected function configure(array $params)
    {
        $required = array('hostname', 'base_dn');
        $missing = array();
        foreach ($required as $key) {
            if (! array_key_exists($key, $params)) {
                $missing[] = $key;
            }
        }
        if (count($missing) > 0) {
            throw new \InvalidArgumentException(
                'Required parameters missing: ' . implode(', ', $missing)
            );
        }

        $idx = strpos($params['hostname'], '://');
        $enforceSSL = false;
        if (false !== $idx) {
            $prefix = strtolower(substr($params['hostname'], 0, $idx));
            if ($prefix === 'ldaps') {
                $enforceSSL = true;
            }
            $params['hostname'] = substr($params['hostname'], $idx+3);
        }

        $params['withSSL'] = false;
        $params['withTLS'] = false;
        if (array_key_exists('security', $params)) {
            switch($params['security']) {
            case 'SSL':
                $params['withSSL'] = true;
                break;
            case 'TLS':
                $params['withTLS'] = true;
                break;
            default:
                throw new \InvalidArgumentException(
                    sprintf(
                        'Security mode %s not supported - only SSL or TLS are supported',
                        $params['security']
                    )
                );
            }
        } elseif ($enforceSSL) {
            $params['withSSL'] = true;
        }

        if (! array_key_exists('port', $params)) {
            if ($params['withSSL']) {
                $params['port'] = 636;
            } else {
                $params['port'] = 389;
            }
        }

        if (! array_key_exists('options', $params)) {
            $params['options'] = array();
        }

        $params['bind_anonymous'] = false;
        if ((! array_key_exists('bind_dn', $params)) || (strlen(trim($params['bind_dn'])) == 0)) {
            $params['bind_anonymous'] = true;
            $params['bind_dn']        = '';
            $params['bind_password']  = '';
        }
        if (! array_key_exists('bind_password', $params)) {
            $params['bind_password']  = '';
        }

        $this->configuration = $params;
    }
765509
public function execute($params)
    {
        $this->params = $params;
        $this->validate(new \Ebanx\Command\Validator($this->params));

        // Get the HTTP client from the registry
        $httpClient = \Ebanx\Config::getHttpClient();
        $client = new $httpClient();
        $client->setRequestParams($this->params)
               ->setMethod($this->method)
               ->setAction($this->action)
               ->setIgnoredStatusCodes($this->ignoredStatusCodes)
               ->setResponseType($this->_responseType);

        try {
            $source = \Ebanx\Config::getSourceData();
        } catch (\InvalidArgumentException $e) {
            $source = null;
        }

        if (!is_null($source)) {
            $client->setSource($source);
        }

        return $client->send();
    }
955725
public function setParams(array $params = null)
    {
        $this->params = $params;
        if (null !== $params && empty($params)) {
            $this->params = null;
        }
    }
1339260
public function validate(...$params)
    {
        /**
         * @var Request $request
         * @var array   $matches
         */
        list($validators, $request, $matches) = $params;

        if (! \is_array($validators)) {
            return $request;
        }

        foreach ($validators as $type => $validatorAry) {
            $request = $this->validateField($request, $matches, $type, $validatorAry);
        }

        return $request;
    }
10507
protected function _setInputParams(array &$params) {
        foreach ($params as $paramKey => $paramValue) {
            if (in_array($paramKey, $this->args, true)
                && !is_null($paramValue)
            ) {
                $this->_inputParams[$paramKey] = $paramValue;
            }
        }

        $this->_params = array_merge($this->_params, $this->_inputParams);
    }
762752
private function _constructPdoDsn(array $params)
    {
        $dsn = 'pgsql:';

        if (isset($params['host']) && $params['host'] !== '') {
            $dsn .= 'host=' . $params['host'] . ';';
        }

        if (isset($params['port']) && $params['port'] !== '') {
            $dsn .= 'port=' . $params['port'] . ';';
        }

        if (isset($params['dbname'])) {
            $dsn .= 'dbname=' . $params['dbname'] . ';';
        } elseif (isset($params['default_dbname'])) {
            $dsn .= 'dbname=' . $params['default_dbname'] . ';';
        } else {
            // Used for temporary connections to allow operations like dropping the database currently connected to.
            // Connecting without an explicit database does not work, therefore "postgres" database is used
            // as it is mostly present in every server setup.
            $dsn .= 'dbname=postgres;';
        }

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

        if (isset($params['sslrootcert'])) {
            $dsn .= 'sslrootcert=' . $params['sslrootcert'] . ';';
        }

        if (isset($params['sslcert'])) {
            $dsn .= 'sslcert=' . $params['sslcert'] . ';';
        }

        if (isset($params['sslkey'])) {
            $dsn .= 'sslkey=' . $params['sslkey'] . ';';
        }

        if (isset($params['sslcrl'])) {
            $dsn .= 'sslcrl=' . $params['sslcrl'] . ';';
        }

        if (isset($params['application_name'])) {
            $dsn .= 'application_name=' . $params['application_name'] . ';';
        }

        return $dsn;
    }
1073256
protected function extractCustomParams(array $params = array())
    {
        foreach ($params as $name => $values) {
            foreach ($this->services as $host => $service) {
                if (preg_match('~' . preg_quote($name, '~') . '~i', $service)) {
                    $this->customParams[$host] = (array) $values;
                }
            }
        }
    }
315986
public function setParams($params = null)
    {
        if (isset($params)) {
            $this->params = (array) $params;
        } else {
            $this->params = $this->cli->parseParams($this->server->cliArgs());
        }

        return $this;
    }
665364
public function setUrlParams(array $params) {
		foreach ($params as $param => $value) {
			$this->setUrlParam($param, $value);
		}
		
		return $this;
	}
1315639
private function validateAndSetBotParamsExtra(array $params)
    {
        foreach (self::$valid_extra_bot_params as $extra_key) {
            if (!array_key_exists($extra_key, $params)) {
                continue;
            }

            $this->bot_params[$extra_key] = $params[$extra_key];
        }
    }
888304
protected function set_params( $params ) {
		$this->requirements_details_url = ! empty( $params['requirements_details_url'] ) ? esc_url( trim( (string) $params['requirements_details_url'] ) ) : $this->requirements_details_url;
		$this->version_compare_operator = ! empty( $params['version_compare_operator'] ) ? (string) $params['version_compare_operator'] : $this->version_compare_operator;
		$this->not_valid_actions        = ! empty( $params['not_valid_actions'] ) ? (array) $params['not_valid_actions'] : $this->not_valid_actions;
		$this->show_valid_results       = isset( $params['show_valid_results'] ) ? (bool) $params['show_valid_results'] : $this->show_valid_results;
	}
403818
public function execute($params)
    {
        $this->method = array_shift($params);
        $this->prepare($params);

        return $this->httpClient
            ->setMethod('post')
            ->setEndPoint(static::ENDPOINT.$this->method.'/')
            ->authHeaders()
            ->addHeader([ 'Content-Type' => 'application/json' ])
            ->setParams($this->params)
            ->send();
    }
431018
private function checkDomain(Request $request, $domain, &$params)
    {
        $params = [];
        if(Text::isEmpty($domain))
        {
            return true;
        }
        if(!is_array($domain))
        {
            $domain = [$domain];
        }
        foreach($domain as $rule)
        {
            $rule = $this->parseRule($rule, $fields);
            if(preg_match_all($rule, $request->getUri()->getDomain(), $matches) > 0)
            {
                $params = [];
                foreach($fields as $i => $fieldName)
                {
                    $params[$fieldName] = $matches[$i + 1][0];
                }
                return true;
            }
        }
        return false;
    }
1337221
public function loadFromArray($params)
    {
        if (!isset($params['requestTimestamp']) || !is_int($params['requestTimestamp'])) {
            throw new ValidationException('The "requestTimestamp" value is missing or invalid.');
        }

        if (!isset($params['signature']) || !is_string($params['signature'])) {
            throw new ValidationException('The "signature" parameter is missing.');
        }

        if (!isset($params['queryParameters']) || !is_array($params['queryParameters'])) {
            throw new ValidationException('The "queryParameters" parameter is missing or invalid.');
        }

        if (!isset($params['body']) || !is_string($params['body'])) {
            throw new ValidationException('The "body" parameter is missing.');
        }

        return parent::loadFromArray($params);
    }