fixed PHP Fatal error: Call to a member function appsession() on a non-object when running as cron-job

This commit is contained in:
Ralf Becker 2014-05-06 14:41:06 +00:00
parent 291c4c04b4
commit f806bee109

View File

@ -260,11 +260,14 @@ class egw_link extends solink
* Would probably better called shutdown as well.
*/
static function save_session_cache()
{
if (isset($GLOBALS['egw']->session)) // eg. cron-jobs use it too, without any session
{
//error_log(__METHOD__.'() items in title-cache: '.count(self::$title_cache).' file-access-cache: '.count(self::$file_access_cache));
$GLOBALS['egw']->session->appsession('link_title_cache','phpgwapi',self::$title_cache);
$GLOBALS['egw']->session->appsession('link_file_access_cache','phpgwapi',self::$file_access_cache);
}
}
/**
* creats a link between $app1,$id1 and $app2,$id2 - $id1 does NOT need to exist yet