trying to figure out hoe i group os's and stuff
[glcas.git] / plugins / repo.php
index 804a5ce..fea1c4f 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 $URL_HANDLERS["*"] = "GLCASRepo";
 
+
 class GLCASRepo {
        function __construct($config)
        {
@@ -9,7 +10,33 @@ class GLCASRepo {
        
        function go($url)
        {
-               echo "i am the repo man, i repo the repo";
+               error_log("repo:go called");
+               GLCASpageBuilder($this, "body");
+       }
+       
+       function body($url)
+       {
+               echo "for the repo, i am the repo $url";
+       }
+       
+       function getRepoDetailsYum($url, $ismirrorlist=false)
+       {
+               $actionurl = $url."/repodata/repomd.xml";
+               
+               error_log("Getting for action of $actionurl");
+               
+               $ld = file_get_contents($actionurl);
+               
+               // so here we try and get what this repository provides (os, version, arch), for yum this
+               // should come straight off the url... i.e. centos/6.0/os/x86_64/ (centos, 6.0, base os, 64bit arch)
+               
+               if(!$ld) return false;
+               
+               $glt["OS"] = "Fedora";
+               $glt["version"] = "15";
+               $glt["arch"] = "x86_64";
+               
+               return $glt;
        }
        
        private $config;