Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.5.6

Bug #9396 Call to a member function on a non-object
Submitted: 2006-11-20 18:44 UTC
From: ryan dot hutchison at gymsolutions dot com Assigned: troehr
Status: Closed Package: HTTP_Session (version 0.5.4)
PHP Version: 5.2.0 RC4 OS: FreeBSD 6.1-STABLE
Roadmaps: (Not assigned)    
Subscription  


 [2006-11-20 18:44 UTC] ryan dot hutchison at gymsolutions dot com (Ryan Hutchison)
Description: ------------ Fatal error: Call to a member function write() on a non-object in /usr/local/share/pear/HTTP/Session/Container.php on line 240 Fatal error: Call to a member function close() on a non-object in /usr/local/share/pear/HTTP/Session/Container.php on line 236 Test script: --------------- <?php require_once 'HTTP/Session.php'; define('SQLDRIVER', 'mysqli'); define('SQLHOSTNAME', 'localhost'); define('SQLUSERNAME', '********'); define('SQLPASSWORD', '********'); define('SQLDATABASE', '********'); define('SQLDSN', sprintf("%s://%s:%s@%s/%s", SQLDRIVER, SQLUSERNAME, SQLPASSWORD, SQLHOSTNAME, SQLDATABASE)); HTTP_Session::setContainer('MDB2', SQLDSN); HTTP_Session::start(); ?> Expected result: ---------------- No fatal errors. Actual result: -------------- Fatal error: Call to a member function write() on a non-object in /usr/local/share/pear/HTTP/Session/Container.php on line 240 Fatal error: Call to a member function close() on a non-object in /usr/local/share/pear/HTTP/Session/Container.php on line 236

Comments

 [2006-11-20 21:34 UTC] ryan dot hutchison at gymsolutions dot com
/** * Destructor for compatibility with PHP >= 5.0.5 * * @access private * @return void */ function __destruct() { $GLOBALS['HTTP_Session_Container'] =& $this; session_write_close(); } } // Delegate function calls to the object's methods /** @ignore */ function HTTP_Session_Open($save_path, $session_name) { return (isset($GLOBALS['HTTP_Session_Container'])) ? $GLOBALS['HTTP_Session_Container']->open($save_path, $session_name) : false; } /** @ignore */ function HTTP_Session_Close() { return (isset($GLOBALS['HTTP_Session_Container'])) ? $GLOBALS['HTTP_Session_Container']->close() : false; } /** @ignore */ function HTTP_Session_Read($id) { return (isset($GLOBALS['HTTP_Session_Container'])) ? $GLOBALS['HTTP_Session_Container']->read($id) : false; } /** @ignore */ function HTTP_Session_Write($id, $data) { return (isset($GLOBALS['HTTP_Session_Container'])) ? $GLOBALS['HTTP_Session_Container']->write($id, $data) : false; } /** @ignore */ function HTTP_Session_Destroy($id) { return (isset($GLOBALS['HTTP_Session_Container'])) ? $GLOBALS['HTTP_Session_Container']->destroy($id) : false; } /** @ignore */ function HTTP_Session_GC($maxlifetime) { return (isset($GLOBALS['HTTP_Session_Container'])) ? $GLOBALS['HTTP_Session_Container']->gc($maxlifetime) : false; } ?>
 [2006-11-25 12:30 UTC] troehr (Torsten Roehr)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Please test latest CVS version of Container.php.