Get the content-type value of http header from the file's extension name.

@param string $name Default file extension name.
@return string content-type
1128
public static function getMimetype($name)
    {
        $parts = explode('.', $name);
        if (count($parts) > 1) {
            $ext = strtolower(end($parts));
            if (isset(self::$mime_types[$ext])) {
                return self::$mime_types[$ext];
            }
        }

        return null;
    }
441167
public function parseType($name)
    {
        //if the name is prefixed with the settings prefix
        if (strpos($name, $this->settingsPrefix) === 0) {
            return $this->type = 'settings';
        }
        //otherwise if the name is prefixed with the page prefix
        elseif (strpos($name, $this->pagePrefix) === 0) {
            return $this->type = 'page';
        }
        //otherwise it's a model
        else {
            return $this->type = 'model';
        }
    }
503435
public function findByName(string $name)
    {
        return $this->first(function(ExtensionContract $extension) use($name) {
            return $extension->getPackage()->getName() === $name;
        });
    }
107318
public function getHeader(string $name)
    {
        $name = strtolower($name);
        foreach ($this->headers as $current => $value) {
            if (strtolower($current) == $name) {
                return $value;
            }
        }

        return null;
    }
870426
public function getHeader(string $name, string $default = ''): string
    {
        switch ($this->type) {
            // Check the request is PSR-7 http message.
            case 'psr-7':
                return $this->request->getHeaderLine($name) ?: $default;

            // Check the is Laravel or Symfony.
            case 'laravel':
            case 'symfony':
                return $this->request->headers->get($name, $default);

            case 'thinkphp':
                return $this->request->header($name, $default);
        }

        // Not using framewoerk ?
        // Read global variable $_REQUEST.
        foreach ($this->request as $key => $value) {
            if (strtolower($key) === strtolower($name)) {
                return (string) $value;
            }
        }

        // return default line string.
        return $default;
    }
203053
public function header($name = null, $default = null) {
        if (null === $name) {
            return $this->getHeader();
        }
        $key = 'HTTP_' . str_replace('-', '_', strtoupper($name));
        return $_SERVER[$key] ?? $default;
    }
295305
public function getHeader($name)
    {
        return isset($this->message['headers'][$name]) ? $this->message['headers'][$name] : null;
    }
1221855
private static function lookupContentType($filename) {
    foreach ($_FILES as $file) {
      if ($file['tmp_name'] == $filename) {
        return $file['type'] ?: static::DEFAULT_CONTENT_TYPE;
      }
    }
    return static::DEFAULT_CONTENT_TYPE;
  }
222637
public final function getHeaderLine($name): string
   {
       $key = $this->parseHeaderName($name);
       return array_key_exists($key, $this->header)
            ? implode(",", $this->header[$key])
            : "";
   }
1257402
private function getHeaderValue($name)
    {
        $header = $this->headers[$name];

        if ($header instanceof Claim) {
            return $header->getValue();
        }

        return $header;
    }
334593
public function getEncodedHeader(string $name): ?string
    {
        $offset = \strlen($name) + 2; // colon + space

        if (!isset($this->headers[$name])) {
            return null;
        }

        if (\is_array($this->headers[$name])) {
            $s = '';
            foreach ($this->headers[$name] as $email => $mailer) {
                if ($mailer != null) { // intentionally ==
                    $s .= self::encodeHeader($mailer, $offset, true);
                    $email = " <$email>";
                }
                $s .= self::append($email . ',', $offset);
            }

            return \ltrim(\substr($s, 0, -1)); // last comma
        }

        if (\preg_match('#^(\S+; (?:file)?name=)"(.*)"\z#', $this->headers[$name], $m)) { // Content-Disposition
            $offset += \strlen($m[1]);

            return $m[1] . '"' . self::encodeHeader($m[2], $offset) . '"';

        }

        return \ltrim(self::encodeHeader($this->headers[$name], $offset));
    }
394412
public function getUrlFromName($name)
    {
        $searchEngineNames = $this->getNames();
        if (isset($searchEngineNames[$name])) {
            $url = 'http://' . $searchEngineNames[$name];
        } else {
            $url = 'URL unknown!';
        }
        return $url;
    }
1304981
public function getHeader($name) {
        if (!is_string($name)) throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if (!strlen($name))    throw new InvalidArgumentException('Invalid argument $name: '.$name);

        $headers = $this->getHeaders($name);
        if ($headers)
            return join(', ', $headers);    // combine multiple headers of the same name according to RFC
        return null;
    }
1274902
public function getHeader($name)
    {
        if (!$this->hasHeader($name)) {
            throw new \InvalidArgumentException(sprintf('The request header "%s" does not exist.', $name));
        }

        return $this->headers[$name];
    }
172081
public function file(string $name): string {
        if (!isset($this->file[$name])) {
            return "";
        }
        return $this->file[$name];
    }
852500
public function getOriginalHeader($name)
    {
        return array_key_exists($name, $this->_request)? $this->_request[$name]: null;
    }
699626
public function getFromName($name)
    {
        if (false === $this->openned) {
            return false;
        }
        $name = preg_replace("/(?:\.|\/)*(.*)/", "\\1", $name);
        $extraction = $this->pclzip->extract(PCLZIP_OPT_BY_NAME, $name, PCLZIP_OPT_EXTRACT_AS_STRING);
        if (!empty($extraction)) {
            return $extraction[0]['content'];
        }
        return false;
    }