
rudie dirkx - 2011-02-09 14:50:07
Why do you use the native define() to define global constants? You're not using them like you should anyway, due to the var_export, so why not do it right?
<?php
class Const {
$constants = array();
static function set($name, $var) {
self::$constants[$name] = $var; // yup, that easy
}
static get($name, $alt = null) {
return isset(self::$constants[$name]) ? self::$constants[$name] : $alt;
}
}
?>