2 $URL_HANDLERS["*"] = "GLCASRepo";
4 $CRON_CLASSES["GLCASRepo"] = "GLCASRepo";
7 function __construct($config)
9 $this->config = $config;
10 if($this->config->getConfigVar("storagelocation") == false) {
12 $storloc = "$WEB_ROOT_FS/../var/glcas/cache/";
13 if(!file_exists($storloc)) mkdir($storloc);
14 $this->config->setConfigVar("storagelocation", realpath($storloc));
15 $this->config->saveConfig();
16 error_log("set storage location, $storloc");
23 $uconf = unserialize($this->config->getConfigVar("repodata"));
24 $repostore = $this->config->getConfigVar("storagelocation");
28 foreach($uconf as $rkey => $repo) {
29 echo "Repo $rkey: ".$repo["desc"]."<br>";
30 if(isset($repo["frozen"])) {
31 error_log("repo froze set");
32 $repofrozen = $repo["frozen"];
34 error_log("repo froze not set");
37 if(!isset($repo["expiretime"])) {
38 echo " - Expire time not set, setting to 2 days by default<br>";
39 $uconf[$rkey]["expiretime"] = 2;
40 $repo["expiretime"] = 2;
41 $this->config->setConfigVar("repodata", serialize($uconf));
42 $this->config->saveConfig();
45 if(!isset($repo["repotype"])) {
46 echo "<font color=\"red\">Repo type not set for repo, setting to yum</font><br>";
47 $uconf[$rkey]["repotype"] = "YUM";
48 $this->config->setConfigVar("repodata", serialize($uconf));
49 $this->config->saveConfig();
50 } else if($repo["repotype"] == "YUM") {
52 error_log("repo frozen");
53 echo " - <font color=\"blue\">Repo Frozen</font><br>";
55 if(file_exists("$repostore/$rkey/repodata/repoupdate.lock")) {
56 echo " - <font color=\"red\">Repo locked for update</font><br>";
60 // we still do this next bit, even if its locked because it may be a stray file
61 echo " - Expire time is ".$repo["expiretime"]." days, checking repo<br>";
62 error_log("checking $repostore/$rkey/repodata/repomd.xml");
63 $tdiff = time() - filemtime("$repostore/$rkey/repodata/repomd.xml");
64 $maxtdiff = $repo["expiretime"] * 24 * 3600;
65 if($tdiff > $maxtdiff) {
66 echo " - <font color=\"green\">updating repo</font><br>";
67 $this->updateRepo($rkey);
69 echo " - not updating repo<br>";
72 } else if($repo["repotype"] == "APT") {
74 error_log("repo frozen");
75 echo " - <font color=\"blue\">Repo Frozen</font><br>";
77 if(file_exists("$repostore/$rkey/update.lock")) {
78 echo " - <font color=\"red\">Repo locaked for update</font><br>";
80 echo " - Expire time is ".$repo["expiretime"]." days, checking repo<br>";
81 $maxtdiff = $repo["expiretime"] * 24 * 3600;
82 // now we check for outdated release files
83 $dh = opendir("$repostore/$rkey/dists/");
85 while(($fn = readdir($dh))!==false) {
86 if($fn != "." && $fn != "..") {
87 if(file_exists("$repostore/$rkey/dists/$fn/Release")) {
88 $tdiff = time() - filemtime("$repostore/$rkey/dists/$fn/Release");
89 if($tdiff > $maxtdiff) $needsupdate = true;
94 echo " - Spawn updater<br>";
95 $this->updateRepo($rkey);
97 echo " - Up to date<br>";
106 error_log("repo:go called");
108 // figure out what we're doing
111 GLCASpageBuilder($this, "body");
114 $this->getRepoForUrl($url);
120 // this is how this will work
121 //$this->decodeUrl();
122 if(strncasecmp("list", $url, 4)==0) {
123 echo "i am the repo list";
126 echo "i am the repo, $url";
130 // TODO: rework this function
132 * What i need to do is have a downloader function
133 * that can cope with lots of different shit
134 * but thats a pipe dream
136 * what *THIS* function needs to do is
137 * 1) figure out the repo
138 * 2) figure out the file in the repo
139 * 2.1) if its a directory, go to print directory
140 * 3) if the file exists, give it to the user (if a range is specified give the user the range)
141 * 4) if the file does not exist
142 * - check if a tmp file exists
143 * - attempt to get an exclusive flock
144 * - if flock fails, donwload in progress
145 * - if flock succeeds, truncate file and re-start download
146 * - if a range request was made, send the range once available
147 * - if range not available, sleep for 5 and check again.
149 * I dont want to code this from scratch, but i probably need to
151 function getRepoForUrl($url)
153 $xurl = split("[/,]", $url);
155 // first get the config
156 $uconf = unserialize($this->config->getConfigVar("repodata"));
157 $repostore = $this->config->getConfigVar("storagelocation");
159 // preset matched to -1
162 // first we check for /repo/repoid as a url
164 if($xurl[0] == "repo") {
166 error_log("trying to get repo for repoid, $repid");
167 if(isset($uconf[$repid])) {
168 $matched = ((int)($repid));
169 error_log("set matched, $matched, $repid");
174 // now check for a prefix match
176 if($matched < 0) foreach($uconf as $key => $var) {
177 $pre = $var["prefix"];
180 //echo "Checking pre $pre against ".$xurl[0]."\n";
181 if(strcasecmp($pre, $xurl[0])==0) {
182 //echo "Matched pre\n";
189 // next, check for a short url match
190 if($matched < 0) foreach($uconf as $key => $var) {
191 // if we matched a pre, then we check against the second url component
193 $short = $var["shorturl"];
196 //echo "Checking short $short against ".$xurl[$startat]."\n";
197 if(strcasecmp($xurl[$startat], $short)==0) {
205 // TODO: this deterministic bit
206 // so far nothing has matched - what this next bit needs to do is try and "Determine" a repo from url
207 // for eg, if a user gets /fedora/x86_64/os we need to return something appropriate
209 echo "No such repo<br>";
210 header("HTTP/1.0 404 Not Found");
216 // something was matched, so now we reconstruct the file component of the url
218 if(count($xurl) > $startat) for($i=$startat; $i < count($xurl); $i++) {
219 $file .= "/".$xurl[$i];
222 // so, the ultimate url for the file we need is:
223 $actualfile = "$repostore/$matched/$file";
224 error_log("Atcualfile is $actualfile");
226 // now check for a block in that repo
227 if(isset($uconf[$matched]["blocklist"])) {
228 foreach($uconf[$matched]["blocklist"] as $blockers) {
229 $rfile = ltrim($file, "/");
230 error_log("checking $blockers against $rfile");
231 if(preg_match("/$blockers/", $rfile) > 0) {
232 error_log("should block");
233 header("HTTP/1.0 404 Not Found");
239 // if its a directory, lets do a print
240 if(is_dir($actualfile)) {
241 $this->printDir($actualfile, $file, $url);
245 // check if the file exists and serve it up
246 if(file_exists($actualfile) && !file_exists("$actualfile.size")) {
247 $this->serveUpFile($actualfile, $matched);
250 // the file does not exist, we now need to go into "download" mode
251 $remoteurl = $uconf[$matched]["url"]."/$file";
252 $this->downloadAndServe($actualfile, $matched, $remoteurl);
257 function serveUpFile($actualfile, $repoid)
259 $uconf = unserialize($this->config->getConfigVar("repodata"));
260 $repostore = $this->config->getConfigVar("storagelocation");
262 // figure out the range header garbage that centos/redhat send
263 if(isset($_SERVER["HTTP_RANGE"])) {
264 // we're using ranges - screw you stupid installer
265 $pr_range = preg_split("/[:\-=, ]+/", $_SERVER["HTTP_RANGE"]);
268 $rangestart = $pr_range[1];
269 $rangelength = $pr_range[2] - $pr_range[1] +1;
270 $rangestr = $pr_range[1]."-".$pr_range[2];
271 error_log("going ranges at $rangestart, $rangelength,".$rangesa[1].",".$rangesb[0]);
273 // now spit some headers
274 header("HTTP/1.1 206 Partial Content");
275 header("Content-Length: ".$rangelength);
278 header("Content-Range: bytes $rangestr/".filesize($actualfile));
280 // determine mime type
281 $type = mime_content_type($actualfile);
283 // set mime type header
284 header("Content-type: $type");
286 // open the local file (TODO: error check)
287 $localfile = fopen($actualfile, "r");
288 fseek($localfile, $rangestart, SEEK_SET);
290 // read in the data, god i hope its not big
291 $data = fread($localfile, $rangelength);
297 // and close the file
302 // we're not using range's - good on you installer thingy
303 header("Content-Length: ".filesize($actualfile));
305 // set the mime type header
306 $type = mime_content_type($actualfile);
307 header("Content-type: $type");
309 // open the local file
310 $localfile = fopen($actualfile, "r");
312 error_log("normal upload went barf");
316 // iterate over its length, send 8k at a time
317 while(!feof($localfile)) {
318 // read and send data
319 $data = fread($localfile, 32768);
322 // flush so the client sees the data
332 // TODO: this is the function im working on
333 // the alternative to this function is that if a file is in the process of being
334 // downloaded, we simply serve from upstream... not a good idea tho unless we create
335 // a local proxy right here - this function is a race condition waiting to be had
336 // lets hope its a good one!
337 function downloadAndServe($filename, $repoid, $remoteurl)
340 $this->startDownload($filename, $remoteurl);
342 // give the proc a minute to get going
346 // get the configurations we need
347 $uconf = unserialize($this->config->getConfigVar("repodata"));
348 $repostore = $this->config->getConfigVar("storagelocation");
352 // determine if we're ranged
357 if(isset($_SERVER["HTTP_RANGE"])) {
358 // we're using ranges - screw you stupid installer
360 $pr_range = preg_split("/[:\-=, ]+/", $_SERVER["HTTP_RANGE"]);
361 error_log("got range ".$_SERVER["HTTP_RANGE"]." and ".print_r($pr_range, true));
364 $rangestart = $pr_range[1];
365 $rangelength = $pr_range[2] - $pr_range[1] +1;
366 $rangestr = $pr_range[1]."-".$pr_range[2];
367 error_log("going ranges at $rangestart, $rangelength, $rangestr");
371 // open the local files
373 // now, lets determine what state we're in
374 // we're either - getting and sending
375 // watching and sending
376 // or a range (Getting and sending)
377 // or a range (watching and sending)
378 // TODO: it may be advicable to start the download as a seperate cli process rather then something goin on here
379 // so it definitely cant be interrupted.
381 // check for a 404 file and wait 2 if it exists - i should really check the timestamp for an updated
382 // file, but thats too much effort for now: TODO: check timestamp on 404 file
384 while(!file_exists("$filename")) {
388 error_log("Sleeping waiting for file");
390 // if 404 file exists, we wait much less time
391 if(file_exists("$filename.404") && $slept > 2) {
392 header("HTTP/1.0 404 Not Found");
396 header("HTTP/1.0 404 Not Found");
402 if(is_dir($filename)) {
404 header("Location: ".$_SERVER["REQUEST_URI"]."/");
409 // first, getting and sending - this is easy.
412 $localfile = fopen($filename, "r");
414 // this is where the fun starts - but this one isnt too bad.
415 error_log("OTHERDOWNLOAD: im another downloader, please work");
416 if(file_exists("$filename.size")) $fsize = file_get_contents("$filename.size");
417 else $fsize = filesize($filename);
418 header("Content-Length: $fsize");
420 while(!feof($localfile)) {
421 $data = fread($localfile, 2048);
423 error_log("dollardata is pair shaped");
425 $sgotten += strlen($data);
426 if($sgotten > $fsize) {
427 error_log("went plop at sgotten, $sgotten, $fsize");
436 // need to think about this in pseudo code.
437 // 1. close the file and wait for it to get to $sgotten + 2048 or $fsize
438 $cursize = filesize($filename);
440 $upload_finished = false;
441 while(!$upload_finished) {
442 while($cursize < $fsize && $cursize < ($sgotten+2048)) {
444 error_log("OTHERDOWNLOAD: halt, $cursize, $sgotten, $fsize");
445 // sleep until the the filesize is greater then what we're up to, or until the file is finished
447 $cursize = filesize($filename);
450 error_log("OTHERDOWNLOAD: continue, $sgotten, $fsize");
451 // reopen local file - if it stopped existing, we need to deal with that
452 $localfile = fopen($filename, "r");
454 // UG, we need to ff, how could i forget that
455 fseek($localfile, $sgotten);
458 error_log("OTHERDOWNLOAD: something went plop");
462 // now loop on the file until we have it at an eof
463 while(!feof($localfile)) {
464 $data = fread($localfile, 512);
466 error_log("OTHERDOWNLOAD: dollar data went plop");
468 $sgotten += strlen($data);
475 if($sgotten >= $fsize) {
476 if($sgotten > $fsize) error_log("OTHERDOWNLOADER: finished but $sgotten, $fsize doesnt make senze");
477 $upload_finished = true;
482 error_log("OTHERDOWNLOADER: done with");
491 // and here too, yay, someone else is doing the
492 // download, but we're the retards getting a range
495 $sgatlen = $rangestart+$rangelength;
497 // the problem is here
498 error_log("Downloader: going ranged as other");
500 if(file_exists($filename.".tmp.data.deleteme.size")) $contentlen = file_get_contents($filename.".tmp.data.deleteme.size");
501 else $contentlen = filesize($filename);
502 $contenttype = mime_content_type($filename);
503 header("HTTP/1.1 206 Partial Content");
504 header("Content-Length: $rangelength");
505 header("Content-Range: bytes $rangestr/$contentlen");
506 $contenttype = "Content-Type: application/x-rpm";
508 error_log("$contenttype");
509 header("$contenttype");
515 // first we wait until the file reaches $rangestart
516 while(filesize("$filename") < $rangestart) {
520 // then we open the file and ff to rangestart
521 $localfile = fopen($filename, "r");
522 fseek($localfile, $rangestart);
525 // need to think about this in pseudo code.
526 // 1. close the file and wait for it to get to $sgotten + 2048 or $fsize
527 $cursize = filesize($filename);
530 $upload_finished = false;
531 while(!$upload_finished) {
532 while($cursize < $sgatlen && $cursize < ($sgotten+2048)) {
534 error_log("OTHERDOWNLOAD: halt, $cursize, $sgotten, $contentlen");
535 // sleep until the the filesize is greater then what we're up to, or until the file is finished
537 $cursize = filesize($filename);
540 error_log("OTHERDOWNLOAD: continue, $sgotten, $contentlen");
541 // reopen local file - if it stopped existing, we need to deal with that
542 $localfile = fopen($filename, "r");
544 // UG, we need to ff, how could i forget that
545 fseek($localfile, $sgotten+$rangestart);
548 error_log("OTHERDOWNLOAD: something went plop");
552 // now loop on the file until we have it at sgatlen
553 while(!feof($localfile) && $sgotten < $rangelength) {
554 $left = $rangelength - $sgotten;
555 if($left > 512) $lenget = 512;
556 else $lenget = $left;
557 $data = fread($localfile, $lenget);
559 error_log("OTHERDOWNLOAD: dollar data went plop");
561 $sgotten += strlen($data);
568 if($sgotten >= $rangelength) {
569 if($sgotten > $rangelength) error_log("OTHERDOWNLOADER: finished but $sgotten, $fsize doesnt make senze");
570 $upload_finished = true;
575 error_log("OTHERDOWNLOADER: done with");
585 function startDownload($file, $url)
588 error_log("background downloader, start");
589 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
590 if(file_exists("$WEB_ROOT_FS/../bin/downloadfile.php")) {
591 $scall = "/usr/bin/php $WEB_ROOT_FS/../bin/downloadfile.php '$url' '$file' > /tmp/dllog 2>&1 &";
594 error_log("cant find download helper... dieing");
598 // this is a nightmare
601 function printDir($dir, $localfile, $baseurl)
603 $localfile = preg_replace("/\/\/+/", "/", $localfile);
604 $uri = $_SERVER["REQUEST_URI"];
607 $content .= "<html><head><title>Index of $localfile</title></head><body><h1>Index of $localfile</h1>";
608 $content .= "<table>";
612 while(($file = readdir($dh))!==false) {
613 if($file != "." && $file != "..") {
614 if(is_dir("$dir/$file")) {
615 $dirlist[$dirn++] = "$file";
617 $filelist[$filen++] = "$file";
621 if(isset($dirlist)) {
623 foreach($dirlist as $dirs) {
624 $icon = "/icons/folder.png";
625 $content .= "<tr><td><img src=\"$icon\"></td><td><a href=\"$uri/$dirs\">$dirs</a></td><td></td></tr>";
628 if(isset($filelist)) {
630 foreach($filelist as $files) {
631 $fsize = filesize("$dir/$files");
632 $icon = "/icons/text.png";
633 $content .= "<tr><td><img src=\"$icon\"></td><td><a href=\"$uri/$files\">$files</a></td><td>$fsize</td></tr>";
636 $content .= "</table></body></html>";
638 GLCASpageBuilder(null, null, $content);
643 function getRepoDetailsApt($url)
645 $action1 = $url."/dists";
647 // we just want to make sure it exists really
648 error_log("in repo details apt for $url");
649 if(!glcas_isRemoteDir($action1)) {
650 //echo "I cant find any valid APT dists's at $url<br>";
654 // ok, now scan for ubuntu dists as
655 $kos = getKnownOSList();
658 $existing_repo["isrepo"] = true;
659 foreach($kos["apt"] as $key => $val) {
660 //echo "<br>$key, $val<br>";
661 //echo "now check, $action1/$key";
662 if(glcas_isRemoteDir($action1."/$key")) {
663 $existing_repos["knownrepo"][$repos]["name"] = $key;
664 //echo "Found Distro $val<br>";
665 if(glcas_fileExists($action1."/$key/Contents-amd64.gz")) $existing_repos["knownrepo"][$repos]["amd64"] = true;
666 else $existing_repos["knownrepo"][$repos]["amd64"] = false;
667 if(glcas_fileExists($action1."/$key/Contents-i386.gz")) $existing_repos["knownrepo"][$repos]["i386"] = true;
668 else $existing_repos["knownrepo"][$repos]["i386"] = false;
673 $existing_repos["nrepos"] = $repos;
675 // TODO: these need to be "calculated"
676 $existing_repos["distros"] = "Ubuntu, Debian";
677 $existing_repos["versions"] = "8.04LTS, 9.10, 10.04LTS, 10.10, 11.04, 11.10";
678 $existing_repos["arch"] = "x86_64, i386";
681 return $existing_repos;
685 function getRepoDetailsYum($url, $ismirrorlist=false)
687 $actionurl = $url."/repodata/repomd.xml";
689 error_log("Getting for action of $actionurl");
691 $ld = file_get_contents($actionurl);
693 // so here we try and get what this repository provides (os, version, arch), for yum this
694 // should come straight off the url... i.e. centos/6.0/os/x86_64/ (centos, 6.0, base os, 64bit arch)
696 if(!$ld) return false;
698 // ok, now we tokenize the url and try and guess at the content
699 $spurl = explode("/", $url);
701 // first, find the OS
702 $kos = getKnownOSList();
703 $glt["OS"] = "unknown";
704 $glt["verison"] = "unknown";
705 $glt["arch"] = "unknown";
706 $glt["other"] = "unknown";
707 foreach($spurl as $comp) {
710 foreach($kos["os"]["short"] as $kosname => $koslong) {
711 //error_log("Comparing $kosname and $koslong with $comp");
712 if(strcasecmp($kosname, $comp) == 0) {
713 //error_log("got $kosname, $koslong for $comp in $url");
714 //echo "<pre>inone\n"; print_r($koslong); echo "</pre>";
715 $glt["OS"] = $koslong;
719 // find a version, we assume its going to be something [numbers] and a . (optional)
720 if(preg_match("/^[0-9.]+$/", $comp)>0) {
721 //error_log("version match of $comp");
722 $glt["version"] = $comp;
725 // now architecture, this can be either i?86 or x86_64 - can also be arm or otherwise, but lets just go with this for now
726 foreach($kos["arch"] as $archinter => $archname ) {
727 //error_log("Comparing $archinter, $archname with $comp");
728 if(strcasecmp($archname, $comp) == 0) {
729 //error_log("arch match of $archname with $comp");
730 $glt["arch"] = $archname;
734 // other is a bt harder, we really have to guess at this one
735 if(strcasecmp("os", $comp) == 0) $glt["other"] = "OS";
736 if(strcasecmp("update", $comp) == 0) $glt["other"] = "Updates";
737 if(strcasecmp("updates", $comp) == 0) $glt["other"] = "Updates";
738 if(strcasecmp("everything", $comp) == 0) $glt["other"] = "OS";
745 function freezeRepo($rkey)
748 $uconf = $this->config->getConfigVar("repodata");
749 $repostore = $this->config->getConfigVar("storagelocation");
751 if($uconf !== false) {
752 $conf = unserialize($uconf);
753 foreach($conf as $key => $vla) {
755 if(isset($conf["$rkey"]["frozen"])) {
756 if($conf["$rkey"]["frozen"]) {
757 $conf["$rkey"]["frozen"] = false;
758 error_log("Unfreeze repo");
760 $conf["$rkey"]["frozen"] = true;
761 error_log("freeze repo");
764 $conf["$rkey"]["frozen"] = true;
766 $nconf = serialize($conf);
767 error_log("freeze repo as $rkey");
768 $this->config->setConfigVar("repodata", $nconf);
769 $this->config->saveConfig();
775 function deleteRepo($rkey)
777 $uconf = $this->config->getConfigVar("repodata");
778 $repostore = $this->config->getConfigVar("storagelocation");
780 if($uconf !== false) {
781 $conf = unserialize($uconf);
782 foreach($conf as $key => $vla) {
784 unset($conf["$rkey"]);
785 $nconf = serialize($conf);
786 system("rm -rf $repostore/$key");
787 error_log("remove repo as $rkey");
788 $this->config->setConfigVar("repodata", $nconf);
789 $this->config->saveConfig();
795 function addRepo($desc, $os, $version, $arch, $other, $shorturl, $prefix, $repurl, $repotype, $init, $expiretime, $blocklist=null)
797 $uconf = $this->config->getConfigVar("repodata");
801 $cs["version"] = $version;
803 $cs["other"] = $other;
804 $cs["shorturl"] = $shorturl;
805 $cs["prefix"] = $prefix;
806 $cs["url"] = $repurl;
807 $cs["repotype"] = $repotype;
808 $cs["expiretime"] = $expiretime;
809 if($blocklist != null) {
810 $cs["blocklist"] = $blocklist;
815 if($uconf !== false) {
816 $conf = unserialize($uconf);
817 foreach($conf as $key => $val) {
825 $nconf = serialize($conf);
827 error_log("add repo as $ckey");
828 $this->config->setConfigVar("repodata", $nconf);
829 $this->config->saveConfig();
831 // now create the base structure in the repo
832 $repostore = $this->config->getConfigVar("storagelocation");
835 // now call update repo
836 if($init) $this->updateRepoYum($ckey);
839 function updateRepo($repokey)
841 // we only do yum yet
842 $repod = $this->getRepo($repokey);
843 if(isset($repod["frozen"])) if($repod["frozen"]) {
844 error_log("in update repo for frozen repo, ignore update");
848 error_log("in update repo");
850 if($repod["repotype"] == "YUM") $this->updateRepoYum($repokey);
851 if($repod["repotype"] == "APT") $this->updateRepoApt($repokey);
854 function updateRepoApt($repokey)
856 $repostore = $this->config->getConfigVar("storagelocation");
858 $repod = $this->getRepo($repokey);
860 $repourl = $repod["url"];
862 if(!file_exists("$repostore/$repokey")) {
863 mkdir("$repostore/$repokey");
866 if(!file_exists("$repostore/$repokey/dists/")) {
867 mkdir("$repostore/$repokey/dists/");
868 // no point trying to update if we have no dists directory
873 error_log("background apt repo update, start");
874 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
875 if(file_exists("$WEB_ROOT_FS/../bin/downloadfile.php")) {
876 $scall = "/usr/bin/php $WEB_ROOT_FS/../bin/updateaptrepo.php '$repourl' '$repostore/$repokey/' > /tmp/updateaptrepo.$repokey.log 2>&1 &";
879 error_log("cant find download apt helper... dieing");
883 function updateRepoYum($repokey)
885 $repostore = $this->config->getConfigVar("storagelocation");
887 $repod = $this->getRepo($repokey);
889 $repourl = $repod["url"];
891 if(!file_exists("$repostore/$repokey")) {
892 mkdir("$repostore/$repokey");
895 if(!file_exists("$repostore/$repokey/repodata")) {
896 mkdir("$repostore/$repokey/repodata");
899 error_log("background yum repo update, start");
900 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
901 if(file_exists("$WEB_ROOT_FS/../bin/downloadfile.php")) {
902 $scall = "/usr/bin/php $WEB_ROOT_FS/../bin/updateyumrepo.php '$repourl' '$repostore/$repokey/' > /tmp/updateyumrepo.$repokey.log 2>&1 &";
905 error_log("cant find download yum helper... dieing");
909 //ignore_user_abort(true);
912 function getRepo($id)
914 $uconf = $this->config->getConfigVar("repodata");
915 if($uconf !== false) {
916 $lconf = unserialize($uconf);
924 $uconf = $this->config->getConfigVar("repodata");
925 if($uconf !== false) {
926 return unserialize($uconf);