1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 01:25:01 +02:00

MySQL: Refactored 'db_Table_exists' to 'isTable' method. (BC compatible) and removed use of pref global.

This commit is contained in:
Cameron
2015-07-07 13:02:34 -07:00
parent a27dc90ca7
commit 483d43a829
6 changed files with 46 additions and 23 deletions

View File

@@ -901,7 +901,7 @@ function update_706_to_800($type='')
// Next bit will be needed only by the brave souls who used an early CVS - probably delete before release
if ($sql->db_Table_exists('rl_history') && !$sql->db_Table_exists('dblog'))
if ($sql->isTable('rl_history') && !$sql->isTable('dblog'))
{
if ($just_check) return update_needed('Rename rl_history to dblog');
$sql->gen('ALTER TABLE `'.MPREFIX.'rl_history` RENAME `'.MPREFIX.'dblog`');
@@ -913,7 +913,7 @@ function update_706_to_800($type='')
//---------------------------------
if ($sql->db_Table_exists('dblog') && !$sql->db_Table_exists('admin_log'))
if ($sql->isTable('dblog') && !$sql->isTable('admin_log'))
{
if ($just_check) return update_needed('Rename dblog to admin_log');
$sql->gen('ALTER TABLE `'.MPREFIX.'dblog` RENAME `'.MPREFIX.'admin_log`');
@@ -929,7 +929,7 @@ function update_706_to_800($type='')
/*
foreach ($new_tables as $nt)
{
if (!$sql->db_Table_exists($nt))
if (!$sql->isTable($nt))
{
if ($just_check) return update_needed('Add table: '.$nt);
// Get the definition
@@ -1074,7 +1074,7 @@ function update_706_to_800($type='')
$sql->mySQLtableList = false; // clear the cached table list.
foreach ($obs_tables as $ot)
{
if ($sql->db_Table_exists($ot))
if ($sql->isTable($ot))
{
if ($just_check) return update_needed("Delete table: ".$ot);
@@ -1088,7 +1088,7 @@ function update_706_to_800($type='')
// Set to varchar(45) - just in case something uses the IPV4 subnet (see http://en.wikipedia.org/wiki/IPV6#Notation)
foreach ($ip_upgrade as $t => $f)
{
if ($sql->db_Table_exists($t))
if ($sql->isTable($t))
{ // Check for table - might add some core plugin tables in here
if ($field_info = ($sql->db_Field($t, $f, '', TRUE)))
{
@@ -1876,7 +1876,7 @@ function update_needed($message='')
function addIndexToTable($target, $indexSpec, $just_check, &$updateMessages, $optionalTable=FALSE)
{
global $sql;
if (!$sql->db_Table_exists($target))
if (!$sql->isTable($target))
{
if ($optionalTable)
{