aboutsummaryrefslogtreecommitdiff
path: root/engine/classes
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-05 19:53:33 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-05 19:53:33 +0000
commit6eb504bde19818be812e6ba78c6c56a501405fec (patch)
tree39c3b2f65d3f77cd5272a822b9a61ba717d645a9 /engine/classes
parente4689067e1c27cfc1ac7dbdcf8d3ab835eec0971 (diff)
downloadelgg-6eb504bde19818be812e6ba78c6c56a501405fec.tar.gz
elgg-6eb504bde19818be812e6ba78c6c56a501405fec.tar.bz2
Fixes #2852: Checking other plugins' conflicts to see if plugin is able to be activated in ElggPluginPackage->checkDependencies(). Some language clarification in admin panel.
git-svn-id: http://code.elgg.org/elgg/trunk@8034 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes')
-rw-r--r--engine/classes/ElggPluginPackage.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php
index 84cb8c1db..48a5fc4a8 100644
--- a/engine/classes/ElggPluginPackage.php
+++ b/engine/classes/ElggPluginPackage.php
@@ -313,8 +313,33 @@ class ElggPluginPackage {
$requires = $this->getManifest()->getRequires();
$conflicts = $this->getManifest()->getConflicts();
$enabled_plugins = elgg_get_plugins('active');
+ $this_id = $this->getID();
$report = array();
+ // first, check if any active plugin conflicts with us.
+ foreach ($enabled_plugins as $plugin) {
+ $temp_conflicts = $plugin->manifest->getConflicts();
+ foreach ($temp_conflicts as $conflict) {
+ if ($conflict['type'] == 'plugin' && $conflict['name'] == $this_id) {
+ $result = $this->checkDepPlugin($conflict, $enabled_plugins, false);
+
+ // rewrite the conflict to show the originating plugin
+ $conflict['name'] = $plugin->manifest->getName();
+
+ if (!$full_report && !$result['status']) {
+ return $result['status'];
+ } else {
+ $report[] = array(
+ 'type' => 'conflicted',
+ 'dep' => $conflict,
+ 'status' => $result['status'],
+ 'value' => $this->getManifest()->getVersion()
+ );
+ }
+ }
+ }
+ }
+
foreach (array('requires', 'conflicts') as $dep_type) {
$inverse = ($dep_type == 'conflicts') ? true : false;