/** * 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]; }