mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-28 23:59:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@969 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
2577bb60b7
commit
49582a9e09
3 changed files with 87 additions and 10 deletions
|
|
@ -114,7 +114,7 @@
|
||||||
**/
|
**/
|
||||||
function addQuotes($string) {
|
function addQuotes($string) {
|
||||||
if(get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
|
if(get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
|
||||||
if(!is_numeric($string)) $string = $this->handler->quote("'","''", $string);
|
if(!is_numeric($string)) $string = str_replace("'","''", $string);
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -135,11 +135,11 @@
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = $this->handler->query($query);
|
$result = $this->handler->query($query);
|
||||||
|
return $result;
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
$this->setError($e->getCode(), $e->getMessage());
|
$this->setError($e->getCode(), $e->getMessage());
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
return $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -175,9 +175,10 @@
|
||||||
* @brief 테이블 기생성 여부 return
|
* @brief 테이블 기생성 여부 return
|
||||||
**/
|
**/
|
||||||
function isTableExists($target_name) {
|
function isTableExists($target_name) {
|
||||||
$query = sprintf('pragma table_info(%s%s)', $this->prefix, $this->addQuotes($target_name));
|
$query = sprintf('pragma table_info(%s%s)', $this->prefix, $target_name);
|
||||||
$result = $this->handler->query($query);
|
$stmt = $this->handler->prepare($query);
|
||||||
if(count($result)==0) return false;
|
$result = $stmt->execute($query);
|
||||||
|
if(!$result) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -231,7 +232,7 @@
|
||||||
$auto_increment = $column->attrs->auto_increment;
|
$auto_increment = $column->attrs->auto_increment;
|
||||||
|
|
||||||
if($auto_increment) {
|
if($auto_increment) {
|
||||||
$column_schema[] = sprintf('%s %s PRIMARY KEY %s',
|
$column_schema[] = sprintf('%s %s %s',
|
||||||
$name,
|
$name,
|
||||||
$this->column_type[$type],
|
$this->column_type[$type],
|
||||||
$auto_increment?'AUTOINCREMENT':''
|
$auto_increment?'AUTOINCREMENT':''
|
||||||
|
|
@ -252,7 +253,7 @@
|
||||||
else if($index) $index_list[$index][] = $name;
|
else if($index) $index_list[$index][] = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$schema = sprintf('CREATE TABLE %s (%s%s) ;', $this->addQuotes($table_name)," ", implode($column_schema,", "));
|
$schema = sprintf('CREATE TABLE %s (%s%s) ;', $table_name," ", implode($column_schema,", "));
|
||||||
$output = $this->_query($schema);
|
$output = $this->_query($schema);
|
||||||
if(!$output) return false;
|
if(!$output) return false;
|
||||||
|
|
||||||
|
|
@ -318,7 +319,7 @@
|
||||||
$prepare_list[] = '?';
|
$prepare_list[] = '?';
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = sprintf("INSERT INTO %s%s (%s) VALUES (%s);", $this->prefix, $table, implode(',',$prepare_list));
|
$query = sprintf("INSERT INTO %s%s (%s) VALUES (%s);", $this->prefix, $table, implode(',',$key_list), implode(',',$prepare_list));
|
||||||
$stmt = $this->handler->prepare($query);
|
$stmt = $this->handler->prepare($query);
|
||||||
|
|
||||||
$val_count = count($val_list);
|
$val_count = count($val_list);
|
||||||
|
|
@ -338,7 +339,6 @@
|
||||||
|
|
||||||
if(in_array($key, $pass_quotes)) $update_list[] = sprintf('%s = ?', $key, $this->addQuotes($val));
|
if(in_array($key, $pass_quotes)) $update_list[] = sprintf('%s = ?', $key, $this->addQuotes($val));
|
||||||
$val_list[] = $this->addQuotes($val);
|
$val_list[] = $this->addQuotes($val);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(!count($update_list)) return;
|
if(!count($update_list)) return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
ob_start();
|
||||||
/**
|
/**
|
||||||
* @file index.php
|
* @file index.php
|
||||||
* @author zero (zero@zeroboard.com)
|
* @author zero (zero@zeroboard.com)
|
||||||
|
|
@ -47,4 +48,6 @@
|
||||||
$oModuleHandler->init();
|
$oModuleHandler->init();
|
||||||
$oModule = &$oModuleHandler->procModule();
|
$oModule = &$oModuleHandler->procModule();
|
||||||
$oModuleHandler->displayContent($oModule);
|
$oModuleHandler->displayContent($oModule);
|
||||||
|
debugPrint(ob_get_contents());
|
||||||
|
ob_end_flush();
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
74
modules/install/tpl/form.sqlite3_pdo.html
Normal file
74
modules/install/tpl/form.sqlite3_pdo.html
Normal file
|
|
@ -0,0 +1,74 @@
|
||||||
|
<!--%import("filter/sqlite2.xml")-->
|
||||||
|
|
||||||
|
<form action="./" method="post" onsubmit="return procFilter(this, install)">
|
||||||
|
<input type="hidden" name="db_type" value="{$db_type}" />
|
||||||
|
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
{$lang->db_title}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="2">{$lang->db_database_file}</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="db_database_file" value="./files/zeroboard_xe.sqlite" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{$lang->about_database_file}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{$lang->db_table_prefix}</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="db_table_prefix" value="xe" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
{$lang->admin_title}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{$lang->user_id}</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="user_id" value="zero" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{$lang->password1}</td>
|
||||||
|
<td>
|
||||||
|
<input type="password" name="password1" value="1234" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{$lang->password2}</td>
|
||||||
|
<td>
|
||||||
|
<input type="password" name="password2" value="1234" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{$lang->user_name}</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="user_name" value="zero" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{$lang->nick_name}</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="nick_name" value="zero" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{$lang->email_address}</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="email_address" value="zero@nzeo.com" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<input type="submit" value="{$lang->cmd_registration}" />
|
||||||
|
</form>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue