2 // @title Session class
3 // @author Matt Todd <matt@matttoddphoto.com>
5 // @desc A session class for easily accessing and administering sessions (can
6 // transparently keep all session data in the database)
7 // @requires stdexception.php (StdException class)
9 include_once('stdexception.php');
12 // hash type constants
13 // define("AUTH_HASHTYPE_SHA", 2);
14 // define("AUTH_HASHTYPE_MD5", 5);
19 public static function retreive($name) {
20 return $GLOBALS[$name];
22 public static function store($values) {
23 foreach($values as $key=>$value) {
24 $GLOBALS[$key] = $value;
28 public static function retreive_section($name, $section) {
29 return $GLOBALS[$name][$section];
31 public static function store_section($section, $property, $value) {
32 $GLOBALS[$section][$property] = $value;
36 public function __set($name, $value) {
37 $GLOBALS[$name] = $value;
39 public function __get($name) {
40 return $GLOBALS[$name];
44 class GlobalsException
extends StdException
{}