mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 07:06:30 +02:00
Upgrade routine now separates non-core plugin sql changes into their own area.
This commit is contained in:
@@ -216,6 +216,9 @@ class e107Update
|
|||||||
function updatePlugin($path)
|
function updatePlugin($path)
|
||||||
{
|
{
|
||||||
e107::getPlugin()->install_plugin_xml($path, 'upgrade');
|
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())
|
if($plugUpgradeReq = e107::getPlugin()->updateRequired())
|
||||||
{
|
{
|
||||||
$exclude = array_keys($plugUpgradeReq); // search xxxxx_setup.php and check for 'upgrade_required()' == true.
|
$exclude = array_keys($plugUpgradeReq); // search xxxxx_setup.php and check for 'upgrade_required()' == true.
|
||||||
|
asort($exclude);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -90,7 +90,7 @@ class db_verify
|
|||||||
*/
|
*/
|
||||||
function verify()
|
function verify()
|
||||||
{
|
{
|
||||||
|
print_a($_POST);
|
||||||
if(vartrue($_POST['verify_table']))
|
if(vartrue($_POST['verify_table']))
|
||||||
{
|
{
|
||||||
$this->runComparison($_POST['verify_table']);
|
$this->runComparison($_POST['verify_table']);
|
||||||
@@ -112,7 +112,7 @@ class db_verify
|
|||||||
|
|
||||||
function runComparison($fileArray)
|
function runComparison($fileArray)
|
||||||
{
|
{
|
||||||
|
|
||||||
$ns = e107::getRender();
|
$ns = e107::getRender();
|
||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
@@ -366,6 +366,15 @@ class db_verify
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the number of errors
|
||||||
|
*/
|
||||||
|
public function errors()
|
||||||
|
{
|
||||||
|
return count($this->errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function renderResults()
|
function renderResults()
|
||||||
|
@@ -217,13 +217,29 @@ class e107plugin
|
|||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_once(e_HANDLER."db_verify_class.php");
|
||||||
|
$dbv = new db_verify;
|
||||||
|
|
||||||
|
|
||||||
foreach($plugVersions as $path=>$version)
|
foreach($plugVersions as $path=>$version)
|
||||||
{
|
{
|
||||||
$fullPath = e_PLUGIN.$path."/plugin.xml";
|
$fullPath = e_PLUGIN.$path."/plugin.xml";
|
||||||
if(is_file(e_PLUGIN.$path."/plugin.xml"))
|
if(is_file(e_PLUGIN.$path."/plugin.xml"))
|
||||||
{
|
{
|
||||||
$data = $xml->loadXMLfile($fullPath, true);
|
$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);
|
$curVal = floatval($version);
|
||||||
$fileVal = floatval($data['@attributes']['version']);
|
$fileVal = floatval($data['@attributes']['version']);
|
||||||
|
|
||||||
@@ -1347,8 +1363,12 @@ class e107plugin
|
|||||||
$error = array(); // Array of error messages
|
$error = array(); // Array of error messages
|
||||||
$canContinue = TRUE; // Clear flag if must abort part way through
|
$canContinue = TRUE; // Clear flag if must abort part way through
|
||||||
|
|
||||||
|
if(is_string($id)) // Plugin Path.
|
||||||
if(is_array($id))
|
{
|
||||||
|
$id = $this->getId($id);
|
||||||
|
$plug = $this->getinfo($id); // Get plugin info from DB
|
||||||
|
}
|
||||||
|
elseif(is_array($id))
|
||||||
{
|
{
|
||||||
$plug = $id;
|
$plug = $id;
|
||||||
$id = $plug['plugin_id'];
|
$id = $plug['plugin_id'];
|
||||||
@@ -1358,7 +1378,7 @@ class e107plugin
|
|||||||
$id = (int) $id;
|
$id = (int) $id;
|
||||||
$plug = $this->getinfo($id); // Get plugin info from DB
|
$plug = $this->getinfo($id); // Get plugin info from DB
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->current_plug = $plug;
|
$this->current_plug = $plug;
|
||||||
|
|
||||||
$txt = '';
|
$txt = '';
|
||||||
@@ -1407,6 +1427,7 @@ class e107plugin
|
|||||||
|
|
||||||
if (!$canContinue)
|
if (!$canContinue)
|
||||||
{
|
{
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1447,6 +1468,7 @@ class e107plugin
|
|||||||
$mes->add($txt, $status);
|
$mes->add($txt, $status);
|
||||||
break;
|
break;
|
||||||
case 'upgrade':
|
case 'upgrade':
|
||||||
|
|
||||||
$tmp = $dbHandler->update_table_structure($ct, FALSE, TRUE, $pref['multilanguage']);
|
$tmp = $dbHandler->update_table_structure($ct, FALSE, TRUE, $pref['multilanguage']);
|
||||||
if ($tmp === FALSE)
|
if ($tmp === FALSE)
|
||||||
{
|
{
|
||||||
@@ -1456,6 +1478,9 @@ class e107plugin
|
|||||||
{
|
{
|
||||||
$error[] = $tmp;
|
$error[] = $tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'refresh': // Leave things alone
|
case 'refresh': // Leave things alone
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user