Re: cvs: php4 / NEWS /ext/standard dir.c

From: Date: Tue, 27 Jun 2000 19:02:09 +0000
Subject: Re: cvs: php4 / NEWS /ext/standard dir.c
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-22548@lists.php.net to get a copy of this message
Heads up to those of you who write resource-based modules; If your module follows the MySQL model, and allows omitting the resource handle which will make the various functions use the 'default' or 'active' resource, you must implement the code in the same way the MySQL module implements it in order for it to work properly. The rule is very simple - you should increase the reference count for the 'active' resource when it becomes the active resource (as it's pointed by another thing), and you should decrease the reference count when it becomes inactive (usually, either in shutdown or when it's replaced by a different active resource; As a matter of fact, the MySQL module seems to forget to release it on shutdown, which is no biggy, but I'll fix that for 4.0.2). If you don't follow that rule - the resource id you return from your function will be either immediately invalid, or may become invalid ahead of time. Zeev On Tue, 27 Jun 2000, Zeev Suraski wrote: > zeev Tue Jun 27 11:44:30 2000 EDT > > Modified files: > /php4 NEWS > /php4/ext/standard dir.c > Log: > Fixed a bug in opendir(), which prevented readdir() from working properly if > the $dir argument wasn't explicitly specified -- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.dev (#22548) next »