fea1c4f34822c1559a41c934b6d7849d6b8270f7
[glcas.git] / plugins / repo.php
1 <?php
2 $URL_HANDLERS["*"] = "GLCASRepo";
3
4
5 class GLCASRepo {
6         function __construct($config)
7         {
8                 $this->config = $config;
9         }
10         
11         function go($url)
12         {
13                 error_log("repo:go called");
14                 GLCASpageBuilder($this, "body");
15         }
16         
17         function body($url)
18         {
19                 echo "for the repo, i am the repo $url";
20         }
21         
22         function getRepoDetailsYum($url, $ismirrorlist=false)
23         {
24                 $actionurl = $url."/repodata/repomd.xml";
25                 
26                 error_log("Getting for action of $actionurl");
27                 
28                 $ld = file_get_contents($actionurl);
29                 
30                 // so here we try and get what this repository provides (os, version, arch), for yum this
31                 // should come straight off the url... i.e. centos/6.0/os/x86_64/ (centos, 6.0, base os, 64bit arch)
32                 
33                 if(!$ld) return false;
34                 
35                 $glt["OS"] = "Fedora";
36                 $glt["version"] = "15";
37                 $glt["arch"] = "x86_64";
38                 
39                 return $glt;
40         }
41         
42         private $config;
43 }
44
45 ?>