mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@965 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
045f08a8c3
commit
d22dab39c4
9 changed files with 60 additions and 15 deletions
|
|
@ -61,11 +61,31 @@
|
|||
* @brief 지원 가능한 DB 목록을 return
|
||||
**/
|
||||
function _getSupportedList() {
|
||||
// ./classes/db 에서 DB.class.php를 제외한 목록을 구함
|
||||
if(!count($this->supported_list)) {
|
||||
$db_classes_path = "./classes/db/";
|
||||
$filter = "/^DB([^\.]+)\.class\.php/i";
|
||||
$this->supported_list = FileHandler::readDir($db_classes_path, $filter, true);
|
||||
$supported_list = FileHandler::readDir($db_classes_path, $filter, true);
|
||||
}
|
||||
|
||||
// 구해진 클래스의 객체 생성후 isSupported method를 통해 지원 여부를 판단
|
||||
for($i=0;$i<count($supported_list);$i++) {
|
||||
$db_type = $supported_list[$i];
|
||||
$class_name = sprintf("DB%s%s", strtoupper(substr($db_type,0,1)), strtolower(substr($db_type,1)));
|
||||
$class_file = sprintf("./classes/db/%s.class.php", $class_name);
|
||||
if(!file_exists($class_file)) continue;
|
||||
|
||||
unset($oDB);
|
||||
require_once($class_file);
|
||||
$eval_str = sprintf('$oDB = new %s();', $class_name);
|
||||
eval($eval_str);
|
||||
|
||||
if(!$oDB || !$oDB->isSupported()) continue;
|
||||
|
||||
$this->supported_list[] = $db_type;
|
||||
|
||||
}
|
||||
|
||||
return $this->supported_list;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,14 @@
|
|||
$this->_connect();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치 가능 여부를 return
|
||||
**/
|
||||
function isSupported() {
|
||||
if(!function_exists('mysql_connect') || mysql_get_client_info() < "4.1.00") return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DB정보 설정 및 connect/ close
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -44,6 +44,14 @@
|
|||
$this->_connect();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치 가능 여부를 return
|
||||
**/
|
||||
function isSupported() {
|
||||
if(!function_exists('mysqli_connect') || mysqli_get_client_info() < "4.1.00") return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DB정보 설정 및 connect/ close
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -37,6 +37,14 @@
|
|||
$this->_connect();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치 가능 여부를 return
|
||||
**/
|
||||
function isSupported() {
|
||||
if(!function_exists('sqlite_open')) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DB정보 설정 및 connect/ close
|
||||
**/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue