$this->manifest = $this->package->getManifest();
} catch (Exception $e) {
// we always have to allow the entity to load.
+ elgg_log("Failed to load $this->guid as a plugin. " . $e->getMessage(), 'WARNING');
}
}
* @return array
*/
public function getProvides() {
- $provides = $this->parser->getAttribute('provides');
+ // normalize for 1.7
+ if ($this->getApiVersion() < 1.8) {
+ $provides = array();
+ } else {
+ $provides = $this->parser->getAttribute('provides');
+ }
if (!$provides) {
$provides = array();
'comparison' => 'ge'
)
);
+ } else {
+ $reqs = array();
}
} else {
$reqs = $this->parser->getAttribute('requires');
* @return array
*/
public function getConflicts() {
- $conflicts = $this->parser->getAttribute('conflicts');
+ // normalize for 1.7
+ if ($this->getApiVersion() < 1.8) {
+ $conflicts = array();
+ } else {
+ $conflicts = $this->parser->getAttribute('conflicts');
+ }
if (!$conflicts) {
$conflicts = array();
if ($plugin->enabled != 'yes') {
$plugin->enable();
$plugin->deactivate();
+ $plugin->setPriority($new_plugin_priority);
+
+ $new_plugin_priority++;
}
// remove from the list of plugins to disable
// because they are entities, but their dirs were removed.
// don't delete the entities because they hold settings.
foreach ($known_plugins as $plugin) {
- $plugin->deactivate();
- $plugin->disable();
+ if ($plugin->isActive()) {
+ $plugin->deactivate();
+ // remove the priority.
+ $name = elgg_namespace_plugin_private_setting('internal', 'priority');
+ remove_private_setting($plugin->guid, $name);
+ $plugin->disable();
+ }
}
access_show_hidden_entities($old_access);