Ejemplo n.º 1
0
 public static function db($dbName = '')
 {
     $dbInfoFile = self::site('dbset');
     if (empty(self::$db[$dbInfoFile])) {
         $dbConfigFile = Directory::config_db() . DIRECTORY_SEPARATOR . $dbInfoFile . self::DOT . self::EXTENSION;
         if (is_file($dbConfigFile) == false) {
             throw new ConfigureException($dbInfoFile . " 디비 설정 파일을 찾을수 없습니다. (" . $dbConfigFile . ")");
         }
         $configure = file_get_contents($dbConfigFile);
         self::$db[$dbInfoFile] = json_decode($configure, true);
     }
     return $dbName ? self::$db[$dbInfoFile][$dbName] : self::$db[$dbInfoFile];
 }