From 965cbe52f22809f19ca150feb585b0218aa89f85 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 22 Sep 2010 17:01:17 +0000 Subject: Converted line endings to unix. git-svn-id: http://code.elgg.org/elgg/trunk@6957 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggSession.php | 188 ++++++++++++++++++++--------------------- 1 file changed, 94 insertions(+), 94 deletions(-) (limited to 'engine/classes/ElggSession.php') diff --git a/engine/classes/ElggSession.php b/engine/classes/ElggSession.php index 874502579..e34f7a961 100644 --- a/engine/classes/ElggSession.php +++ b/engine/classes/ElggSession.php @@ -1,95 +1,95 @@ -offsetExists($key); - } - - /** Set a value, go straight to session. */ - function offsetSet($key, $value) { - $_SESSION[$key] = $value; - } - - /** - * Get a variable from either the session, or if its not in the session attempt to get it from - * an api call. - */ - function offsetGet($key) { - if (!ElggSession::$__localcache) { - ElggSession::$__localcache = array(); - } - - if (isset($_SESSION[$key])) { - return $_SESSION[$key]; - } - - if (isset(ElggSession::$__localcache[$key])) { - return ElggSession::$__localcache[$key]; - } - - $value = NULL; - $value = trigger_plugin_hook('session:get', $key, NULL, $value); - - ElggSession::$__localcache[$key] = $value; - - return ElggSession::$__localcache[$key]; - } - - /** - * Unset a value from the cache and the session. - */ - function offsetUnset($key) { - unset(ElggSession::$__localcache[$key]); - unset($_SESSION[$key]); - } - - /** - * Return whether the value is set in either the session or the cache. - */ - function offsetExists($offset) { - if (isset(ElggSession::$__localcache[$offset])) { - return true; - } - - if (isset($_SESSION[$offset])) { - return true; - } - - if ($this->offsetGet($offset)){ - return true; - } - } - - - // Alias functions - function get($key) { - return $this->offsetGet($key); - } - - function set($key, $value) { - return $this->offsetSet($key, $value); - } - - function del($key) { - return $this->offsetUnset($key); - } +offsetExists($key); + } + + /** Set a value, go straight to session. */ + function offsetSet($key, $value) { + $_SESSION[$key] = $value; + } + + /** + * Get a variable from either the session, or if its not in the session attempt to get it from + * an api call. + */ + function offsetGet($key) { + if (!ElggSession::$__localcache) { + ElggSession::$__localcache = array(); + } + + if (isset($_SESSION[$key])) { + return $_SESSION[$key]; + } + + if (isset(ElggSession::$__localcache[$key])) { + return ElggSession::$__localcache[$key]; + } + + $value = NULL; + $value = trigger_plugin_hook('session:get', $key, NULL, $value); + + ElggSession::$__localcache[$key] = $value; + + return ElggSession::$__localcache[$key]; + } + + /** + * Unset a value from the cache and the session. + */ + function offsetUnset($key) { + unset(ElggSession::$__localcache[$key]); + unset($_SESSION[$key]); + } + + /** + * Return whether the value is set in either the session or the cache. + */ + function offsetExists($offset) { + if (isset(ElggSession::$__localcache[$offset])) { + return true; + } + + if (isset($_SESSION[$offset])) { + return true; + } + + if ($this->offsetGet($offset)){ + return true; + } + } + + + // Alias functions + function get($key) { + return $this->offsetGet($key); + } + + function set($key, $value) { + return $this->offsetSet($key, $value); + } + + function del($key) { + return $this->offsetUnset($key); + } } \ No newline at end of file -- cgit v1.2.3