mirror of
https://github.com/e107inc/e107.git
synced 2025-05-04 11:24:54 +02:00
This commit is contained in:
parent
87783549b8
commit
fbfdedceb9
@ -394,6 +394,9 @@ class e_plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the currently loaded plugin is installed
|
* Check if the currently loaded plugin is installed
|
||||||
* @return mixed
|
* @return mixed
|
||||||
@ -509,6 +512,9 @@ class e_plugin
|
|||||||
$cfg = e107::getConfig();
|
$cfg = e107::getConfig();
|
||||||
|
|
||||||
$pref = $cfg->get('plug_installed');
|
$pref = $cfg->get('plug_installed');
|
||||||
|
$detected = $this->getDetected();
|
||||||
|
|
||||||
|
$toRemove = array();
|
||||||
|
|
||||||
$save = false;
|
$save = false;
|
||||||
if ($rows = $sql->retrieve("plugin", "*", "plugin_id != '' ORDER by plugin_path ", true))
|
if ($rows = $sql->retrieve("plugin", "*", "plugin_id != '' ORDER by plugin_path ", true))
|
||||||
@ -516,7 +522,16 @@ class e_plugin
|
|||||||
|
|
||||||
foreach($rows as $row)
|
foreach($rows as $row)
|
||||||
{
|
{
|
||||||
|
|
||||||
$path = $row['plugin_path'];
|
$path = $row['plugin_path'];
|
||||||
|
|
||||||
|
if(!in_array($path,$detected))
|
||||||
|
{
|
||||||
|
$toRemove[] = (int) $row['plugin_id'];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->_ids[$path] = (int) $row['plugin_id'];
|
$this->_ids[$path] = (int) $row['plugin_id'];
|
||||||
|
|
||||||
if(!empty($row['plugin_installflag']) )
|
if(!empty($row['plugin_installflag']) )
|
||||||
@ -540,9 +555,21 @@ class e_plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$detected = $this->getDetected();
|
|
||||||
$runUpdate = false;
|
$runUpdate = false;
|
||||||
|
|
||||||
|
if(!empty($toRemove))
|
||||||
|
{
|
||||||
|
$runUpdate = true;
|
||||||
|
$delList = implode(",", $toRemove);
|
||||||
|
|
||||||
|
if($sql->delete('plugin', "plugin_id IN (".$delList.")"))
|
||||||
|
{
|
||||||
|
e107::getDebug()->log("Deleted missing plugins with id(s): ".$delList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach($detected as $path) // add a missing plugin to the database table.
|
foreach($detected as $path) // add a missing plugin to the database table.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user