show package info
[pharext/replicator.pharext.org] / public / index.php
index c1679805116d98cbe270fd0deac31b8c5a02df2d..72a97f62542632c2f024f43c8c2999339859cbfb 100644 (file)
@@ -66,6 +66,16 @@ function package_versions($package) {
        return $versions;
 }
 
+function package_info($package) {
+       if (($xml = simplexml_load_file("phars/$package/info.xml"))) {
+               return [
+                       "title" => (string) $xml->s, 
+                       "description" => (string) $xml->d,
+                       "license" => (string) $xml->l
+               ];
+       }
+}
+
 $packages = array_map("basename", glob("phars/*", GLOB_NOSORT|GLOB_ONLYDIR));
 sort($packages, SORT_NATURAL|SORT_FLAG_CASE);