示例#1
0
 /**
  * retrieve a value
  *
  * @param string $name the variable to retrieve
  *
  * @return mixed value
  */
 static function get($name)
 {
     if (!isset(self::$vals[$name])) {
         if (count(self::$vals)) {
             self::$vals[$name] = '';
         }
         if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/ww.incs/distconfig.php')) {
             require_once $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/distconfig.php';
             self::$vals = $config;
         } else {
             require_once $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/distconfig.example.php';
             self::$vals = $config;
         }
         if (!isset(self::$vals[$name])) {
             self::$vals[$name] = '';
         }
     }
     return self::$vals[$name];
 }