Returns protocol name

@return string
350576
public static function getProtocolName()
    {
        $matches = [];
        $protocolData = Miscellaneous::getSafelyGlobalVariable(INPUT_SERVER, 'SERVER_PROTOCOL'); // e.g. HTTP/1.1
        $matchCount = preg_match('|(.+)\/(.+)|', $protocolData, $matches);

        /*
         * $matches[1] - protocol name, e.g. HTTP
         * $matches[2] - protocol version, e.g. 1.1
         */

        // Oops, cannot match protocol
        if (0 === $matchCount) {
            return '';
        }

        return strtolower($matches[1]);
    }
1321164
public function getName(): string
    {
        if (!empty($this->name)) {
            return $this->name;
        }

        $name = ($this->isUnique() ? 'unique_' : 'index_') . join('_', $this->getColumns());

        return strlen($name) > 64 ? md5($name) : $name;
    }
96052
public static function getProtocol() {
    if(null === self::$protocol) {
      self::$protocol = @trim($_SERVER['SERVER_PROTOCOL']);
      if(!self::$protocol) {
        self::$protocol = 'HTTP/1.0';
      }
    }
    return self::$protocol;
  }
813323
public static function get_name() {
        // Override in subclass with real lang string.
        $parts = explode('\\', get_called_class());
        if (count($parts) !== 3) {
            return get_string('unknownevent', 'error');
        }
        return $parts[0].': '.str_replace('_', ' ', $parts[2]);
    }
750894
def get_protocol_name(self):
        """"""
        protocol_name = self.node_info.protocol
        if self.is_console:
            protocol_name += '_console'
        return protocol_name
1373380
public function getTableName()
    {
        if (!$this->through) {
            $parts = [
                TableNameResolver::getTableName($this->getTable()),
                TableNameResolver::getTableName($this->getRelatedTable()),
            ];
            sort($parts);

            return '{{%'.implode('_', $parts).'}}';
        }

        return call_user_func([$this->through, 'tableName']);
    }
686005
public function get_signature_base_string() {
        $parts = array(
            $this->get_normalized_http_method(),
            $this->get_normalized_http_url(),
            $this->get_signable_parameters()
        );

        $parts = OAuthUtil::urlencode_rfc3986($parts);

        return implode('&', $parts);

    }
1120862
public function getProtocolVersion()
    {
        if ($this->_protocolVersion === null) {
            $this->_protocolVersion = $this->defaultProtocolVersion();
        }
        return $this->_protocolVersion;
    }
571498
public static function protocolSchema()
    {
        $schema = '';
        if( preg_match( "#^([a-zA-Z]+)/.*$#", self::serverVariable( 'SERVER_PROTOCOL' ), $schemaMatches ) )
        {
            $schema = strtolower( $schemaMatches[1] ) . '://';
        }

        return $schema;
    }
31019
public function getHostName()
    {
        $remoteAddress = $this->server()->remoteAddress();

        $host = $this->server()->serverName();
        $fwdHost = $this->server()->get($this->getTrustedHeaders()['client_host']);
        if ($fwdHost && $fwdHost != '' && in_array($remoteAddress, $this->getTrustedProxies())) {
            $host = $fwdHost;
        }

        return strtolower($host);
    }
666066
protected function encodeName()
    {
        $name = $this->getProvider();

        if ($this->getVariant()) {
            $name .= '.' . $this->getVariant();

            return $name;
        }

        return $name;
    }
576697
protected function getName()
  {
    if($this->currObj instanceof Channel && $this->currObj->isSpacer())
    {
      return $this->currObj["channel_name"]->section("]", 1, 99)->toString();
    }
    elseif($this->currObj instanceof Client)
    {
      $before = array();
      $behind = array();

      foreach($this->currObj->memberOf() as $group)
      {
        if($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEFORE)
        {
          $before[] = "[" . $group["name"] . "]";
        }
        elseif($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEHIND)
        {
          $behind[] = "[" . $group["name"] . "]";
        }
      }

      return trim(implode("", $before) . " " . $this->currObj . " " . implode("", $behind));
    }

    return $this->currObj->toString();
  }
45681
public function getProtocolVersion()
    {
        if ($this->protocol === null) {
            if ($this->protocolProvider !== null) {
                $this->protocol = ($this->protocolProvider)();
            } else {
                $this->protocol = '1.1';
            }
        }
        return $this->protocol;
    }
598436
protected function getHostname()
    {
        $disabled = explode(',', ini_get('disable_functions'));

        if (function_exists('php_uname') && !in_array('php_uname', $disabled, true)) {
            return ['hostname' => php_uname('n')];
        }

        if (function_exists('gethostname') && !in_array('gethostname', $disabled, true)) {
            return ['hostname' => gethostname()];
        }

        return [];
    }
964773
public function getConnectionTableName()
    {
        $type_names = [$this->getSourceTypeName(), $this->getTargetTypeName()];
        sort($type_names);

        return implode('_', $type_names);
    }
406736
public function getHostname()
    {
        if (is_null($this->hostname)) {
            $this->hostname = gethostbyaddr($this->ip);
        }

        return $this->hostname;
    }
1319287
public function getProtocolVersion()
    {
        if ($this->protocol) {
            return $this->protocol;
        }

        // Lazily populate this data as it is generally not used.
        preg_match('/^HTTP\/([\d.]+)$/', $this->getEnv('SERVER_PROTOCOL'), $match);
        $protocol = '1.1';
        if (isset($match[1])) {
            $protocol = $match[1];
        }
        $this->protocol = $protocol;

        return $this->protocol;
    }