Req #80476 [Com]: Asking for new feature : SplFileInfo->getMIMEType()

From: Date: Thu, 03 Dec 2020 10:28:08 +0000
Subject: Req #80476 [Com]: Asking for new feature : SplFileInfo->getMIMEType()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230820@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80476&edit=1 ID: 80476 Comment by: rtrtrtrtrt at dfdfdfdf dot dfd Reported by: rdefaux at gmail dot com Summary: Asking for new feature : SplFileInfo->getMIMEType() Status: Open Type: Feature/Change Request Package: Filesystem function related PHP Version: 7.4.13 Block user comment: N Private report: N New Comment: not possible, that's the "fileinfo" extensions job and the large mimemagic database mustn't be mandatory for spl-functions https://www.php.net/manual/en/book.fileinfo.php https://www.php.net/manual/en/function.mime-content-type.php -rwxr-xr-x 1 root root 5,5M 2020-11-26 08:36 /usr/lib64/php/modules/fileinfo.so Previous Comments: ------------------------------------------------------------------------ [2020-12-03 07:02:02] rdefaux at gmail dot com Description: ------------ Hello, It would be nice if the class SplFileInfo had the method getMIMEType() : string|false This method would return a string representing the MIME type (same result as mime_content_type ( resource|string $filename ) function), or false if the file doesn't exists or is not a file (I mean is a dir, a symlink, etc...) Thanks Romaric PS : it is the first time I ask for a request, I hope I'm doing it in a proper way. And thanks a lot too to all the PHP team for its wonderful work ! :) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80476&edit=1

« previous php.bugs (#230820) next »