PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTTP » HTTP_Session » Bug #9396

Call to a member function on a non-object

Details

Submitted2006-11-20 18:44 UTC
Fromryan dot hutchison at gymsolutions dot com
Assignedtroehr
StatusClosed
PackageHTTP_Session
PHP Version5.2.0 RC4
OSFreeBSD 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; }

?>