vlw/mime-types 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vlw/mime-types

最新稳定版本:1.0.0

Composer 安装命令:

composer require vlw/mime-types

包简介

RFC 4288 parser, cacher, and abstraction library for PHP

README 文档

README

Resolve MIME-types from file extensions and vice versa by passing a URL to an RFC 4288-compatible source to this library.

use vlw\MimeTypes\MimeTypes;

$mime = new MimeTypes("https://raw.githubusercontent.com/apache/httpd/refs/heads/trunk/docs/conf/mime.types");

// From string
$mime->get_ext_from_type("image/webp"); // "webp"
$mime->get_type_from_ext("webp"); // "image/webp"

// From pathname
$mime->get_ext_from_file("path/to/file.webp"); // "webp"
$mime->get_type_from_file("path/to/file.webp"); // "image/webp"

Installation

composer require vlw/mime-types

Use

use vlw\MimeTypes\MimeTypes;

$mime = new MimeTypes(string $url);

Defaults to Apache's mime.types file from GitHub if no value is provided to $url

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2024-10-27