narrowspark/mimetypes 问题修复 & 功能扩展

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

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

narrowspark/mimetypes

最新稳定版本:1.6.0

Composer 安装命令:

composer require narrowspark/mimetypes

包简介

PHP MIME Types Guesser and extension mapping.

README 文档

README

PHP MIME Types Guesser and extension mapper.

68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6172726f77737061726b2f6d696d6574797065732e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545372e322e302d3838393242462e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f727573742d6c616e672f727573742f6d61737465722e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6e6172726f77737061726b2f6d696d6574797065732f6d61737465722e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265

built with jshttp/mime-db.

Mime types mapping, the right way.

This library uses jshttp/mime-db as its default mapping which aggregates data from multiple sources and creates a single db.json making it the most complete mapping.

Installation

composer require narrowspark/mimetypes

Use

This mime type guesser has support for all OS supported guesser.

<?php
    use Narrowspark\MimeType\MimeType;
    
    // You can register custom guessers by calling the register() method
    MimeType::register('CustomGuesser');

    return MimeType::guess('image.gif'); // returns image/gif

You looking for the full mime type array? Just use:

<?php
    use Narrowspark\MimeType\MimeTypesList;

    return MimeTypesList::MIMES; // returns array

If you like to use the build in php mime type guesser, just use:

<?php
    use Narrowspark\MimeType\MimeTypeFileInfoGuesser;
    use Narrowspark\MimeType\MimeTypeFileBinaryGuesser;
    use Narrowspark\MimeType\MimeTypeExtensionGuesser;
    use Narrowspark\MimeType\MimeTypeFileExtensionGuesser;

    
    // Inspecting the file using finfo and relies on magic db files.
    return MimeTypeFileInfoGuesser::guess('image.gif'); // returns image/gif
    // Inspecting the file using file -b --mime
    return MimeTypeFileBinaryGuesser::guess('image.gif'); // returns image/gif
    // Inspecting the extension using mime type list
    return MimeTypeExtensionGuesser::guess('gif'); // returns image/gif
    // Inspecting the file using mime type list
    return MimeTypeFileExtensionGuesser::guess('image.gif'); // returns image/gif

Contributing

If you would like to help take a look at the list of issues and check our Contributing guild.

Note: Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

The Narrowspark mimetypes is open-sourced software licensed under the MIT license

narrowspark/mimetypes 适用场景与选型建议

narrowspark/mimetypes 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 114.05k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2017 年 09 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「mimetype」 「mimetypes」 「narrowspark」 「guesser」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 narrowspark/mimetypes 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 narrowspark/mimetypes 我们能提供哪些服务?
定制开发 / 二次开发

基于 narrowspark/mimetypes 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-09-08