Doc #64793 [Asn->Csd]: finfo_open raises warning with env magic file

From: Date: Thu, 16 May 2013 19:29:05 +0000
Subject: Doc #64793 [Asn->Csd]: finfo_open raises warning with env magic file
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9833@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64793&edit=1 ID: 64793 Updated by: aharvey@php.net Reported by: weierophinney@php.net Summary: finfo_open raises warning with env magic file -Status: Assigned +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: Ubuntu 13.04 PHP Version: 5.4.14 Assigned To: aharvey Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Turns out this was just plain wrong all along. :) Previous Comments: ------------------------------------------------------------------------ [2013-05-16 19:28:45] aharvey@php.net Automatic comment from SVN on behalf of aharvey Revision: http://svn.php.net/viewvc/?view=revision&revision=330245 Log: Fix the description of finfo_open()'s behaviour when no magic file or MAGIC environment variable are provided. Additionally, improved the wording of the warning and added a note recommending the use of the bundled magic database, per Matthew's suggestion in the bug tracker. Fixes doc bug #64793 (finfo_open raises warning with env magic file). ------------------------------------------------------------------------ [2013-05-16 19:20:42] aharvey@php.net Related To: Bug #64799 ------------------------------------------------------------------------ [2013-05-16 19:10:43] aharvey@php.net Morphing into a doc bug. I think this one changed when we started bundling libmagic, as the relevant code appears to be commented out, but I'll check before fixing the manual. ------------------------------------------------------------------------ [2013-05-09 13:09:20] weierophinney@php.net After receiving the "answer" to this issue, I decided to run "unset MAGIC" in my shell, as the implication is that if you do this, PHP will use its own internal magic.mime database. This indeed works. Unfortunately, the documentation is completely wrong, which is why I never determined the correct course of action. It states: "Name of a magic database file, usually something like /path/to/magic.mime. If not specified, the MAGIC environment variable is used. If this variable is not set either, /usr/share/misc/magic is used by default. A .mime and/or .mgc suffix is added if needed. Passing NULL or an empty string will be equivalent to the default value." Clearly this is incorrect, as the default is actually to use the magic database PHP bundles. ------------------------------------------------------------------------ [2013-05-09 07:50:37] ab@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php It's expected that the magic file format change across the libmagic versions. This way you may experience some difference even within the same version, libmagic was upgraded for 5.4.1 and now again in 5.4.15. The recommended way is to use the compiled in magic, passing a magic file from outside you have to care about the version compatibility. The same were obviously the experience if you use the file commando with different magic file versions. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=64793 -- Edit this bug report at https://bugs.php.net/bug.php?id=64793&edit=1

« previous php.doc.bugs (#9833) next »