svn: /phpdoc/en/trunk/reference/fileinfo/functions/ finfo-open.xml
| From: | Adam Harvey | Date: | Thu, 16 May 2013 19:28:46 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/fileinfo/functions/ finfo-open.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-11269@lists.php.net to get a copy of this message | ||
aharvey Thu, 16 May 2013 19:28:46 +0000
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).
Bug: https://bugs.php.net/64793 (Assigned) finfo_open
raises warning with env magic file
Changed paths:
U phpdoc/en/trunk/reference/fileinfo/functions/finfo-open.xml
Modified: phpdoc/en/trunk/reference/fileinfo/functions/finfo-open.xml
===================================================================
--- phpdoc/en/trunk/reference/fileinfo/functions/finfo-open.xml 2013-05-16 18:52:32 UTC (rev 330244)
+++ phpdoc/en/trunk/reference/fileinfo/functions/finfo-open.xml 2013-05-16 19:28:46 UTC (rev 330245)
@@ -44,14 +44,14 @@
<listitem>
<para>
Name of a magic database file, usually something like
- <filename>/path/to/magic.mime</filename>. If not specified,
- the <literal>MAGIC</literal> environment variable is used. If this variable
- is not set either, <filename>/usr/share/misc/magic</filename> is used by
default.
- A <literal>.mime</literal> and/or <literal>.mgc</literal> suffix is
added if
- needed.
+ <filename>/path/to/magic.mime</filename>. If not specified, the
+ <literal>MAGIC</literal> environment variable is used. If the
+ environment variable isn't set, then PHP's bundled magic database will
+ be used.
</para>
<para>
- Passing NULL or an empty string will be equivalent to the default value.
+ Passing &null; or an empty string will be equivalent to the default
+ value.
</para>
</listitem>
</varlistentry>
@@ -67,15 +67,28 @@
</para>
</refsect1>
- <refsect1 role="notes">
+ <refsect1 role="notes">
&reftitle.notes;
<warning>
<para>
- As of PHP >= 5.3.11 and >= 5.4.1 the magic datababase format has changed. Due to this,
the internal mime database was upgraded. This affects especially the code where external magic is
read in. Reading in magic files of the older formats will not work.
+ The expected magic database format changed in PHP 5.3.11 and 5.4.1.
+ Due to this, the internal magic database was upgraded. This mostly effects
+ code where an external magic database is used: reading an older magic file
+ will now fail.
- Also, some textual representations of the mime types has changed, for instance for PHP would be
"PHP script, ASCII text" instead of "PHP script text" returned.
+ Also, some textual representations of the mime types has changed, for
+ instance for PHP would be "PHP script, ASCII text" instead of "PHP script
+ text" returned.
</para>
</warning>
+ <note>
+ <para>
+ Generally, using the bundled magic database (by leaving
+ <parameter>magic_file</parameter> and the <literal>MAGIC</literal>
+ environment variables unset) is the best course of action unless you
+ specifically need a custom magic database.
+ </para>
+ </note>
</refsect1>
<refsect1 role="examples">