1 | <?php |
||
25 | class Manager { |
||
26 | /** |
||
27 | * A container for all defined constants. |
||
28 | * |
||
29 | * @access public |
||
30 | * @static |
||
31 | * |
||
32 | * @var array. |
||
33 | */ |
||
34 | public static $set_constants = array(); |
||
35 | |||
36 | /** |
||
37 | * Checks if a "constant" has been set in constants Manager, and if not, |
||
38 | * checks if the constant was defined with define( 'name', 'value ). |
||
39 | * |
||
40 | * @param string $name The name of the constant. |
||
41 | * |
||
42 | * @return bool |
||
43 | */ |
||
44 | public static function is_defined( $name ) { |
||
49 | /** |
||
50 | * Checks if a "constant" has been set in constants Manager |
||
51 | * and has the value of true |
||
52 | * |
||
53 | * @param string $name The name of the constant. |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | public static function is_true( $name ) { |
||
60 | |||
61 | /** |
||
62 | * Attempts to retrieve the "constant" from constants Manager, and if it hasn't been set, |
||
63 | * then attempts to get the constant with the constant() function. |
||
64 | * |
||
65 | * @param string $name The name of the constant. |
||
66 | * |
||
67 | * @return mixed null if the constant does not exist or the value of the constant. |
||
68 | */ |
||
69 | public static function get_constant( $name ) { |
||
76 | |||
77 | /** |
||
78 | * Sets the value of the "constant" within constants Manager. |
||
79 | * |
||
80 | * @param string $name The name of the constant. |
||
81 | * @param string $value The value of the constant. |
||
82 | */ |
||
83 | public static function set_constant( $name, $value ) { |
||
86 | |||
87 | /** |
||
88 | * Will unset a "constant" from constants Manager if the constant exists. |
||
89 | * |
||
90 | * @param string $name The name of the constant. |
||
91 | * |
||
92 | * @return bool Whether the constant was removed. |
||
93 | */ |
||
94 | public static function clear_single_constant( $name ) { |
||
102 | |||
103 | /** |
||
104 | * Resets all of the constants within constants Manager. |
||
105 | */ |
||
106 | public static function clear_constants() { |
||
109 | } |
||
110 | |||
111 |