개별 서버마다 getDB() 함수를 부를 수 있도록 수정
This commit is contained in:
@@ -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_';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user