Skip to content

Commit

Permalink
Merge pull request #7904 from jdalsem/drop-elgg-version-in-manifest
Browse files Browse the repository at this point in the history
chore(engine): drop support for elgg_version in manifests
  • Loading branch information
jdalsem committed Feb 17, 2015
2 parents 0725f0b + 7a79a50 commit 8f1d8f0
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 227 deletions.
36 changes: 13 additions & 23 deletions docs/guides/plugins/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,10 @@ Requires

Using a ``requires`` dependency means that the plugin cannot be enabled unless the dependency is exactly met.

Mandatory requires: elgg_version and elgg_release
Mandatory requires: elgg_release
-------------------------------------------------

Every plugin must have at least one requires: the version of Elgg the plugin is developed for. This is specified either by the Elgg API ``version`` (2011010401) or the ``release`` (1.8). The default comparison ``>=``, but you can specify your own by passing the ``<comparison>`` element.

Using elgg_version:

.. code:: xml
<requires>
<type>elgg_version</type>
<version>2011010401</version>
</requires>
Every plugin must have at least one requires: the version of Elgg the plugin is developed for. This is specified by the Elgg API ``release`` (1.8). The default comparison ``>=``, but you can specify your own by passing the ``<comparison>`` element.

Using elgg_release:

Expand Down Expand Up @@ -104,13 +95,13 @@ Conflict with any version of the profile plugin:
<name>profile</name>
</conflicts>
Conflict with a specific version of Elgg:
Conflict with a specific release of Elgg:

.. code:: xml
<conflicts>
<type>elgg_version</type>
<version>2010112301</version>
<type>elgg_release</type>
<version>1.8</version>
<comparison>==</comparison>
</conflicts>
Expand Down Expand Up @@ -138,12 +129,11 @@ Types

Every dependency verb has a mandatory ``<type>`` element that must be one of the following six values:

1. **elgg_version** - The API version of Elgg (2011010401)
2. **elgg_release** - The release version of Elgg (1.8)
3. **plugin** - An Elgg plugin
4. **priority** - A plugin load priority
5. **php_extension** - A PHP extension
6. **php_ini** - A PHP setting
1. **elgg_release** - The release version of Elgg (1.8)
2. **plugin** - An Elgg plugin
3. **priority** - A plugin load priority
4. **php_extension** - A PHP extension
5. **php_ini** - A PHP setting

.. note::

Expand All @@ -159,8 +149,8 @@ Every type is defined with a dependency verb as the parent element. Additional o
<option_2>value_2</option_2>
</verb>
elgg_version and elgg_release
-----------------------------
elgg_release
------------

These concern the API and release versions of Elgg and requires the following option element:

Expand Down Expand Up @@ -234,7 +224,7 @@ The follow are valid comparison operators:

If ``<comparison>`` is not passed, the follow are used as defaults, depending upon the dependency type:

- requires->elgg_version and elgg_release: >=
- requires->elgg_release: >=
- requires->plugin: >=
- requires->php_extension: =
- requires->php_ini: =
Expand Down
5 changes: 0 additions & 5 deletions docs/info/manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
<copyright>(C) Elgg 2011</copyright>
<license>GNU General Public License version 2</license>

<requires>
<type>elgg_version</type>
<version>2009030802</version>
</requires>

<requires>
<type>elgg_release</type>
<version>1.8</version>
Expand Down
1 change: 0 additions & 1 deletion engine/classes/Elgg/Database/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,6 @@ function getDependencyStrings($dep) {
$strings['type'] = $translator->translate('ElggPlugin:Dependencies:' . ucwords($dep_system));

switch ($type) {
case 'elgg_version':
case 'elgg_release':
// 'Elgg Version'
$strings['name'] = $translator->translate('ElggPlugin:Dependencies:Elgg');
Expand Down
23 changes: 3 additions & 20 deletions engine/classes/ElggPluginManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ElggPluginManifest {
);

/*
* The expected structure of elgg_version and elgg_release requires element
* The expected structure of elgg_release requires element
*/
private $depsStructElgg = array(
'type' => '',
Expand Down Expand Up @@ -484,24 +484,8 @@ public function getProvides() {
* @return array
*/
public function getRequires() {
// rewrite the 1.7 style elgg_version as a real requires.
if ($this->apiVersion < 1.8) {
$elgg_version = $this->parser->getAttribute('elgg_version');
if ($elgg_version) {
$reqs = array(
array(
'type' => 'elgg_version',
'version' => $elgg_version,
'comparison' => 'ge'
)
);
} else {
$reqs = array();
}
} else {
$reqs = $this->parser->getAttribute('requires');
}

$reqs = $this->parser->getAttribute('requires');

if (!$reqs) {
$reqs = array();
}
Expand Down Expand Up @@ -543,7 +527,6 @@ public function getSuggests() {
*/
private function normalizeDep($dep) {
switch ($dep['type']) {
case 'elgg_version':
case 'elgg_release':
$struct = $this->depsStructElgg;
break;
Expand Down
82 changes: 0 additions & 82 deletions engine/classes/ElggPluginManifestParser17.php

This file was deleted.

7 changes: 1 addition & 6 deletions engine/classes/ElggPluginPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ElggPluginPackage {
* @var array
*/
private $depsSupportedTypes = array(
'elgg_version', 'elgg_release', 'php_version', 'php_extension', 'php_ini', 'plugin', 'priority',
'elgg_release', 'php_version', 'php_extension', 'php_ini', 'plugin', 'priority',
);

/**
Expand Down Expand Up @@ -403,11 +403,6 @@ public function checkDependencies($full_report = false) {

foreach (${$dep_type} as $dep) {
switch ($dep['type']) {
case 'elgg_version':
elgg_deprecated_notice("elgg_version in manifest.xml files is deprecated. Use elgg_release", 1.9);
$result = $this->checkDepElgg($dep, elgg_get_version(), $inverse);
break;

case 'elgg_release':
$result = $this->checkDepElgg($dep, elgg_get_version(true), $inverse);
break;
Expand Down

0 comments on commit 8f1d8f0

Please sign in to comment.