[PEAR-BUG] Bug #18640 [Opn->Bgs]: Class has no unserializer

[email protected]
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at http://pear.php.net/bugs/bug.php?id=18640&edit=1

 ID:               18640
 Updated by:       [email protected]
 Reported By:      matthew at slyman dot org
 Summary:          Class has no unserializer
-Status:           Open
+Status:           Bogus
 Type:             Bug
 Package:          Net_GeoIP
 Operating System: Linux
 Package Version:  1.0.0
 PHP Version:      5.2.12
 Roadmap Versions: 
 New Comment:

-Status: Open
+Status: Bogus
Sorry, but your problem does not imply a bug in PEAR itself.  For a
list of more appropriate places to ask for help using PEAR, please
visit http://pear.php.net/support/ as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PEAR.

The method returns an object. You could serialize an array containing
the different values, ie:

$_SESSION['location'] = array($location->city, $location->region,
$location->latitude, $location->longitude);


Previous Comments:
------------------------------------------------------------------------

[2011-06-30 19:50:25] matthewslyman

Description:
------------
Tried storing the results of:
$geoip->lookupLocation($_SERVER['REMOTE_ADDR'])

in a session variable. The session_start() function results in a 
warning.

Test script:
---------------
<?php session_start();

if(!isset($_SESSION['location'])){//ONLY LOOKUP LOCATION DATA ONCE PER
SESSION (which we insist will be on only one IP address anyway)
	require_once "Net/GeoIP.php";
	$geoip =
Net_GeoIP::getInstance("/home/aaabitco/php/Net/GeoIP/GeoLiteCity.dat");
	try {	session_register('location');
		$_SESSION['location'] =
$geoip->lookupLocation($_SERVER['REMOTE_ADDR']);
	} catch (Exception $e) {// Handle exception
	}
}
?>

Expected result:
----------------
If the session is new, location data should be cached in a session 
variable (this works fine). I would expect this to work without 
errors or warnings (this is where it goes wrong).

Actual result:
--------------
Session variable correctly caches the data, but when 
session_start() function is called, this warning message is 
displayed on the web:

Warning: Class __PHP_Incomplete_Class has no unserializer 
in /home/{accountname}/public_html/news/index.php on line 
1

I reckon this is happening because the Class of the location 
data is missing an "unserializer" method. Am I wrong?

------------------------------------------------------------------------


-- 
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18640&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.