Retrieve server parameters.

Retrieves data related to the incoming request environment,
typically derived from PHP's $_SERVER superglobal. The data IS NOT
REQUIRED to originate from $_SERVER.

@return array
487739
function getServerParams()
    {
        if ($this->_server === null) {
            $params = PhpServer::_($this->httpMessage)->getServer();
            $this->_server = \Poirot\Std\cast($params)->toArray();
        }

        return $this->_server;
    }
1066497
public static function oauth_parameters() {
        // Find request headers
        $request_headers = OAuthUtil::get_headers();

        // Parse the query-string to find GET parameters
        if ( isset($_SERVER['QUERY_STRING']) ) {
            $parameters = OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']);
        } else {
            $parameters = array();
        }

        // Add POST Parameters if they exist
        $parameters = array_merge($parameters, $_POST);

        // We have a Authorization-header with OAuth data. Parse the header
        // and add those overriding any duplicates from GET or POST
        if (isset($request_headers['Authorization']) &&
            substr($request_headers['Authorization'], 0, 6) == "OAuth ") {
            $header_parameters = OAuthUtil::split_header(
                $request_headers['Authorization']
            );
            $parameters = array_merge($parameters, $header_parameters);
        }
        return $parameters;
    }
39188
public function getServerLocales() {
        if(!isset($this->serverLocales)) {
            $this->serverLocales = new LocaleCollection();
            foreach($this->supportedLocaleStrings as $server) {
                try {
                    $locale = new Locale($server);
                    $this->serverLocales->addLocale( $locale );
                } catch(\Exception $e) {
                    trigger_error($e->getMessage(), E_USER_NOTICE);
                }
            }
        }
        return $this->serverLocales->getLocales();
    }
254725
public function getServerNames() {
        $serverNames = array();
        foreach($this->servers as $login => $data) {
            $serverNames[$login] = $data['name'];
        }
        return $serverNames;
    }
1044846
public function getParameters()
    {
        $params = array();
        foreach ($this->parameters as $name => $param) {
            $params[$name] = htmlentities($param, ENT_QUOTES, 'UTF-8', false);
        }
        return $params;
    }
808706
public function getParams(): array
    {
        $params = array();
        $args = $this->args;

        $params['apikey'] = $this->apiKey;

        $methods = Client::getMethods();

        foreach ($methods[$this->method] as $key => $paramName) {
            if (isset($args[$key])) {
                $params[$paramName] = $args[$key];
            }
        }

        return $params;
    }
413086
protected function pullServer() {
		if (!is_array($this->serverVars)) {
			$this->serverVars = $this->request->getServerParams();
		}
		
		return $this->serverVars;
	}
1337738
protected function getEnvParameters() {
    $parameters = array();

    // add config dir as a parameter
    $parameters['kernel.config_dir'] = $this->configDir;

    // add server variables
    foreach ($_SERVER as $key => $value) {
      if (0 === strpos($key, 'DRUPAL__')) {
        $parameters[strtolower(str_replace('__', '.', substr($key, 8)))] = $value;
      }
    }

    // add constants
    $constants = get_defined_constants(true);
    foreach ($constants['user'] as $key => $value) {
      if (0 === strpos($key, strtoupper($this->name) . '_')) {
        $parameters[strtolower(str_replace('_', '.', $key))] = $value;
      }
    }

    return $parameters;
  }
460119
protected function _getParams()
    {
        $aResult = array();
        $aParams = (array)$this->_getContainer()->getConfig()->getRequestParameter('aParams');

        foreach ($aParams as $sKey => $sValue) {
            $aResult[html_entity_decode($sKey)] = html_entity_decode($sValue);
        }

        return $aResult;
    }
519687
public function getParamsAsCode(): array
    {
        $paramsAsCode = [];

        foreach ($this->getParamNames() as $paramName) {
            $paramsAsCode[$paramName] = RequestPropertyUtility::getStringValueAsCode($this->$paramName);
        }

        return $paramsAsCode;
    }
153394
public function getData(): array
    {
        return [
            $this->serverOriginScheme,
            $this->serverOriginHost,
            $this->serverOriginPort,
            $this->isPreFlightCanBeCached,
            $this->preFlightCacheMaxAge,
            $this->isForceAddMethods,
            $this->isForceAddHeaders,
            $this->isUseCredentials,
            $this->areAllOriginsAllowed,
            $this->allowedOrigins,
            $this->areAllMethodsAllowed,
            $this->allowedLcMethods,
            $this->allowedMethodsList,
            $this->areAllHeadersAllowed,
            $this->allowedLcHeaders,
            $this->allowedHeadersList,
            $this->exposedHeadersList,
            $this->isCheckHost,
        ];
    }
33882
public function getData()
    {
        $this->validate('currency', 'description', 'encryptionKey', 'returnUrl');

        // The test mode is included to determine the redirect URL.

        return [
            'VPSProtocol' => $this->VPSProtocol,
            'TxType' => $this->getTxType(),
            'Vendor' => $this->getVendor(),
            'Crypt' => $this->generateCrypt($this->getCryptData()),
            'TestMode' => $this->getTestMode(),
        ];
    }
30883
public function getParamsInfo(): array
    {
        $paramsInfo = [];

        foreach ($this->getParamNames() as $paramName) {
            $paramsInfo[$paramName] = $this->getParamInfo($paramName);
        }

        return $paramsInfo;
    }
1342992
public function getParams()
    {
        $params = [];
        foreach ($this as $key => $value) {
            $pname = (string) ltrim(strtolower(preg_replace('/[A-Z]/', '_$0', $key)), '_');
            $params[$pname] = $value;
        }
        return $params;
    }
108263
protected function getEnvParameters()
    {
        $parameters = array();
        foreach ($_SERVER as $key => $value) {
            if (0 === strpos($key, 'PPI__')) {
                $parameters[strtolower(str_replace('__', '.', substr($key, 5)))] = $value;
            }
        }

        return $parameters;
    }
567050
public function getServerInfos()
    {
        //====================================================================//
        // Init Result Array
        $response = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);

        //====================================================================//
        // Server Infos
        $response->ServerType = 'PHP';                              // INFO - Server Language Type
        $response->ServerVersion = PHP_VERSION;                     // INFO - Server Language Version
        $response->ProtocolVersion = SPL_PROTOCOL;                  // INFO - Server Protocal Version
        //====================================================================//
        // Server Infos
        $response->Self = Splash::input('PHP_SELF');                // INFO - Current Url
        $response->ServerAddress = Splash::input('SERVER_ADDR');    // INFO - Server IP Address
        // Read System Folder without symlinks
        $response->ServerRoot = realpath((string) Splash::input('DOCUMENT_ROOT'));
        $response->UserAgent = Splash::input('HTTP_USER_AGENT');    // INFO - Browser User Agent
        $response->WsMethod = Splash::configuration()->WsMethod;    // Current Splash WebService Component

        //====================================================================//
        // Server Urls
        //====================================================================//
        // CRITICAL - Server Host Name
        $response->ServerHost = $this->getServerName();

        //====================================================================//
        // Server IPv4 Address
        $response->ServerIP = Splash::input('SERVER_ADDR');

        //====================================================================//
        // Server WebService Path
        if (isset(Splash::configuration()->ServerPath)) {
            $response->ServerPath = Splash::configuration()->ServerPath;
        } else {
            $fullPath = dirname(__DIR__);
            $relPath = explode((string) $response->ServerRoot, $fullPath);
            if (is_array($relPath) && isset($relPath[1])) {
                $response->ServerPath = $relPath[1].'/soap.php';
            } else {
                $response->ServerPath = null;
            }
        }

        $response->setFlags(ArrayObject::STD_PROP_LIST);

        return $response;
    }
454616
public static function GetRequestParameterList () {
		if ($_SERVER['argc'] < 1) {
			return [];
		}
		$current_key = 0;
		$parameter_list = [];

		$args = array_slice($_SERVER['argv'], 1);
		$argc = count($args);

		for ($i = 0;$i < $argc;$i++) {
			$argv = $args[$i];
			if (substr($argv, 0, 1) === '-') {
				$current_key = substr($argv, 1);
				$parameter_list[$current_key] = '';
				if (isset($args[$i + 1]) && substr($args[$i + 1], 0, 1) !== '-') {
					$parameter_list[$current_key] = $args[$i + 1];
					$i++;
				}
				continue;
			}
			if (isset($parameter_list[$current_key])) {
				if (!is_array($parameter_list[$current_key])) {
					$parameter_list[$current_key] = (array) $parameter_list[$current_key];
				}
				$parameter_list[$current_key][] = $argv;
			} else {
				$parameter_list[$current_key] = $argv;
			}
		}

		return $parameter_list;
	}