mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-04 21:44:57 +02:00
forgot to actually commit it :P
git-svn-id: file:///svn/phpbb/trunk@7016 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
59fdd2edca
commit
4805ae6542
@ -161,107 +161,18 @@ class acp_database
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$tables = array();
|
include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
|
||||||
switch ($db->sql_layer)
|
$tables = get_tables($db);
|
||||||
|
foreach ($tables as $table_name)
|
||||||
{
|
{
|
||||||
case 'sqlite':
|
if (strlen($table_prefix) === 0 || strpos($table_name, $table_prefix) === 0)
|
||||||
$sql = "SELECT name
|
{
|
||||||
FROM sqlite_master
|
$template->assign_block_vars('tables', array(
|
||||||
WHERE type='table'
|
'TABLE' => $table_name
|
||||||
ORDER BY name";
|
));
|
||||||
$result = $db->sql_query($sql);
|
}
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
if (strlen($table_prefix) == 0 || strpos($row['name'], $table_prefix) === 0)
|
|
||||||
{
|
|
||||||
$tables[] = $row['name'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'mysqli':
|
|
||||||
case 'mysql4':
|
|
||||||
case 'mysql':
|
|
||||||
$sql = "SHOW TABLES
|
|
||||||
LIKE '{$table_prefix}%'";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$tables[] = current($row);
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'postgres':
|
|
||||||
$sql = 'SELECT relname
|
|
||||||
FROM pg_stat_user_tables
|
|
||||||
ORDER BY relname';
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
if (strlen($table_prefix) == 0 || strpos($row['relname'], $table_prefix) === 0)
|
|
||||||
{
|
|
||||||
$tables[] = $row['relname'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'mssql':
|
|
||||||
case 'mssql_odbc':
|
|
||||||
$sql = "SELECT TABLE_NAME
|
|
||||||
FROM INFORMATION_SCHEMA.TABLES
|
|
||||||
WHERE TABLE_TYPE = 'BASE TABLE'
|
|
||||||
ORDER BY TABLE_NAME";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
if (strlen($table_prefix) == 0 || strpos($row['TABLE_NAME'], $table_prefix) === 0)
|
|
||||||
{
|
|
||||||
$tables[] = $row['TABLE_NAME'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'firebird':
|
|
||||||
$sql = 'SELECT RDB$RELATION_NAME as TABLE_NAME
|
|
||||||
FROM RDB$RELATIONS
|
|
||||||
WHERE RDB$SYSTEM_FLAG=0
|
|
||||||
AND RDB$VIEW_BLR IS NULL';
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
if (strlen($table_prefix) == 0 || stripos($row['table_name'], $table_prefix) === 0)
|
|
||||||
{
|
|
||||||
$tables[] = $row['table_name'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'oracle':
|
|
||||||
$sql = 'SELECT TNAME as table_name
|
|
||||||
FROM TAB';
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
if (strlen($table_prefix) == 0 || stripos($row['table_name'], $table_prefix) === 0)
|
|
||||||
{
|
|
||||||
$tables[] = $row['table_name'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($tables as $table)
|
|
||||||
{
|
|
||||||
$template->assign_block_vars('tables', array(
|
|
||||||
'TABLE' => $table
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
unset($tables);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_ACTION' => $this->u_action . '&action=download'
|
'U_ACTION' => $this->u_action . '&action=download'
|
||||||
@ -398,7 +309,7 @@ class acp_database
|
|||||||
$delim = ";\n";
|
$delim = ";\n";
|
||||||
while (($sql = $fgetd($fp, $delim, $read, $seek, $eof)) !== false)
|
while (($sql = $fgetd($fp, $delim, $read, $seek, $eof)) !== false)
|
||||||
{
|
{
|
||||||
$query = trim($fgetd($fp, $delim, $read, $seek, $eof));
|
$query = trim($sql);
|
||||||
if (substr($query, 0, 8) === 'SET TERM')
|
if (substr($query, 0, 8) === 'SET TERM')
|
||||||
{
|
{
|
||||||
$delim = $query[9] . "\n";
|
$delim = $query[9] . "\n";
|
||||||
@ -417,6 +328,10 @@ class acp_database
|
|||||||
{
|
{
|
||||||
while (($sub = $fgetd($fp, "\n", $read, $seek, $eof)) !== '\.')
|
while (($sub = $fgetd($fp, "\n", $read, $seek, $eof)) !== '\.')
|
||||||
{
|
{
|
||||||
|
if ($sub === false)
|
||||||
|
{
|
||||||
|
trigger_error($user->lang['RESTORE_FAILURE'] . adm_back_link($this->u_action));
|
||||||
|
}
|
||||||
pg_put_line($db->db_connect_id, $sub . "\n");
|
pg_put_line($db->db_connect_id, $sub . "\n");
|
||||||
}
|
}
|
||||||
pg_put_line($db->db_connect_id, "\\.\n");
|
pg_put_line($db->db_connect_id, "\\.\n");
|
||||||
@ -612,7 +527,7 @@ class base_extractor
|
|||||||
|
|
||||||
if ($this->download === true)
|
if ($this->download === true)
|
||||||
{
|
{
|
||||||
if ($this->format === 'bzip2' || ($this->format === 'gzip' && !$this->run_comp))
|
if ($this->format === 'bzip2' || $this->format === 'text' || ($this->format === 'gzip' && !$this->run_comp))
|
||||||
{
|
{
|
||||||
echo $data;
|
echo $data;
|
||||||
}
|
}
|
||||||
@ -1367,6 +1282,7 @@ class mssql_extractor extends base_extractor
|
|||||||
function write_end()
|
function write_end()
|
||||||
{
|
{
|
||||||
$this->flush("COMMIT\nGO\n");
|
$this->flush("COMMIT\nGO\n");
|
||||||
|
parent::write_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
function write_start($prefix)
|
function write_start($prefix)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user