Processes the server variables

@param array $server The server variables
970773
private function processServerVariables(array $server)
    {
        foreach ($server as $key => $value) {
            $this->server[$key] = $value;

            if (strpos($key, 'HTTP_') === 0) {
                $key = str_replace('_', '-', substr($key, 5));

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

        $uri     = $server['REQUEST_URI'];
        $uriPath = parse_url($uri, PHP_URL_PATH);

        $this->server['REQUEST_URI']      = $uri;
        $this->server['REQUEST_URI_PATH'] = $uriPath;

        $this->isEncrypted = !(empty($server['HTTPS']) || strcasecmp($server['HTTPS'], 'off') === 0);

        $this->server['SERVER_PROTOCOL'] = substr($server['SERVER_PROTOCOL'], -3);

        if (isset($server['CONTENT_LENGTH'])) {
            $this->headers['CONTENT-LENGTH'] = $server['CONTENT_LENGTH'];
        }

        if (isset($server['CONTENT_TYPE'])) {
            $this->headers['CONTENT-TYPE'] = $server['CONTENT_TYPE'];
        }
    }
1066021
protected function processVars(string &$content): void
    {
        $pattern = $this->getTagPattern('(\$.+?)');
        $content = preg_replace_callback($pattern, function ($match) {
            return '<?php echo ' . $match[1] . '; ?>';
        }, $content);
    }
1242440
public function process(ArrayAccess $data) {
		foreach ($this->_config['fields'] as $field) {
			if (!empty($data[$field])) {
				$data[$field] = $this->_prepareInput($data[$field]);
			}
		}
	}
894196
public function setCasServer($server)
    {
        $this->casServer = $server;
        $this->guzzleClient = new Client(['base_uri' => $server, 'cookies' => true]);
    }
594990
protected function processRequest(array $request)
    {
        try {
            $response = $this->_request(
                [
                    'uri' => $request['uri'],
                    'type' => $request['type'],
                    'data' => $request['data']
                ]
            );
        } catch ( \Exception $e ) {
            echo json_encode(array(
                'error' => array(
                    'msg' => $e->getMessage(),
                    'code' => $e->getCode(),
                ),
            ));

            exit();
        }

        return $response->getBody()->getContents();
    }
515761
public static function createFromServer(array $server)
    {
        $scheme = self::fetchServerScheme($server);
        $host = self::fetchServerHost($server);
        $port = self::fetchServerPort($server);
        $request = self::fetchServerRequestUri($server);

        return self::createFromUrl($scheme.$host.$port.$request);
    }
16928
public function loadDataFromRequest(array $request)
    {
        foreach ($request as $key => $value) {
            if (in_array($key, $this->requestVariables)) {
                $this->data[$key] = $value;
            }
        }
    }
1156570
private function _processVariable($text) {
		// Check the variable naming convention
		if (!in_array($text, $this->_systemVariables)) {
			$this->_checkVariableNaming($text);
		}

		// Check the variable name's length
		$this->_checkVariableNameLength($text);

		// Check if the variable is not a deprecated system variable
		$this->_checkDeprecation($text);

		// Check if the variable is not replaced
		$this->_checkReplacements($text);

		// Check if the variable is a function parameter
		if (!empty($this->_functionParameters[$text]) && $this->_inFunction) {

			$this->_functionParameters[$text] = "used";
		} else if (!$this->_inFunctionStatement) {

			// Global variable
			$pos = $this->tokenizer->getCurrentPosition();
			$nextTokenInfo = $this->tokenizer->peekNextValidToken($pos + 1);

			// if the next token is an equal, we suppose that this is an affectation
			$nextTokenText = $nextTokenInfo->text;
			$affectionTokens = array(
				'=',
				'+=',
				'*=',
				'/=',
				'-=',
				'%=',
				'&=',
				'|=',
				'^=',
				'<<=',
				'>>=',
				'.='
			);
			$isAffectation = in_array($nextTokenText, $affectionTokens);

			// Check if the variable has already been met
			if (empty($this->_variables[$text]) && !in_array($text, $this->_systemVariables)) {
				// The variable is met for the first time
				$variable = new VariableInfo();
				$variable->name = $text;
				$variable->line = $this->lineNumber; // We store the first declaration of the variable
				$this->_variables[$text] = $variable;
			} else if ($isAffectation) {
				// The variable is reaffected another value, this doesn't count as a valid use.
			} else {

				// Manage the case of $this->attribute
				if ($text === '$this') {

					$nextTokenInfo2 = $this->tokenizer->peekNextValidToken($nextTokenInfo->position);

					if ($this->tokenizer->checkToken($nextTokenInfo2, T_OBJECT_OPERATOR)) {

						// Detect $this inside a static function.
						if ($this->_functionStatic) {
							if ($this->_isActive('thisInStatic')) {
								$this->_writeError('thisInStatic', $this->_getMessage('THIS_IN_STATIC_FUNCTION'));
							}
						}

						$nextTokenInfo3 = $this->tokenizer->peekNextValidToken($nextTokenInfo2->position + 1);

						// This does not look like a function call, it should be a class attribute.
						// We eliminate the $this-> part
						$text = '$' . $nextTokenInfo3->text;
					}
				}

				// The variable is met again, we suppose we have used it for something
				if (!empty($this->_variables[$text])) {
					$variable = $this->_variables[$text];
					$variable->isUsed = true;
					$this->_variables[$text] = $variable;
				}
			}
		}
	}
1344652
function setServers(array $servers)
    {
        foreach($servers as &$svr)
        {
            self::formatServerConfig($svr);
        }
        $this->servers = $servers;
    }
496334
protected function handleVariable(array $token)
    {

        $node = $this->createNode('variable');
        $node->name = $token['name'];
        $node->attributes = [];
        $this->current = $node;
    }
806348
public static function make(array $server = null)
    {
        if (empty($server)) {
            $server = $_SERVER;
        }

        if (isset($server['SERVER_PROTOCOL'])) {
            return $server['SERVER_PROTOCOL'];
        }

        return 'HTTP/1.1';
    }
1264507
public function process()
    {
        // try to read input
        try {
            $json = file_get_contents($this->input);
        } catch (\Exception $e) {
            $message = "Server unable to read request body.";
            $message .= PHP_EOL . $e->getMessage();
            throw new Serverside\Exception($message);
        }

        // handle communication errors
        if ($json === false) {
            throw new Serverside\Exception("Server unable to read request body.");
        }

        // create request object
        $request = $this->makeRequest($json);

        // set content type to json if not testing
        if (!(defined('ENV') && ENV == 'TEST')) {
            header('Content-type: application/json');
        }

        // handle json parse error and empty batch
        if ($request->error_code && $request->error_message) {
            echo $request->toResponseJSON();
            return;
        }

        // respond with json
        echo $this->handleRequest($request);
    }
389018
public function initialize(Server $server)
    {
        $this->server = $server;
        $server->on('method:GET', [$this, 'httpGet'], 90);
        $server->on('propFind', [$this, 'propFind']);

        $server->xml->namespaceMap[self::NS_CALENDARSERVER] = 'cs';
        $server->resourceTypeMapping['\\Sabre\\CalDAV\\Notifications\\ICollection'] = '{'.self::NS_CALENDARSERVER.'}notification';

        array_push($server->protectedProperties,
            '{'.self::NS_CALENDARSERVER.'}notification-URL',
            '{'.self::NS_CALENDARSERVER.'}notificationtype'
        );
    }
691775
public function onStart(Server $server): void
    {
        $this->fire(ServerEvent::STARTED, $server);

        $this->masterPid = $masterPid = $server->master_pid;
        $rootPath        = $this->config('rootPath');
        $rootPath        = $rootPath ? " (at $rootPath)" : '';

        // save master process id to file.
        ProcessUtil::setTitle(sprintf('%s: master%s', $this->name, $rootPath));

        $this->log("The <comment>master</comment> process success started. (PID:<info>{$masterPid}</info>, pidFile: $this->pidFile)");
    }
1133202
public function processServerRequest($serverRequest)
    {
        $response = $this->processor()->process($serverRequest);

        return $response->asResponseMessage(
            $this->builder->context()->httpContext()
        );
    }
603907
protected function setSettings(array $settings): void
    {
        $this->server->set(array_merge($this->defaultSettings, $this->settings, $settings));
    }
552778
public function initialize(DAV\Server $server)
    {
        $this->server = $server;

        $this->server->xml->elementMap['{DAV:}lockinfo'] = 'Sabre\\DAV\\Xml\\Request\\Lock';

        $server->on('method:LOCK', [$this, 'httpLock']);
        $server->on('method:UNLOCK', [$this, 'httpUnlock']);
        $server->on('validateTokens', [$this, 'validateTokens']);
        $server->on('propFind', [$this, 'propFind']);
        $server->on('afterUnbind', [$this, 'afterUnbind']);
    }