mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-08 19:42:15 +09:00
PostgreSql DB 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3278 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c504da0ebe
commit
29d100531f
10 changed files with 61 additions and 7 deletions
|
|
@ -72,7 +72,7 @@
|
||||||
$conn_string = "";
|
$conn_string = "";
|
||||||
|
|
||||||
// db 정보가 없으면 무시
|
// db 정보가 없으면 무시
|
||||||
if(!$this->hostname || !$this->userid || !$this->password || !$this->database) return;
|
if(!$this->hostname || !$this->userid || !$this->database) return;
|
||||||
|
|
||||||
// connection string 만들기
|
// connection string 만들기
|
||||||
$conn_string .= ($this->hostname) ? " host=$this->hostname" : "";
|
$conn_string .= ($this->hostname) ? " host=$this->hostname" : "";
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
$this->is_connected = true;
|
$this->is_connected = true;
|
||||||
|
|
||||||
// utf8임을 지정
|
// utf8임을 지정
|
||||||
$this ->_query('set client_encoding to uhc')
|
//$this ->_query('set client_encoding to uhc');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -116,7 +116,7 @@
|
||||||
* @brief 트랜잭션 시작
|
* @brief 트랜잭션 시작
|
||||||
**/
|
**/
|
||||||
function begin() {
|
function begin() {
|
||||||
if(!$this->isConnect() || $this->transaction_started == false) return;
|
if(!$this->isConnected() || $this->transaction_started == false) return;
|
||||||
if($this->_query($this->fd, 'BEGIN'))
|
if($this->_query($this->fd, 'BEGIN'))
|
||||||
$this->transaction_started = true;
|
$this->transaction_started = true;
|
||||||
}
|
}
|
||||||
|
|
@ -125,7 +125,7 @@
|
||||||
* @brief 롤백
|
* @brief 롤백
|
||||||
**/
|
**/
|
||||||
function rollback() {
|
function rollback() {
|
||||||
if(!$this->isConnect() || $this->transaction_started == false) return;
|
if(!$this->isConnected() || $this->transaction_started == false) return;
|
||||||
if($this->_query($this->fd, 'ROLLBACK'))
|
if($this->_query($this->fd, 'ROLLBACK'))
|
||||||
$this->transaction_started = false;
|
$this->transaction_started = false;
|
||||||
}
|
}
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
* @brief 커밋
|
* @brief 커밋
|
||||||
**/
|
**/
|
||||||
function commit() {
|
function commit() {
|
||||||
if(!$this->isConnect() || $this->transaction_started == false) return;
|
if(!$this->isConnected() || $this->transaction_started == false) return;
|
||||||
if($this->_query($this->fd, 'COMMIT'))
|
if($this->_query($this->fd, 'COMMIT'))
|
||||||
$this->transaction_started = false;
|
$this->transaction_started = false;
|
||||||
}
|
}
|
||||||
|
|
@ -193,7 +193,9 @@
|
||||||
* @brief 테이블 기생성 여부 return
|
* @brief 테이블 기생성 여부 return
|
||||||
**/
|
**/
|
||||||
function isTableExists($target_name) {
|
function isTableExists($target_name) {
|
||||||
|
if($target_name == "sequence") return true;
|
||||||
$query = sprintf("SELECT tablename FROM pg_tables WHERE tablename = '%s%s' AND schemaname = current_schema()", $this->prefix, $this->addQuotes($target_name));
|
$query = sprintf("SELECT tablename FROM pg_tables WHERE tablename = '%s%s' AND schemaname = current_schema()", $this->prefix, $this->addQuotes($target_name));
|
||||||
|
|
||||||
$result = $this->_query($query);
|
$result = $this->_query($query);
|
||||||
$tmp = $this->_fetch($result);
|
$tmp = $this->_fetch($result);
|
||||||
if(!$tmp) return false;
|
if(!$tmp) return false;
|
||||||
|
|
@ -237,6 +239,11 @@
|
||||||
function addIndex($table_name, $index_name, $target_columns, $is_unique = false) {
|
function addIndex($table_name, $index_name, $target_columns, $is_unique = false) {
|
||||||
if(!is_array($target_columns)) $target_columns = array($target_columns);
|
if(!is_array($target_columns)) $target_columns = array($target_columns);
|
||||||
|
|
||||||
|
if(strpos($table_name,$this->prefix)===false) $table_name = $this->prefix.$table_name;
|
||||||
|
|
||||||
|
// index_name의 경우 앞에 table이름을 붙여줘서 중복을 피함
|
||||||
|
$index_name = $table_name.$index_name;
|
||||||
|
|
||||||
$query = sprintf("create %s index %s on %s (%s);", $is_unique?'unique':'', $index_name, $table_name, implode(',',$target_columns));
|
$query = sprintf("create %s index %s on %s (%s);", $is_unique?'unique':'', $index_name, $table_name, implode(',',$target_columns));
|
||||||
$this->_query($query);
|
$this->_query($query);
|
||||||
}
|
}
|
||||||
|
|
@ -245,8 +252,13 @@
|
||||||
* @brief 특정 테이블의 index 정보를 return
|
* @brief 특정 테이블의 index 정보를 return
|
||||||
**/
|
**/
|
||||||
function isIndexExists($table_name, $index_name) {
|
function isIndexExists($table_name, $index_name) {
|
||||||
|
if(strpos($table_name,$this->prefix)===false) $table_name = $this->prefix.$table_name;
|
||||||
|
|
||||||
|
// index_name의 경우 앞에 table이름을 붙여줘서 중복을 피함
|
||||||
|
$index_name = $table_name.$index_name;
|
||||||
|
|
||||||
//$query = sprintf("show indexes from %s%s where key_name = '%s' ", $this->prefix, $table_name, $index_name);
|
//$query = sprintf("show indexes from %s%s where key_name = '%s' ", $this->prefix, $table_name, $index_name);
|
||||||
$query = sprintf("select indexname from pg_indexes where schemaname = current_schema() and tablename = '%s%s' and indexname = '%s'", $this->prefix, $table_name, strtolower($index_name));
|
$query = sprintf("select indexname from pg_indexes where schemaname = current_schema() and tablename = '%s' and indexname = '%s'", $table_name, strtolower($index_name));
|
||||||
$result = $this->_query($query);
|
$result = $this->_query($query);
|
||||||
if($this->isError()) return;
|
if($this->isError()) return;
|
||||||
$output = $this->_fetch($result);
|
$output = $this->_fetch($result);
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@
|
||||||
$oDB = &DB::getInstance();
|
$oDB = &DB::getInstance();
|
||||||
|
|
||||||
// DB접속이 가능한지 체크
|
// DB접속이 가능한지 체크
|
||||||
|
$output = $oDB->getError();
|
||||||
if(!$oDB->isConnected()) return $oDB->getError();
|
if(!$oDB->isConnected()) return $oDB->getError();
|
||||||
|
|
||||||
$oDB->begin();
|
$oDB->begin();
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ EndOfLicense;
|
||||||
'sqlite2' => 'Supporting sqlite2 which saves the data into the file.<br />When installing, DB file should be created at unreachable place from web.<br />(Never got tested on stabilization)',
|
'sqlite2' => 'Supporting sqlite2 which saves the data into the file.<br />When installing, DB file should be created at unreachable place from web.<br />(Never got tested on stabilization)',
|
||||||
'sqlite3_pdo' => 'Suppots sqlite3 by PHP\'s PDO.<br />When installing, DB file should be created at unreachable place from web.',
|
'sqlite3_pdo' => 'Suppots sqlite3 by PHP\'s PDO.<br />When installing, DB file should be created at unreachable place from web.',
|
||||||
'cubrid' => 'Use CUBRID DB.',
|
'cubrid' => 'Use CUBRID DB.',
|
||||||
|
'postgresql' => 'Use PostgreSql DB.',
|
||||||
);
|
);
|
||||||
|
|
||||||
$lang->form_title = 'Please input DB & Admin information';
|
$lang->form_title = 'Please input DB & Admin information';
|
||||||
|
|
|
||||||
|
|
@ -241,6 +241,7 @@ EndOfLicense;
|
||||||
'sqlite2' => 'Soporta sqlite2, el cual almacena los datos en archivos <br />En la instalacion, es necesario crear archivo de BD en un lugar inaccesible de la web.<br />(Testeo de la estabilización no realizada)',
|
'sqlite2' => 'Soporta sqlite2, el cual almacena los datos en archivos <br />En la instalacion, es necesario crear archivo de BD en un lugar inaccesible de la web.<br />(Testeo de la estabilización no realizada)',
|
||||||
'sqlite3_pdo' => 'A través de PDO de PHP soporta sqlite2 <br />En la instalación, es necesario crear archivo de BD en un lugar inaccesible de la web.',
|
'sqlite3_pdo' => 'A través de PDO de PHP soporta sqlite2 <br />En la instalación, es necesario crear archivo de BD en un lugar inaccesible de la web.',
|
||||||
'cubrid' => 'Usar BD CUBRID.',
|
'cubrid' => 'Usar BD CUBRID.',
|
||||||
|
'postgresql' => 'Usar BD PostgreSql.',
|
||||||
);
|
);
|
||||||
|
|
||||||
$lang->form_title = 'Ingresar BD & Información del Administrador;';
|
$lang->form_title = 'Ingresar BD & Información del Administrador;';
|
||||||
|
|
|
||||||
|
|
@ -238,6 +238,7 @@ EndOfLicense;
|
||||||
'sqlite2' => 'ファイルタイプデータベースである「sqlite2」をサポートします。インストールの際は、DBファイルはウェブがらアクセスできない場所に作成してください。(安定化までのテストは行われていません)',
|
'sqlite2' => 'ファイルタイプデータベースである「sqlite2」をサポートします。インストールの際は、DBファイルはウェブがらアクセスできない場所に作成してください。(安定化までのテストは行われていません)',
|
||||||
'sqlite3_pdo' => 'PHPのPDOを経由うして「sqlite3」をサポートします。インストールの際は、ウェブからアクセスできない場所に作成してください。',
|
'sqlite3_pdo' => 'PHPのPDOを経由うして「sqlite3」をサポートします。インストールの際は、ウェブからアクセスできない場所に作成してください。',
|
||||||
'cubrid' => 'CUBRID DBを利用します。',
|
'cubrid' => 'CUBRID DBを利用します。',
|
||||||
|
'postgresql' => 'PostgreSql DBを利用します。',
|
||||||
);
|
);
|
||||||
|
|
||||||
$lang->form_title = 'データベース & 管理者情報入力';
|
$lang->form_title = 'データベース & 管理者情報入力';
|
||||||
|
|
|
||||||
|
|
@ -237,6 +237,7 @@ EndOfLicense;
|
||||||
'sqlite2' => '파일로 데이터를 저장하는 sqlite2를 지원합니다.<br />설치시 DB파일은 웹에서 접근할 수 없는 곳에 생성하여 주셔야 합니다.<br />(안정화 테스트가 되지 않았습니다)',
|
'sqlite2' => '파일로 데이터를 저장하는 sqlite2를 지원합니다.<br />설치시 DB파일은 웹에서 접근할 수 없는 곳에 생성하여 주셔야 합니다.<br />(안정화 테스트가 되지 않았습니다)',
|
||||||
'sqlite3_pdo' => 'PHP의 PDO로 sqlite3를 지원합니다.<br />설치시 DB파일은 웹에서 접근할 수 없는 곳에 생성하여 주셔야 합니다.',
|
'sqlite3_pdo' => 'PHP의 PDO로 sqlite3를 지원합니다.<br />설치시 DB파일은 웹에서 접근할 수 없는 곳에 생성하여 주셔야 합니다.',
|
||||||
'cubrid' => 'CUBRID DB를 이용합니다.',
|
'cubrid' => 'CUBRID DB를 이용합니다.',
|
||||||
|
'postgresql' => 'PostgreSql을 이용합니다',
|
||||||
);
|
);
|
||||||
|
|
||||||
$lang->form_title = 'DB & 관리자 정보 입력';
|
$lang->form_title = 'DB & 관리자 정보 입력';
|
||||||
|
|
|
||||||
|
|
@ -329,6 +329,7 @@ EndOfLicense;
|
||||||
'sqlite2' => 'Поддерживает sqlite2, которая сохраняет данные в файл.<br />Устанавливая, следует размещать файл базы данных в недоступном с веб месте.<br />(Никогда не тестировалось на стабильность)',
|
'sqlite2' => 'Поддерживает sqlite2, которая сохраняет данные в файл.<br />Устанавливая, следует размещать файл базы данных в недоступном с веб месте.<br />(Никогда не тестировалось на стабильность)',
|
||||||
'sqlite3_pdo' => 'Поддерживает sqlite3 посредством PHP\'s PDO.<br />Устанавливая, следует размещать файл базы данных в недоступном с веб месте.',
|
'sqlite3_pdo' => 'Поддерживает sqlite3 посредством PHP\'s PDO.<br />Устанавливая, следует размещать файл базы данных в недоступном с веб месте.',
|
||||||
'cubrid' => 'Используем CUBRID DB.',
|
'cubrid' => 'Используем CUBRID DB.',
|
||||||
|
'postgresql' => 'Используем PostgreSql DB.',
|
||||||
);
|
);
|
||||||
|
|
||||||
$lang->form_title = 'Пожалуйста, введите дазу данных & Административная Информация';
|
$lang->form_title = 'Пожалуйста, введите дазу данных & Административная Информация';
|
||||||
|
|
|
||||||
|
|
@ -230,6 +230,7 @@ EndOfLicense;
|
||||||
'sqlite2' => '支持用文件形式保存数据的sqlite2。<br />安装时DB文件应在web不能访问的地方生成。<br />(还没有通过安全的测试)',
|
'sqlite2' => '支持用文件形式保存数据的sqlite2。<br />安装时DB文件应在web不能访问的地方生成。<br />(还没有通过安全的测试)',
|
||||||
'sqlite3_pdo' => '用PHP的 PDO支持 sqlite3。<br />安装时DB文件应在web不能访问的地方生成。',
|
'sqlite3_pdo' => '用PHP的 PDO支持 sqlite3。<br />安装时DB文件应在web不能访问的地方生成。',
|
||||||
'cubrid' => '使用CUBRID DB。',
|
'cubrid' => '使用CUBRID DB。',
|
||||||
|
'postgresql' => '使用PostgreSql DB。',
|
||||||
);
|
);
|
||||||
|
|
||||||
$lang->form_title = '输入数据库及管理员信息';
|
$lang->form_title = '输入数据库及管理员信息';
|
||||||
|
|
|
||||||
35
modules/install/tpl/filter/postgresql.xml
Normal file
35
modules/install/tpl/filter/postgresql.xml
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
<filter name="install" module="install" act="procInstall">
|
||||||
|
<form>
|
||||||
|
<node target="db_type" required="true" />
|
||||||
|
<node target="db_hostname" required="true" minlength="1" maxlength="250" />
|
||||||
|
<node target="db_userid" required="true" minlength="1" maxlength="250"/>
|
||||||
|
<node target="db_database" required="true" minlength="1" maxlength="250" />
|
||||||
|
<node target="db_table_prefix" required="true" minlength="2" maxlength="20" filter="alpha"/>
|
||||||
|
<node target="user_id" required="true" minlength="2" maxlength="20" filter="alpha,userid" />
|
||||||
|
<node target="password1" required="true" minlength="1" maxlength="20" />
|
||||||
|
<node target="password2" required="true" equalto="password1" minlength="1" maxlegnth="20" />
|
||||||
|
<node target="user_name" required="true" minlength="2" maxlength="20" />
|
||||||
|
<node target="nick_name" required="true" minlength="2" maxlength="20" />
|
||||||
|
<node target="email_address" required="true" minlength="1" maxlength="200" filter="email"/>
|
||||||
|
</form>
|
||||||
|
<parameter>
|
||||||
|
<param name="db_type" target="db_type" />
|
||||||
|
<param name="db_hostname" target="db_hostname" />
|
||||||
|
<param name="db_userid" target="db_userid" />
|
||||||
|
<param name="db_password" target="db_password" />
|
||||||
|
<param name="db_database" target="db_database" />
|
||||||
|
<param name="db_table_prefix" target="db_table_prefix" />
|
||||||
|
<param name="user_id" target="user_id" />
|
||||||
|
<param name="password" target="password1" />
|
||||||
|
<param name="user_name" target="user_name" />
|
||||||
|
<param name="nick_name" target="nick_name" />
|
||||||
|
<param name="email_address" target="email_address" />
|
||||||
|
<param name="use_rewrite" target="use_rewrite" />
|
||||||
|
<param name="time_zone" target="time_zone" />
|
||||||
|
</parameter>
|
||||||
|
<response callback_func="completeInstalled">
|
||||||
|
<tag name="error" />
|
||||||
|
<tag name="message" />
|
||||||
|
<tag name="redirect_url" />
|
||||||
|
</response>
|
||||||
|
</filter>
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<!--%import("filter/mysql.xml")-->
|
<!--%import("filter/postgresql.xml")-->
|
||||||
<!--%import("js/install_admin.js")-->
|
<!--%import("js/install_admin.js")-->
|
||||||
<!--#include("header.html")-->
|
<!--#include("header.html")-->
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue