Initial commit.

This is to be the new HashRU website based on the Aaronweb.net/Kabuki CMS.
This commit is contained in:
2016-09-01 23:13:23 +02:00
commit ab0e4efbcb
68 changed files with 8054 additions and 0 deletions

39
models/Registry.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
/*****************************************************************************
* Registry.php
* Allows sharing static variables between classes.
*
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
*****************************************************************************/
class Registry
{
public static $storage = [];
public static function set($key, $value)
{
self::$storage[$key] = $value;
return true;
}
public static function has($key)
{
return isset(self::$storage[$key]);
}
public static function get($key)
{
if (!isset(self::$storage[$key]))
trigger_error('Key does not exist in Registry: ' . $key, E_USER_ERROR);
return self::$storage[$key];
}
public static function remove($key)
{
if (!isset(self::$storage[$key]))
trigger_error('Key does not exist in Registry: ' . $key, E_USER_ERROR);
unset(self::$storage[$key]);
}
}