aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggPluginPackage.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-02 23:00:23 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-02 23:00:23 +0000
commitfc21edb0785f2cac11dc592278fad97fffeeb082 (patch)
tree24047873840c5931766abaa5b15a73c0692e7565 /engine/classes/ElggPluginPackage.php
parenta826bea54e8934c19b2ada619d966cc7d9628b42 (diff)
downloadelgg-fc21edb0785f2cac11dc592278fad97fffeeb082.tar.gz
elgg-fc21edb0785f2cac11dc592278fad97fffeeb082.tar.bz2
Fixes #1986, #2170, #2225, #2759. Integrated ElggPluginPackage and ElggPluginManifest with ElggPlugin. System now uses ElggPlugin objects to determin plugins. Order is stored in private settings. This absolutely requires running upgrade.php.
git-svn-id: http://code.elgg.org/elgg/trunk@7817 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggPluginPackage.php')
-rw-r--r--engine/classes/ElggPluginPackage.php25
1 files changed, 11 insertions, 14 deletions
diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php
index 8bbacce22..6301ad1f2 100644
--- a/engine/classes/ElggPluginPackage.php
+++ b/engine/classes/ElggPluginPackage.php
@@ -239,16 +239,6 @@ class ElggPluginPackage {
return true;
}
- /**
- * Checks if this plugin can be activated on the current
- * Elgg installation.
- *
- * @return bool
- */
- public function canActivate() {
- return $this->checkDependencies();
- }
-
/************
* Manifest *
@@ -261,7 +251,9 @@ class ElggPluginPackage {
*/
public function getManifest() {
if (!$this->manifest) {
- $this->loadManifest();
+ if (!$this->loadManifest()) {
+ return false;
+ }
}
return $this->manifest;
@@ -275,9 +267,14 @@ class ElggPluginPackage {
*/
private function loadManifest() {
$file = $this->path . 'manifest.xml';
- $this->manifest = new ElggPluginManifest($file, $this->id);
- if ($this->manifest) {
+ try {
+ $this->manifest = new ElggPluginManifest($file, $this->id);
+ } catch (Exception $e) {
+ return false;
+ }
+
+ if ($this->manifest instanceof ElggPluginManifest) {
return true;
}
@@ -307,7 +304,7 @@ class ElggPluginPackage {
public function checkDependencies($full_report = false) {
$requires = $this->getManifest()->getRequires();
$conflicts = $this->getManifest()->getConflicts();
- $enabled_plugins = get_installed_plugins('enabled');
+ $enabled_plugins = elgg_get_plugins('active');
$report = array();
foreach (array('requires', 'conflicts') as $dep_type) {