aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggPluginManifest.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-06 15:23:01 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-06 15:23:01 +0000
commit4b2684e36e226315c5bd4b93f49ab2a5fc121303 (patch)
treef9927c38da56d274dcf732fda2df05896d0749e5 /engine/classes/ElggPluginManifest.php
parent28bb5ab4b12170f7831d584c809e202e07b55a19 (diff)
downloadelgg-4b2684e36e226315c5bd4b93f49ab2a5fc121303.tar.gz
elgg-4b2684e36e226315c5bd4b93f49ab2a5fc121303.tar.bz2
Renamed 'elgg' manifest requirment to 'elgg_version' to be more in line with the current options. Removed assignments in if statements. 1.7 manifest files properly show elgg_version as a requirement.
git-svn-id: http://code.elgg.org/elgg/trunk@7550 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggPluginManifest.php')
-rw-r--r--engine/classes/ElggPluginManifest.php40
1 files changed, 33 insertions, 7 deletions
diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php
index ccd0d984a..01dcd1046 100644
--- a/engine/classes/ElggPluginManifest.php
+++ b/engine/classes/ElggPluginManifest.php
@@ -234,7 +234,9 @@ class ElggPluginManifest {
* @return string
*/
public function getBlurb() {
- if (!$blurb = elgg_echo($this->parser->getAttribute('blurb'))) {
+ $blurb = elgg_echo($this->parser->getAttribute('blurb'));
+
+ if (!$blurb) {
$blurb = elgg_get_excerpt($this->getDescription());
}
@@ -293,7 +295,9 @@ class ElggPluginManifest {
* @return array
*/
public function getCategories() {
- if (!$cats = $this->parser->getAttribute('category')) {
+ $cats = $this->parser->getAttribute('category');
+
+ if (!$cats) {
$cats = array();
}
@@ -306,7 +310,9 @@ class ElggPluginManifest {
* @return array
*/
public function getScreenshots() {
- if (!$ss = $this->parser->getAttribute('screenshot')) {
+ $ss = $this->parser->getAttribute('screenshot');
+
+ if (!$ss) {
$ss = array();
}
@@ -324,7 +330,9 @@ class ElggPluginManifest {
* @return array
*/
public function getProvides() {
- if (!$provides = $this->parser->getAttribute('provides')) {
+ $provides = $this->parser->getAttribute('provides');
+
+ if (!$provides) {
$provides = array();
}
@@ -351,7 +359,23 @@ class ElggPluginManifest {
* @return array
*/
public function getRequires() {
- if (!$reqs = $this->parser->getAttribute('requires')) {
+ // 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 = $this->parser->getAttribute('requires');
+ }
+
+ if (!$reqs) {
$reqs = array();
}
@@ -359,7 +383,7 @@ class ElggPluginManifest {
foreach ($reqs as $req) {
switch ($req['type']) {
- case 'elgg':
+ case 'elgg_version':
case 'elgg_release':
$struct = $this->_depsRequiresStructElgg;
break;
@@ -441,7 +465,9 @@ class ElggPluginManifest {
* @return array
*/
public function getConflicts() {
- if (!$conflicts = $this->parser->getAttribute('conflicts')) {
+ $conflicts = $this->parser->getAttribute('conflicts');
+
+ if (!$conflicts) {
$conflicts = array();
}