Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dflydev/dflydev-canal
Analyze content to determine the appropriate Internet media type
https://github.com/dflydev/dflydev-canal
Last synced: about 2 months ago
JSON representation
Analyze content to determine the appropriate Internet media type
- Host: GitHub
- URL: https://github.com/dflydev/dflydev-canal
- Owner: dflydev
- License: mit
- Created: 2013-01-04T05:00:13.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2023-08-28T10:40:54.000Z (over 1 year ago)
- Last Synced: 2024-11-13T11:38:44.515Z (2 months ago)
- Language: PHP
- Size: 146 KB
- Stars: 34
- Watchers: 5
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-php-cn - Canal - 一个检查互联网媒体类型的库 (目录 / 文件 Files)
README
Canal
=====Content analysis for the purpose of determining [Internet media types][1].
Requirements
------------* PHP 5.3+
Installation
------------
Through [Composer][2] as [dflydev/canal][3].Usage
-----```php
detectFromFilename('/path/to/whatever.png');// See the media type as a string
print $internetMediaType->asString()."\n\n";// See the media type's type
print $internetMediaType->getType()."\n\n";// See the media type's subtype
print $internetMediaType->getSubtype()."\n\n";// image/png
//
// image
//
// png
```License
-------MIT, see LICENSE.
Not Invented Here
-----------------This work was heavily influenced by [Apache Tika][4] and [Ferret][5].
[1]: http://en.wikipedia.org/wiki/Internet_media_type
[2]: http://getcomposer.org
[3]: https://packagist.org/packages/dflydev/canal
[4]: http://tika.apache.org
[5]: https://github.com/versionable/Ferret