简体   繁体   中英

Joomla 1.5 and Wincache

I make the integration of Wincache with Joomla 1.5, but i see often, in php_errors this:

PHP Warning: Creating default object from empty value in joomla.php on line 136

The code is this:

$session =& JFactory::getSession();
$session->set('user', $instance);

$storage = $session->_store;
$session_data = $storage->readSessionData($session->getId());
/*136*/ $session_data->guest    = $instance->get('guest');
$session_data->username = $instance->get('username');

I think that I need to declare the object but i don't know how...

Thanks!

these are warnings.

If they do not affect your site usability, you may turn them of using the backend.

Go to Global Configuration.

In the server tab (If I remember well) there is something like Error Reporting.

Turn it off by setting it to none.

Joomla 1.5已过期,并且在当前版本的PHP中不能真正完美地工作(因为它被编写为支持4.4.7和...,所以很多不用于生成警告的内容将生成警告。如果您拥有现代的PHP,但有时却真的不值得付出。$ instance确实存在吗?

Problem solved! $session_data was empty in some circoustance so this generate the problem:

$session_data = $storage->readSessionData($session->getId());

For solve it, simple add:

if (! $storage->readSessionData($session->getId()) ){$session_data = new stdClass();}

Thanks to all!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM