-
Notifications
You must be signed in to change notification settings - Fork 0
/
Registry.php
executable file
·62 lines (60 loc) · 1.47 KB
/
Registry.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
namespace BlueSeed;
/**
*
* The controller to support interpretation of requests
* @author ivonascimento <[email protected]>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
*
*/
class Registry{
/**
*
* wher ethe data are stored
* @var unknown_type
* @static
*/
private static $data = Array();
/**
*
* set a new data. If data exists its override
* this method can Set Object but without serialize
* @param string $name
* @param mixed $value
* @return void
*/
public static function setVar($name, $value){
self::$data[$name] = $value;
}
/**
*
* retrieve the data stored in informed label
* @param string $name
* @return mixed
*/
public static function getVar($name){
return self::$data[$name];
}
/**
*
* retrieve the data stored in informed label before unserialize it
* @param unknown_type $name
* @return mixed
*/
public static function getObject($name){
if (isset(self::$data['objects'][$name])){
return unserialize(self::$data['objects'][$name]);
}
return NULL;
}
/**
*
* set a new data. If data exists its override
* this method serialize the data before store
* @param string $name
* @package mixed $value
*/
public static function setObject($name, $value){
self::$data['objects'][$name] = serialize($value);
}
}