Re: Adding new MIME types for the CLI web server
| From: | Andrea Faulds | Date: | Thu, 31 Oct 2013 21:37:49 +0000 |
| Subject: | Re: Adding new MIME types for the CLI web server | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69988@lists.php.net to get a copy of this message | ||
On 31/10/13 21:32, Derick Rethans wrote:
Isn't there a reason why you can't use the fileinfo extension/code for this instead? Hardcoding it seems rather strange?I looked at the manual and mime_content_type() is deprecated and tells me to use the Fileinfo PECL extension. From which I am led back to the parent section, which is for the built-in Fileinfo extension. Looks like the manual is out-of-date. Anyhow, looks like finfo_file() works as we'd want, though I feel uneasy about guessing filetypes this way. Perhaps we should have several explicitly specified ones (.txt as text/plain, .html as text/html, etc.), and guess the rest? Especially for ones which it would not correctly guess. Thanks. -- Andrea Faulds http://ajf.me/