Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/license.php *
|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/license.php *
|
* $Id: db_sqlite3.php 3902 2008-06-11 02:21:37Z Tikitiki $
| * $Id: db_sqlite3.php 4224 2008-10-05 11:17:04Z Tikitiki $
|
*/
class DB_SQLite3
| */
class DB_SQLite3
|
Zeile 180 | Zeile 180 |
---|
} else {
|
} else {
|
$query = $this->alter_table_parse($tablename, $alterdefs);
| $query = $this->alter_table_parse($tablename, $alterdefs, $string);
|
} } }
| } } }
|
Zeile 964 | Zeile 964 |
---|
* @param string The table (optional) * @return integer the total size of all mysql tables or a specific table */
|
* @param string The table (optional) * @return integer the total size of all mysql tables or a specific table */
|
function alter_table_parse($table, $alterdefs)
| function alter_table_parse($table, $alterdefs, $fullquery="")
|
{
|
{
|
| if(!$fullquery) { $fullquery = " ... {$alterdefs}"; } if(!defined("TIME_NOW")) { define("TIME_NOW", time()); }
|
if($alterdefs != '') { $result = $this->query("SELECT sql,name,type FROM sqlite_master WHERE tbl_name = '{$table}' ORDER BY type DESC");
| if($alterdefs != '') { $result = $this->query("SELECT sql,name,type FROM sqlite_master WHERE tbl_name = '{$table}' ORDER BY type DESC");
|
Zeile 987 | Zeile 997 |
---|
$colparts = preg_split("/[\s]+/", $oldcols[$i], -1, PREG_SPLIT_NO_EMPTY); $oldcols[$i] = $colparts[0]; $newcols[$colparts[0]] = $colparts[0];
|
$colparts = preg_split("/[\s]+/", $oldcols[$i], -1, PREG_SPLIT_NO_EMPTY); $oldcols[$i] = $colparts[0]; $newcols[$colparts[0]] = $colparts[0];
|
} $newcolumns = ''; $oldcolumns = ''; reset($newcols); foreach($newcols as $key => $val)
| } $newcolumns = ''; $oldcolumns = ''; reset($newcols); foreach($newcols as $key => $val)
|
{ $newcolumns .= ($newcolumns ? ', ' : '').$val; $oldcolumns .= ($oldcolumns ? ', ' : '').$key;
| { $newcolumns .= ($newcolumns ? ', ' : '').$val; $oldcolumns .= ($oldcolumns ? ', ' : '').$key;
|
Zeile 1045 | Zeile 1055 |
---|
} else {
|
} else {
|
$this->error($alterdefs, 'unknown column "'.$defparts[1].'" in "'.$table.'"', E_USER_WARNING);
| $this->error($fullquery, 'unknown column "'.$defparts[1].'" in "'.$table.'"', E_USER_WARNING);
|
return false; } break; case 'drop': if(sizeof($defparts) < 2) {
|
return false; } break; case 'drop': if(sizeof($defparts) < 2) {
|
$this->error($alterdefs, 'near "'.$defparts[0].($defparts[1] ? ' '.$defparts[1] : '').'": syntax error');
| $this->error($fullquery, 'near "'.$defparts[0].($defparts[1] ? ' '.$defparts[1] : '').'": syntax error');
|
return false; }
| return false; }
|
Zeile 1073 | Zeile 1083 |
---|
} else {
|
} else {
|
$this->error($alterdefs, 'unknown column "'.$defparts[1].'" in "'.$table.'"');
| $this->error($fullquery, 'unknown column "'.$defparts[1].'" in "'.$table.'"');
|
return false; } break; default:
|
return false; } break; default:
|
$this->error($alterdefs, 'near "'.$prevword.'": syntax error');
| $this->error($fullquery, 'near "'.$prevword.'": syntax error');
|
return false; }
| return false; }
|
Zeile 1108 | Zeile 1118 |
---|
$newcolumns .= ($newcolumns ? ', ' : '').$val; $oldcolumns .= ($oldcolumns ? ', ' : '').$key; }
|
$newcolumns .= ($newcolumns ? ', ' : '').$val; $oldcolumns .= ($oldcolumns ? ', ' : '').$key; }
|
|
|
$copytonewsql = 'INSERT INTO '.$table.'('.$newcolumns.') SELECT '.$oldcolumns.' FROM '.$tmpname;
| $copytonewsql = 'INSERT INTO '.$table.'('.$newcolumns.') SELECT '.$oldcolumns.' FROM '.$tmpname;
|
Zeile 1122 | Zeile 1132 |
---|
} else {
|
} else {
|
$this->error($alterdefs, 'no such table: '.$table);
| $this->error($fullquery, 'no such table: '.$table);
|
return false; } return true;
| return false; } return true;
|
Zeile 1135 | Zeile 1145 |
---|
* @return array Array of supported character sets with array key being the name, array value being display name. False if unsupported */ function fetch_db_charsets()
|
* @return array Array of supported character sets with array key being the name, array value being display name. False if unsupported */ function fetch_db_charsets()
|
{ return false;
| { return false;
|
}
/**
| }
/**
|
Zeile 1189 | Zeile 1199 |
---|
} }
|
} }
|
if(!class_exists('databaseEngine')) { class databaseEngine extends DB_SQLite3 { } }
| |
?>
| ?>
|