}
/* Retrieves a cached tasklist or make sure one is created. */
- $this->_tasklist = $this->_backend->getTaskListFromCache();
+ $this->_tasklist = $this->_backend->getTasklistFromCache();
if (empty($this->_tasklist)) {
$this->_createTaskList();
}
- register_shutdown_function(array($this, 'shutdown'));
+ $this->_backend->registerShutdown(array($this, 'shutdown'));
}
/**
public function shutdown()
{
if (isset($this->_tasklist)) {
- $_SESSION['horde_logintasks'][$this->_app] = serialize($this->_tasklist);
+ $this->_tasklist = $this->_backend->storeTasklistInCache($this->_tasklist);
}
}
* if no task list was cached.
*/
abstract public function getTasklistFromCache();
+
+ /**
+ * Store a login tasklist in the cache.
+ *
+ * @param Horde_LoginTasks_Tasklist|boolean The tasklist to be stored.
+ *
+ * @return NULL
+ */
+ abstract public function storeTasklistInCache($tasklist);
+
+ /**
+ * Register the shutdown handler.
+ *
+ * @param array The shutdown function
+ *
+ * @return NULL
+ */
+ abstract public function registerShutdown($shutdown);
}
\ No newline at end of file
}
return false;
}
+
+ /**
+ * Store a login tasklist in the cache.
+ *
+ * @param Horde_LoginTasks_Tasklist|boolean The tasklist to be stored.
+ *
+ * @return NULL
+ */
+ public function storeTasklistInCache($tasklist)
+ {
+ $_SESSION['horde_logintasks'][$this->_app] = serialize($tasklist);
+ }
+
+ /**
+ * Register the shutdown handler.
+ *
+ * @param array The shutdown function
+ *
+ * @return NULL
+ */
+ public function registerShutdown($shutdown)
+ {
+ register_shutdown_function($shutdown);
+ }
}
\ No newline at end of file