개별 서버마다 getDB() 함수를 부를 수 있도록 수정

This commit is contained in:
2018-03-05 02:03:31 +09:00
parent c49dcf8152
commit e8a9f73611
+21 -7
View File
@@ -1,12 +1,9 @@
<?php
require_once(__dir__.'/../../d_setting/conf.php');
/**
* DB 객체 생성
*
* @return MeekroDB
*/
function getDB(){
$_currentToken = '_token_';
function getDB__token_(){
$host = '_host_';
$user = '_user_';
$password = '_password_';
@@ -24,6 +21,23 @@ function getDB(){
return $uDB;
}
function getServPrefix(){
//XXX: 단일 서버 기준이고 외부에서 접근할일이 없다면 굳이 이런 구조를 할 이유가 없는데!
if(!function_exists('getDB')){
/**
* DB 객체 생성
*
* @return MeekroDB
*/
function getDB($getToken='_token_'){
$func = "getDB_{$getToken}";
return $func();
}
}
if (!function_exists('getServPrefix')) {
function getServPrefix($getToken='_token_')
{
return '_prefix_';
}
}