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

@ -261,9 +261,12 @@ class egw_link extends solink
*/ */
static function save_session_cache() static function save_session_cache()
{ {
//error_log(__METHOD__.'() items in title-cache: '.count(self::$title_cache).' file-access-cache: '.count(self::$file_access_cache)); if (isset($GLOBALS['egw']->session)) // eg. cron-jobs use it too, without any session
$GLOBALS['egw']->session->appsession('link_title_cache','phpgwapi',self::$title_cache); {
$GLOBALS['egw']->session->appsession('link_file_access_cache','phpgwapi',self::$file_access_cache); //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);
}
} }
/** /**