diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-12 19:57:39 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-12 19:57:39 +0000 |
commit | 896a57156e01406bbf3bb8ee2b4c84a9cad8d10c (patch) | |
tree | 183b3f15307de98d72431ebde75926c1b6318117 /engine | |
parent | 606b7b6a101bf109817567b1a2b0a7e831768766 (diff) | |
download | elgg-896a57156e01406bbf3bb8ee2b4c84a9cad8d10c.tar.gz elgg-896a57156e01406bbf3bb8ee2b4c84a9cad8d10c.tar.bz2 |
Refs #2898: Using an XML namespace instead of version attribute on plugin manifests.
git-svn-id: http://code.elgg.org/elgg/trunk@8170 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r-- | engine/classes/ElggPluginManifest.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index fcd0094c4..e230cd3f2 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -8,8 +8,8 @@ * as $this->parser. * * To add new parser versions, name them ElggPluginManifestParserXX - * where XX is the version specified in the top-level <plugin-manifest> - * tag. + * where XX is the version specified in the top-level <plugin_manifest> + * tag's XML namespace. * * @package Elgg.Core * @subpackage Plugins @@ -23,6 +23,12 @@ class ElggPluginManifest { protected $parser; /** + * The root for plugin manifest namespaces. + * This is in the format http://www.elgg.org/plugin_manifest/<version> + */ + protected $namespace_root = 'http://www.elgg.org/plugin_manifest/'; + + /** * The expected structure of a plugins requires element */ private $depsStructPlugin = array( @@ -144,12 +150,15 @@ class ElggPluginManifest { } // set manifest api version - if (isset($manifest_obj->attributes['version'])) { - $this->apiVersion = (float)$manifest_obj->attributes['version']; + if (isset($manifest_obj->attributes['xmlns'])) { + $namespace = $manifest_obj->attributes['xmlns']; + $version = str_replace($this->namespace_root, '', $namespace); } else { - $this->apiVersion = 1.7; + $version = 1.7; } + $this->apiVersion = $version; + $parser_class_name = 'ElggPluginManifestParser' . str_replace('.', '', $this->apiVersion); // @todo currently the autoloader freaks out if a class doesn't exist. |