summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dibb <beandog@gentoo.org>2009-12-29 21:48:28 +0000
committerSteve Dibb <beandog@gentoo.org>2009-12-29 21:48:28 +0000
commita1f0e4d7eee75670a5929f2c6bc71ac399b900a0 (patch)
treeba85a3d3719332267d0b2e72c60738bd3c771eca
parentimport metadata (diff)
downloadznurt-org-backend-a1f0e4d7eee75670a5929f2c6bc71ac399b900a0.tar.gz
znurt-org-backend-a1f0e4d7eee75670a5929f2c6bc71ac399b900a0.tar.bz2
znurt-org-backend-a1f0e4d7eee75670a5929f2c6bc71ac399b900a0.zip
include metadata
git-svn-id: file:///var/svn/portage@18 3218660a-b0cf-4799-a991-8ddcc5b9e0f3
-rw-r--r--class.portage.category.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/class.portage.category.php b/class.portage.category.php
index 5f4c193..0136c18 100644
--- a/class.portage.category.php
+++ b/class.portage.category.php
@@ -4,6 +4,8 @@
private $name;
protected $dir;
+ private $metadata;
+ private $description;
function __construct($str = null) {
@@ -26,6 +28,7 @@
$str = basename($str);
$dir = $this->getTree()."/".$str;
+ $this->metadata = $dir."/metadata.xml";
if(is_dir($dir)) {
$this->name = $str;
@@ -41,6 +44,14 @@
sort($arr);
$this->arr_packages = $arr;
+
+ // Get metadata
+ $xml = simplexml_load_file($this->metadata);
+ foreach($xml->longdescription as $obj) {
+ $str = trim(preg_replace('/\s+/', ' ', (string)$obj));
+ $lang = (string)$obj['lang'];
+ $this->description[$lang] = $str;
+ }
}