Home | Docs | Forums | Lists | Bugs | Planet | Store | GMN | Get Gentoo!
Not eligible to see or edit group visibility for this bug.
View Bug Activity | Format For Printing | XML | Clone This Bug
Please, test and keyword dev-php{4,5}/pecl-fileinfo-1.0.3 stable; it's replacing buggy and deprecated built-in --with-mime-magic functions, that are no longer available in dev-lang/php ebuilds. Thanks.
sparc stable.
dev-php5/ stable dev-php4/ ~amd64
stable on ppc64
Stable on ppc
dev-php5/pecl-fileinfo is stable. dev-php4/pecl-fileinfo does not work. halcyon@x86-stable /home $ /usr/lib/php4/bin/php ~/fileinfo.php application/x-not-regular-file application/x-not-regular-file application/x-not-regular-file Fatal error: Cannot instantiate non-existent class: finfo in /home/halcyon/fileinfo.php on line 24 Expected: halcyon@x86-stable /home $ /usr/lib/php5/bin/php ~/fileinfo.php application/x-not-regular-file application/x-not-regular-file application/x-not-regular-file ASCII text, with no line terminators ASCII text, with no line terminators ASCII text, with no line terminators fileinfo.php can be found in the pecl-fileinfo tarball.
Well, as said on IRC - the distributed examples are often broken or compatible with a particular PHP version only. Working code: <?php $res = finfo_open(FILEINFO_MIME); /* return mime type ala mimetype extension */ $files = glob("*"); foreach ($files as $file) { echo finfo_file($res, $file) . "\n"; } finfo_close($res); ?> ---- # /usr/lib/php4/bin/php ~/fileinfo.php text/x-c; charset=us-ascii application/x-shellscript text/plain; charset=us-ascii application/x-bzip2 application/x-shellscript application/x-not-regular-file # /usr/lib/php5/bin/php ~/fileinfo.php text/x-c; charset=us-ascii application/x-shellscript text/plain; charset=us-ascii application/x-empty application/x-bzip2 application/x-shellscript application/x-not-regular-file
Actually, someone said they didn't know why the code wouldn't work since it wasn't PHP version dependent. Your testcase doesn't test the OO functionality at all. Looking at the code quickly, I found that the OO stuff is only generated for zend engine 2 (aka php-5 and higher). dev-php4/pecl-fileinfo is now stable, though that behaviour sucks.