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

Upgrade routine now separates non-core plugin sql changes into their own area.

This commit is contained in:
Cameron
2015-01-27 13:00:33 -08:00
parent 666ea246c2
commit a35f7ef171
3 changed files with 44 additions and 6 deletions

View File

@@ -216,6 +216,9 @@ class e107Update
function updatePlugin($path)
{
e107::getPlugin()->install_plugin_xml($path, 'upgrade');
e107::getMessage()->reset(E_MESSAGE_INFO);
e107::getMessage()->addSuccess(LAN_UPDATED." : ".$path);
}
@@ -1136,6 +1139,7 @@ function update_706_to_800($type='')
if($plugUpgradeReq = e107::getPlugin()->updateRequired())
{
$exclude = array_keys($plugUpgradeReq); // search xxxxx_setup.php and check for 'upgrade_required()' == true.
asort($exclude);
}
else
{

View File

@@ -90,7 +90,7 @@ class db_verify
*/
function verify()
{
print_a($_POST);
if(vartrue($_POST['verify_table']))
{
$this->runComparison($_POST['verify_table']);
@@ -112,7 +112,7 @@ class db_verify
function runComparison($fileArray)
{
$ns = e107::getRender();
$mes = e107::getMessage();
$frm = e107::getForm();
@@ -366,6 +366,15 @@ class db_verify
}
}
/**
* Returns the number of errors
*/
public function errors()
{
return count($this->errors);
}
function renderResults()

View File

@@ -217,13 +217,29 @@ class e107plugin
{
return FALSE;
}
require_once(e_HANDLER."db_verify_class.php");
$dbv = new db_verify;
foreach($plugVersions as $path=>$version)
{
$fullPath = e_PLUGIN.$path."/plugin.xml";
if(is_file(e_PLUGIN.$path."/plugin.xml"))
{
{
$data = $xml->loadXMLfile($fullPath, true);
if(!in_array($path, $this->core_plugins)) // check non-core plugins for sql file changes.
{
$dbv->errors = array();
$dbv->compare($path);
if($dbv->errors())
{
$needed[$path] = $data;
}
}
$curVal = floatval($version);
$fileVal = floatval($data['@attributes']['version']);
@@ -1347,8 +1363,12 @@ class e107plugin
$error = array(); // Array of error messages
$canContinue = TRUE; // Clear flag if must abort part way through
if(is_array($id))
if(is_string($id)) // Plugin Path.
{
$id = $this->getId($id);
$plug = $this->getinfo($id); // Get plugin info from DB
}
elseif(is_array($id))
{
$plug = $id;
$id = $plug['plugin_id'];
@@ -1358,7 +1378,7 @@ class e107plugin
$id = (int) $id;
$plug = $this->getinfo($id); // Get plugin info from DB
}
$this->current_plug = $plug;
$txt = '';
@@ -1407,6 +1427,7 @@ class e107plugin
if (!$canContinue)
{
return FALSE;
}
@@ -1447,6 +1468,7 @@ class e107plugin
$mes->add($txt, $status);
break;
case 'upgrade':
$tmp = $dbHandler->update_table_structure($ct, FALSE, TRUE, $pref['multilanguage']);
if ($tmp === FALSE)
{
@@ -1456,6 +1478,9 @@ class e107plugin
{
$error[] = $tmp;
}
break;
case 'refresh': // Leave things alone
break;