Bug #18031: PHP engine runs user-based read and disconnect functions when open return false

From: Date: Thu, 27 Jun 2002 23:51:51 +0000
Subject: Bug #18031: PHP engine runs user-based read and disconnect functions when open return false
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-12278@lists.php.net to get a copy of this message
From:             nbrandon@hotmail.com
Operating system: Win ME
PHP version:      4.1.2
PHP Bug Type:     Session related
Bug description:  PHP engine runs user-based read and disconnect functions when open return false

I have created my own session handler using both a function and class based
approach. On both occasions, when the "open" function returns a failure -
"return false;", PHP engine tries to run both the "read" and
"disconnect"
functions. This causes a fatal error as shown below.

Fatal error: Call to undefined function: query() in
f:\cvs_dev\Neutec\website\www.xxxxxxxx.co.uk\site\include\DBSession.class.inc
on line 139

Fatal error: Call to undefined function: disconnect() in
f:\cvs_dev\Neutec\website\www.xxxxxxxx.co.uk\site\include\DBSession.class.inc
on line 109

On both lines, PHP is trying to connect to the database using a database
handler variable, and since the variable has not been initialised (because
the "open" function failed), these fatal errors occur.

If the PHP engine could not "open" a session, then it should not try and
"read" or "disconnect" a session on exiting.

Full source code can be supplied on request.

Many Thanks
Nick



-- 
Edit bug report at http://bugs.php.net/?id=18031&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=18031&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=18031&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=18031&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=18031&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18031&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=18031&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=18031&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=18031&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=18031&r=globals



Thread (6 messages)

« previous php.bugs (#12278) next »