Home » HTTP » HTTP_Session » Bug #9396
Call to a member function on a non-object
Details
| Submitted | 2006-11-20 18:44 UTC |
|---|---|
| From | ryan dot hutchison at gymsolutions dot com |
| Assigned | troehr |
| Status | Closed |
| Package | HTTP_Session |
| PHP Version | 5.2.0 RC4 |
| OS | FreeBSD 6.1-STABLE |
| Roadmaps | (Not assigned) |
Comments
[2006-11-20 18:44 UTC] ryan dot hutchison at gymsolutions dot com
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
[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; }
?>