1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

Update routine improvements. Check for plugin xxxx_setup.php during db-verify

This commit is contained in:
Cameron
2013-03-10 18:42:54 -07:00
parent 823e813a5e
commit 6f8481e528
3 changed files with 18 additions and 8 deletions

View File

@@ -957,7 +957,9 @@ function update_706_to_800($type='')
require_once(e_HANDLER."db_verify_class.php"); require_once(e_HANDLER."db_verify_class.php");
$dbv = new db_verify; $dbv = new db_verify;
$dbv->compareAll(); // core & plugins $exclude = array_keys(e107::getPlugin()->updateRequired()); // search xxxxx_setup.php and check for 'upgrade_required()' == true.
$dbv->compareAll($exclude); // core & plugins, but not plugins calling for an update with xxxxx_setup.php
if(count($dbv->errors)) if(count($dbv->errors))
{ {
@@ -968,17 +970,18 @@ function update_706_to_800($type='')
return update_needed("Database Tables require updating."); return update_needed("Database Tables require updating.");
} }
$dbv->compileResults();
$dbv->runFix(); // Fix entire core database structure and plugins too.
} }
$dbv->compileResults();
// print_a($dbv->results); // print_a($dbv->results);
// print_a($dbv->fixList); // print_a($dbv->fixList);
$dbv->runFix(); // Fix entire core database structure.
//TODO - send notification messages to Log. //TODO - send notification messages to Log.
if($sql->gen("SELECT * FROM #page WHERE page_theme != '' AND menu_title = '' LIMIT 1")) if($sql->field('page','page_theme') && $sql->gen("SELECT * FROM #page WHERE page_theme != '' AND menu_title = '' LIMIT 1"))
{ {
if ($just_check) if ($just_check)
{ {

View File

@@ -155,9 +155,15 @@ class db_verify
/** /**
* Check core tables and installed plugin tables * Check core tables and installed plugin tables
* @param $exclude - array of plugins to exclude.
*/ */
function compareAll() function compareAll($exclude = array())
{ {
foreach($exclude as $val)
{
unset($this->tables[$val]);
}
$dtables = array_keys($this->tables); $dtables = array_keys($this->tables);
foreach($dtables as $tb) foreach($dtables as $tb)
@@ -178,6 +184,7 @@ class db_verify
function compare($selection,$language='') function compare($selection,$language='')
{ {
@@ -225,7 +232,7 @@ class db_verify
if(isset($debugA) && (e_PAGE == 'db.php')) if(isset($debugA) && (e_PAGE == 'db.php'))
{ {
$debug = "<table border='1'> $debug = "<table class='table' border='1'>
<tr><td style='padding:5px;font-weight:bold'>FILE: ".$tbl." (key=".$key.")</td> <tr><td style='padding:5px;font-weight:bold'>FILE: ".$tbl." (key=".$key.")</td>
<td style='padding:5px;font-weight:bold'>SQL: ".$tbl."</td> <td style='padding:5px;font-weight:bold'>SQL: ".$tbl."</td>
</tr> </tr>