|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-11-18 13:16 UTC] arimbourg at ariworld dot eu
Description:
------------
PHP 5.3.3 with Suhosin-Patch (cli) (built: Nov 9 2010 14:49:46)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
Apache mpm prefork
Loaded modules :
core
prefork
http_core
mod_so mod_authn_file
mod_authn_anon
mod_authn_default
mod_authn_alias
mod_authz_host
mod_authz_groupfile
mod_authz_user
mod_authz_dbm
mod_authz_owner
mod_authz_default
mod_auth_basic
mod_auth_digest
mod_include
mod_filter
mod_substitute
mod_log_config
mod_env
mod_mime_magic
mod_expires
mod_headers
mod_usertrack
mod_unique_id
mod_setenvif
mod_version
mod_mime
mod_status
mod_autoindex
mod_info
mod_cgi
mod_vhost_alias
mod_negotiation
mod_dir
mod_imagemap
mod_actions
mod_alias
mod_rewrite
mod_ssl
mod_userdir
mod_php5
Is it really a destructor for PECL Object Oriented usage?
Currently, I can only unset the variable that contain the resource.
Calling __destruct method give a fatal error.
Reproduce code:
---------------
<?php
putenv ('MAGIC=/usr/share/misc/magic.mgc'); //Magic didn't work... other bug...
ini_set ('display_errors', 1);
$finfo = new finfo ();
echo ($finfo->file ('index.php', FILEINFO_MIME) . "\n");
print_r (get_class_methods ('finfo')); // no __destruct method
$finfo->__destruct (); // Error !!
// finfo::__destruct () : Error too... as expected
?>
Expected result:
----------------
text/x-php; charset=utf-8
Array (
[0] => finfo
[1] => set_flags
[2] => file
[3] => buffer
[4] => __destruct
)
Actual result:
--------------
text/x-php; charset=utf-8
Array (
[0] => finfo
[1] => set_flags
[2] => file
[3] => buffer
)
Fatal error: Call to undefined method finfo::__destruct() in /path/to/file.php on line 12
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Feb 14 08:00:01 2026 UTC |
fileinfo functions are back. Mandriva stores now that extension in a separate package (php-fileinfo-5.3.3-0.4mdv2010.1)... I didn't noticed it... sorry. Now the package is installed and all is well again. One problem is remaining : no finfo::__destruct method. We can't free the resource when using object style fileinfo. I implemented a class acting like finfo (should). It's storing the resource and flags in private static variables and using the finfo function in the methods : __CLASS__::__construct => finfo_open __CLASS__::buffer => finfo_buffer __CLASS__::file => finfo_file __CLASS__::set_flags => finfo_set_flags __CLASS__::__destruct => finfo_close It's working well but I hope I'll be able to use the "native" finfo Class in the future... I notice one more problem : all the FILEINFO constants aren't defined : PHP Notice: Use of undefined constant FILEINFO_COMPRESS - assumed 'FILEINFO_COMPRESS' in /path/to/file.php on line 57