[PHP-DEV] Re: [PHP-CVS] cvs: php4 / NEWS /ext/standard dir.c From: Zeev Suraski (zeev <email protected>)
Date: 06/27/00

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 <email protected>>
http://www.zend.com/

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>