Doc #51732 [NEW]: Fileinfo __construct with explicit magic file
| From: | franssen dot roland at gmail dot com | Date: | Mon, 03 May 2010 19:51:45 +0000 |
| Subject: | Doc #51732 [NEW]: Fileinfo __construct with explicit magic file | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-4297@lists.php.net to get a copy of this message | ||
From:
Operating system: WINNT
PHP version: 5.3SVN-2010-05-03 (SVN)
Package: Filesystem function related
Bug Type: Documentation Problem
Bug description:Fileinfo __construct with explicit magic file
Description:
------------
Not sure i've filled in correct PHP version; it's 5.3.1 however (packaged
with xampplite 1.7.3).
Im trying to initialize a fileinfo (finfo) object with an explicit NULL
value as 2nd parameter assuming it can locate the magic file by default.
Which should be fine, corresponding the documentation;
"__construct ([ int $options = FILEINFO_NONE [, string $magic_file =
NULL ]] )"
@ http://php.net/manual/en/function.finfo-open.php
Test script:
---------------
<?php
$fileInfo = new finfo(FILEINFO_MIME, null);
var_dump($fileInfo);
$fileInfo = new finfo(FILEINFO_MIME);
var_dump($fileInfo);
?>
Expected result:
----------------
object(finfo)#2 (0) { }
object(finfo)#5 (0) { }
Actual result:
--------------
Warning: finfo::finfo(): Failed to load magic database at ''. in *** on
line ***
object(finfo)#2 (0) { }
object(finfo)#5 (0) { }
--
Edit bug report at http://bugs.php.net/bug.php?id=51732&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51732&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51732&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51732&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51732&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51732&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51732&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51732&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51732&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51732&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51732&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51732&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51732&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51732&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51732&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51732&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51732&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51732&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51732&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51732&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51732&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51732&r=mysqlcfg