格式化响应头信息

@param string $name 响应头部名字
@return string
516307
private function normalizeHeaderName($name)
    {
        $name = str_replace(array('-', '_'), ' ', (string) $name);
        $name = ucwords(strtolower($name));
        $name = str_replace(' ', '-', $name);
        return $name;
    }
1213539
public static function getFilename($name): string
    {
        $originalName = str_replace('\\', '/', $name);
        $pos = strrpos($originalName, '/');
        $originalName = false === $pos ? $originalName : substr($originalName, $pos + 1);

        return $originalName;
    }
108404
public function prefix($name)
    {
        if ($prefix = $this->config()->attribute['prefix']) {
            
            if (strpos($name, $prefix) !== 0) {
                return sprintf('%s%s', $prefix, $name);
            }
            
        }
        
        return $name;
    }
683167
protected static function getNameAndSkipFlag($name)
    {
        if ($name[0] == 'x') {
            return array(substr($name, 1), true);
        } else {
            return array(self::$method_map[$name], false);
        }
    }
111590
public function name($name = null)
    {
        if (func_num_args() === 0) {
            return $this->_name;
        }
        return $this->_name = (string) $name;
    }
1104908
public static function fqcn(string $name): string
    {
        $type = str_replace('[]', '', $name);

        if (class_exists($type) || interface_exists($type) && '\\' !== $type[0]) {
            return '\\' . $name;
        }

        return $name;
    }
346088
public function getHeader($name)
    {
        $internalName = strtolower($name);

        if (true === $this->hasHeader($internalName)) {
            $value = $this->headers[$internalName];

        } else {
            $value = null;
        }

        return $value;
    }
714027
public static function get($name)
    {
        if (isset($_REQUEST[$name])) {
            return $_REQUEST[$name];
        }

        if (isset($_GET[$name])) {
            return $_GET[$name];
        }

        return;
    }
295305
public function getHeader($name)
    {
        return isset($this->message['headers'][$name]) ? $this->message['headers'][$name] : null;
    }
600730
public function getRemoteInfo($name)
    {
        $info = [
            'host' => '',
            'vendor' => '',
            'repo' => '',
        ];

        $output = $this->getGitConfig('remote.'.$name.'.url');

        if (0 === stripos($output, 'http://') || 0 === stripos($output, 'https://')) {
            $url = parse_url($output);

            $info['host'] = $url['host'];
            $info['path'] = ltrim($url['path'], '/');
        } elseif (preg_match('%^(?:(?:git|ssh)://)?[^@]+@(?P<host>[^:]+):(?P<path>[^$]+)$%', $output, $match)) {
            $info['host'] = $match['host'];
            $info['path'] = $match['path'];
        } elseif (preg_match('%^(?:(?:git|ssh)://)?([^@]+@)?(?P<host>[^/]+)/(?P<path>[^$]+)$%', $output, $match)) {
            $info['host'] = $match['host'];
            $info['path'] = $match['path'];
        }

        if (isset($info['path'])) {
            $dirs = array_slice(explode('/', $info['path']), -2, 2);

            $info['vendor'] = $dirs[0];
            $info['repo'] = substr($dirs[1], -4, 4) === '.git' ? substr($dirs[1], 0, -4) : $dirs[1];

            unset($info['path']);
        }

        return $info;
    }
1275644
public static function getRegisteredName(string $name): string
    {
        $key = strtolower($name);

        return isset(self::$headers[$key]) ? self::$headers[$key]['name'] : $name;
    }
120631
public static function getDescriptionByName($name)
    {
        $key = strtoupper($name);
        if (isset(self::$availableNameList[$key])) {
            return self::$availableNameList[$key];
        } else {
            return false;
        }
    }
1326705
public function getParam ($name)
		{
			if (isset( $this->_params[ $name ] ))
				return $this->_params[ $name ];
			else
				return null;
		}
149213
public function p($name)
    {
        $msg = $this->raw($name);
        if (!$msg) {
            return '';
        }
        return sprintf($this->format, $msg);
    }
898133
public static function getIdentifier(string $name) : string
    {
        return str_replace(
            '.',
            '',
            uniqid(
                preg_match(static::VALID_IDENTIFIER_FORMAT, $name)
                ? $name
                : static::DEFAULT_IDENTIFIER,
                true
            )
        );
    }
726535
public function getHeader($name) {
		$varKey = 'HTTP_' . str_replace('-', '_', mb_strtoupper($name));
		if (isset($this->serverVars[$varKey])) {
			return $this->serverVars[$varKey];
		}
		
		if (function_exists('apache_request_headers')) {
			$requestHeaders = apache_request_headers();
			if (isset($requestHeaders[$name])) {
				return trim($requestHeaders[$name]);
			}
		}
		
		if (function_exists('getallheaders')) {
			$requestHeaders = getallheaders();
			if (isset($requestHeaders[$name])) {
				return trim($requestHeaders[$name]);
			}
		}
		
		return null;
	}
323753
public function param($name)
    {
        $params = $this->params();
        if (isset($params[$name])) {
            return $params[$name];
        } else {
            return null;
        }
    }