Re: Resources patch

From: Date: Fri, 20 Oct 2000 08:42:41 +0000
Subject: Re: Resources patch
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-35628@lists.php.net to get a copy of this message
Well, it's not a good idea to change the API of register_list_destructors(). That's why I introduced register_list_destructors_ex(). The advantages of this approach: 1. No downwards incompatibility. 2. The new destructor types are more extensible - they're sent a pointer to the rsrc_list_entry structure, instead of just the resource pointer. If we want to add more information to this entry in the future - we can do that without breaking the API. I never got around to actually changing register_list_destructors() calls to register_list_destructors_ex() calls, but it should work fine. Zeev At 05:57 20/10/2000, Andrei Zmievski wrote:
I've noticed that PHP has function get_resource_type() but it doesn't really do anything except return 'Unknown'. This was due to several reasons, main ones being that zend_rsrc_list_get_rsrc_type() was broken and that the modules did not really register their type names. This patch is supposed to fix this. I've also modified var_dump() to print resource type name. The consequence is that it is necessary to supply resource type name when calling register list destructors, and I've taken care of existing modules already. Example: <? $fp = fopen("foo", "r"); var_dump(get_resource_type($fp)); var_dump($fp); ?> string(4) "file" resource(1) of type (file) If no one objects, I'll commit it soon. -Andrei -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
-- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.dev (#35628) next »