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["expiretime"])) {
31 echo " - Expire time not set, setting to 2 days by default<br>";
32 $uconf[$rkey]["expiretime"] = 2;
33 $repo["expiretime"] = 2;
34 $this->config->setConfigVar("repodata", serialize($uconf));
35 $this->config->saveConfig();
38 if(file_exists("$repostore/$rkey/repodata/repoupdate.lock")) {
39 echo " - <font color=\"red\">Repo locked for update</font><br>";
43 // we still do this next bit, even if its locked because it may be a stray file
44 echo " - Expire time is ".$repo["expiretime"]." days, checking repo<br>";
45 error_log("checking $repostore/$rkey/repodata/repomd.xml");
46 $tdiff = time() - filemtime("$repostore/$rkey/repodata/repomd.xml");
47 $maxtdiff = $repo["expiretime"] * 24 * 3600;
48 if($tdiff > $maxtdiff) {
49 echo " - <font color=\"green\">updating repo</font><br>";
50 $this->updateRepo($rkey);
52 echo " - not updating repo<br>";
59 error_log("repo:go called");
61 // figure out what we're doing
64 GLCASpageBuilder($this, "body");
67 $this->getRepoForUrl($url);
73 // this is how this will work
75 if(strncasecmp("list", $url, 4)==0) {
76 echo "i am the repo list";
79 echo "i am the repo, $url";
83 // TODO: rework this function
85 * What i need to do is have a downloader function
86 * that can cope with lots of different shit
87 * but thats a pipe dream
89 * what *THIS* function needs to do is
90 * 1) figure out the repo
91 * 2) figure out the file in the repo
92 * 2.1) if its a directory, go to print directory
93 * 3) if the file exists, give it to the user (if a range is specified give the user the range)
94 * 4) if the file does not exist
95 * - check if a tmp file exists
96 * - attempt to get an exclusive flock
97 * - if flock fails, donwload in progress
98 * - if flock succeeds, truncate file and re-start download
99 * - if a range request was made, send the range once available
100 * - if range not available, sleep for 5 and check again.
102 * I dont want to code this from scratch, but i probably need to
104 function getRepoForUrl($url)
106 $xurl = split("[/,]", $url);
108 // first get the config
109 $uconf = unserialize($this->config->getConfigVar("repodata"));
110 $repostore = $this->config->getConfigVar("storagelocation");
112 // preset matched to -1
115 // first we check for /repo/repoid as a url
117 if($xurl[0] == "repo") {
119 error_log("trying to get repo for repoid, $repid");
120 if(isset($uconf[$repid])) {
121 $matched = ((int)($repid));
122 error_log("set matched, $matched, $repid");
127 // now check for a prefix match
129 if($matched < 0) foreach($uconf as $key => $var) {
130 $pre = $var["prefix"];
133 //echo "Checking pre $pre against ".$xurl[0]."\n";
134 if(strcasecmp($pre, $xurl[0])==0) {
135 //echo "Matched pre\n";
142 // next, check for a short url match
143 if($matched < 0) foreach($uconf as $key => $var) {
144 // if we matched a pre, then we check against the second url component
146 $short = $var["shorturl"];
149 //echo "Checking short $short against ".$xurl[$startat]."\n";
150 if(strcasecmp($xurl[$startat], $short)==0) {
158 // TODO: this deterministic bit
159 // so far nothing has matched - what this next bit needs to do is try and "Determine" a repo from url
160 // for eg, if a user gets /fedora/x86_64/os we need to return something appropriate
162 echo "No such repo<br>";
163 header("HTTP/1.0 404 Not Found");
168 // something was matched, so now we reconstruct the file component of the url
170 if(count($xurl) > $startat) for($i=$startat; $i < count($xurl); $i++) {
171 $file .= "/".$xurl[$i];
174 // so, the ultimate url for the file we need is:
175 $actualfile = "$repostore/$matched/$file";
176 error_log("Atcualfile is $actualfile");
178 // if its a directory, lets do a print
179 if(is_dir($actualfile)) {
180 $this->printDir($actualfile, $file, $url);
184 // check if the file exists and serve it up
185 if(file_exists($actualfile) && !file_exists("$actualfile.size")) {
186 $this->serveUpFile($actualfile, $matched);
189 // the file does not exist, we now need to go into "download" mode
190 $remoteurl = $uconf[$matched]["url"]."/$file";
191 $this->downloadAndServe($actualfile, $matched, $remoteurl);
196 function serveUpFile($actualfile, $repoid)
198 $uconf = unserialize($this->config->getConfigVar("repodata"));
199 $repostore = $this->config->getConfigVar("storagelocation");
201 // figure out the range header garbage that centos/redhat send
202 if(isset($_SERVER["HTTP_RANGE"])) {
203 // we're using ranges - screw you stupid installer
204 $pr_range = preg_split("/[:\-=, ]+/", $_SERVER["HTTP_RANGE"]);
207 $rangestart = $pr_range[1];
208 $rangelength = $pr_range[2] - $pr_range[1] +1;
209 $rangestr = $pr_range[1]."-".$pr_range[2];
210 error_log("going ranges at $rangestart, $rangelength,".$rangesa[1].",".$rangesb[0]);
212 // now spit some headers
213 header("HTTP/1.1 206 Partial Content");
214 header("Content-Length: ".$rangelength);
217 header("Content-Range: bytes $rangestr/".filesize($actualfile));
219 // determine mime type
220 $type = mime_content_type($actualfile);
222 // set mime type header
223 header("Content-type: $type");
225 // open the local file (TODO: error check)
226 $localfile = fopen($actualfile, "r");
227 fseek($localfile, $rangestart, SEEK_SET);
229 // read in the data, god i hope its not big
230 $data = fread($localfile, $rangelength);
236 // and close the file
241 // we're not using range's - good on you installer thingy
242 header("Content-Length: ".filesize($actualfile));
244 // set the mime type header
245 $type = mime_content_type($actualfile);
246 header("Content-type: $type");
248 // open the local file
249 $localfile = fopen($actualfile, "r");
251 error_log("normal upload went barf");
255 // iterate over its length, send 8k at a time
256 while(!feof($localfile)) {
257 // read and send data
258 $data = fread($localfile, 32768);
261 // flush so the client sees the data
271 // TODO: this is the function im working on
272 // the alternative to this function is that if a file is in the process of being
273 // downloaded, we simply serve from upstream... not a good idea tho unless we create
274 // a local proxy right here - this function is a race condition waiting to be had
275 // lets hope its a good one!
276 function downloadAndServe($filename, $repoid, $remoteurl)
279 $this->startDownload($filename, $remoteurl);
281 // give the proc a minute to get going
285 // get the configurations we need
286 $uconf = unserialize($this->config->getConfigVar("repodata"));
287 $repostore = $this->config->getConfigVar("storagelocation");
291 // determine if we're ranged
296 if(isset($_SERVER["HTTP_RANGE"])) {
297 // we're using ranges - screw you stupid installer
299 $pr_range = preg_split("/[:\-=, ]+/", $_SERVER["HTTP_RANGE"]);
300 error_log("got range ".$_SERVER["HTTP_RANGE"]." and ".print_r($pr_range, true));
303 $rangestart = $pr_range[1];
304 $rangelength = $pr_range[2] - $pr_range[1] +1;
305 $rangestr = $pr_range[1]."-".$pr_range[2];
306 error_log("going ranges at $rangestart, $rangelength, $rangestr");
310 // open the local files
312 // now, lets determine what state we're in
313 // we're either - getting and sending
314 // watching and sending
315 // or a range (Getting and sending)
316 // or a range (watching and sending)
317 // TODO: it may be advicable to start the download as a seperate cli process rather then something goin on here
318 // so it definitely cant be interrupted.
320 // check for a 404 file and wait 2 if it exists - i should really check the timestamp for an updated
321 // file, but thats too much effort for now: TODO: check timestamp on 404 file
323 while(!file_exists("$filename")) {
327 error_log("Sleeping waiting for file");
329 // if 404 file exists, we wait much less time
330 if(file_exists("$filename.404") && $slept > 2) {
331 header("HTTP/1.0 404 Not Found");
335 header("HTTP/1.0 404 Not Found");
341 if(is_dir($filename)) {
343 header("Location: ".$_SERVER["REQUEST_URI"]."/");
348 // first, getting and sending - this is easy.
351 $localfile = fopen($filename, "r");
353 // this is where the fun starts - but this one isnt too bad.
354 error_log("OTHERDOWNLOAD: im another downloader, please work");
355 if(file_exists("$filename.size")) $fsize = file_get_contents("$filename.size");
356 else $fsize = filesize($filename);
357 header("Content-Length: $fsize");
359 while(!feof($localfile)) {
360 $data = fread($localfile, 2048);
362 error_log("dollardata is pair shaped");
364 $sgotten += strlen($data);
365 if($sgotten > $fsize) {
366 error_log("went plop at sgotten, $sgotten, $fsize");
375 // need to think about this in pseudo code.
376 // 1. close the file and wait for it to get to $sgotten + 2048 or $fsize
377 $cursize = filesize($filename);
379 $upload_finished = false;
380 while(!$upload_finished) {
381 while($cursize < $fsize && $cursize < ($sgotten+2048)) {
383 error_log("OTHERDOWNLOAD: halt, $cursize, $sgotten, $fsize");
384 // sleep until the the filesize is greater then what we're up to, or until the file is finished
386 $cursize = filesize($filename);
389 error_log("OTHERDOWNLOAD: continue, $sgotten, $fsize");
390 // reopen local file - if it stopped existing, we need to deal with that
391 $localfile = fopen($filename, "r");
393 // UG, we need to ff, how could i forget that
394 fseek($localfile, $sgotten);
397 error_log("OTHERDOWNLOAD: something went plop");
401 // now loop on the file until we have it at an eof
402 while(!feof($localfile)) {
403 $data = fread($localfile, 512);
405 error_log("OTHERDOWNLOAD: dollar data went plop");
407 $sgotten += strlen($data);
414 if($sgotten >= $fsize) {
415 if($sgotten > $fsize) error_log("OTHERDOWNLOADER: finished but $sgotten, $fsize doesnt make senze");
416 $upload_finished = true;
421 error_log("OTHERDOWNLOADER: done with");
430 // and here too, yay, someone else is doing the
431 // download, but we're the retards getting a range
434 $sgatlen = $rangestart+$rangelength;
436 // the problem is here
437 error_log("Downloader: going ranged as other");
439 if(file_exists($filename.".tmp.data.deleteme.size")) $contentlen = file_get_contents($filename.".tmp.data.deleteme.size");
440 else $contentlen = filesize($filename);
441 $contenttype = mime_content_type($filename);
442 header("HTTP/1.1 206 Partial Content");
443 header("Content-Length: $rangelength");
444 header("Content-Range: bytes $rangestr/$contentlen");
445 $contenttype = "Content-Type: application/x-rpm";
447 error_log("$contenttype");
448 header("$contenttype");
454 // first we wait until the file reaches $rangestart
455 while(filesize("$filename") < $rangestart) {
459 // then we open the file and ff to rangestart
460 $localfile = fopen($filename, "r");
461 fseek($localfile, $rangestart);
464 // need to think about this in pseudo code.
465 // 1. close the file and wait for it to get to $sgotten + 2048 or $fsize
466 $cursize = filesize($filename);
469 $upload_finished = false;
470 while(!$upload_finished) {
471 while($cursize < $sgatlen && $cursize < ($sgotten+2048)) {
473 error_log("OTHERDOWNLOAD: halt, $cursize, $sgotten, $contentlen");
474 // sleep until the the filesize is greater then what we're up to, or until the file is finished
476 $cursize = filesize($filename);
479 error_log("OTHERDOWNLOAD: continue, $sgotten, $contentlen");
480 // reopen local file - if it stopped existing, we need to deal with that
481 $localfile = fopen($filename, "r");
483 // UG, we need to ff, how could i forget that
484 fseek($localfile, $sgotten+$rangestart);
487 error_log("OTHERDOWNLOAD: something went plop");
491 // now loop on the file until we have it at sgatlen
492 while(!feof($localfile) && $sgotten < $rangelength) {
493 $left = $rangelength - $sgotten;
494 if($left > 512) $lenget = 512;
495 else $lenget = $left;
496 $data = fread($localfile, $lenget);
498 error_log("OTHERDOWNLOAD: dollar data went plop");
500 $sgotten += strlen($data);
507 if($sgotten >= $rangelength) {
508 if($sgotten > $rangelength) error_log("OTHERDOWNLOADER: finished but $sgotten, $fsize doesnt make senze");
509 $upload_finished = true;
514 error_log("OTHERDOWNLOADER: done with");
524 function startDownload($file, $url)
527 error_log("background downloader, start");
528 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
529 if(file_exists("$WEB_ROOT_FS/../bin/downloadfile.php")) {
530 $scall = "/usr/bin/php $WEB_ROOT_FS/../bin/downloadfile.php '$url' '$file' > /tmp/dllog 2>&1 &";
533 error_log("cant find download helper... dieing");
537 // this is a nightmare
538 function getRepoForUrlOld($url)
540 // the way we breakdown a url is to explode it
541 $xurl = split("[/,]", $url);
543 // we first check if [0] is a prefix
544 // if now, we check for it being a shorturl (lets just do that for now)
545 $uconf = unserialize($this->config->getConfigVar("repodata"));
546 $repostore = $this->config->getConfigVar("storagelocation");
550 // first we check for /repo/repoid as a url
552 if($xurl[0] == "repo") {
554 error_log("trying to get repo for repoid, $repid");
555 if(isset($uconf[$repid])) {
556 $matched = ((int)($repid));
557 error_log("set matched, $matched, $repid");
564 if($matched < 0) foreach($uconf as $key => $var) {
565 $pre = $var["prefix"];
568 //echo "Checking pre $pre against ".$xurl[0]."\n";
569 if(strcasecmp($pre, $xurl[0])==0) {
570 //echo "Matched pre\n";
578 if($matched < 0) foreach($uconf as $key => $var) {
579 // if we matched a pre, then we check against the second url component
581 $short = $var["shorturl"];
584 //echo "Checking short $short against ".$xurl[$startat]."\n";
585 if(strcasecmp($xurl[$startat], $short)==0) {
594 echo "No such repo<br>";
599 // now we find an actual file
601 if(count($xurl) > $startat) for($i=$startat; $i < count($xurl); $i++) {
602 $file .= "/".$xurl[$i];
605 // now we want to find repostore/$matched/$file;
606 $actualfile = "$repostore/$matched/$file";
607 error_log("Atcualfile is $actualfile");
608 //echo "Start file for $actualfile\n";
610 // first check any directories in $file are in existence
611 $splfile = explode("/", $file);
612 if(count($splfile) > 1) {
613 $tomake = "$repostore/$matched/";
614 for($i = 0; $i < count($splfile)-1; $i++) {
615 $tomake .= "/".$splfile[$i];
616 //error_log("making directory $tomake");
617 if(!is_dir($tomake)) mkdir($tomake);
621 $reqhead = print_r($_REQUEST, true);
622 $sevhead = print_r($_SERVER, true);
624 error_log("req $reqhead");
625 error_log("sev $sevhead");
630 if(isset($_SERVER["HTTP_RANGE"])) {
632 $rangesa = explode("=", $_SERVER["HTTP_RANGE"]);
633 $rangesb = explode(",", $rangesa[1]);
634 $rangesstr = $rangesb[0];
635 $ranges = explode("-", $rangesb[0]);
636 $rangestart = $ranges[0];
637 $rangelength = $ranges[1] - $ranges[0] +1;
638 error_log("going ranges at $rangestart, $rangelength,".$rangesa[1].",".$rangesb[0]);
641 // i have to support http_range cause REDHAT/CENTOS IS annoying as all hell. christ, why do this?
642 if(is_file($actualfile)) {
643 // file is stored locally, away we go
644 if($rangelength != -1) {
645 header("HTTP/1.1 206 Partial Content");
646 header("Content-Length: ".$rangelength);
647 header("Content-Range: bytes $rangesstr/".filesize($actualfile));
648 //header("Content-Length: ".filesize($actualfile));
650 header("Content-Length: ".filesize($actualfile));
652 $type = mime_content_type($actualfile);
653 header("Content-type: $type");
654 $localfile = fopen($actualfile, "r");
655 if($rangestart!=-1) fseek($localfile, $rangestart, SEEK_SET);
656 while(!feof($localfile)) {
657 // cant make this high cause centos is crap
658 if($rangelength!=-1) {
659 $data = fread($localfile, $rangelength);
660 error_log("data size was ".strlen($data));
662 $data = fread($localfile, 2048);
668 if($rangelength!=-1) {
674 } else if(is_dir($actualfile)) {
675 //echo "in dir for $actualfile\n";
676 // here we print the contents of the directory
677 $this->printDir($actualfile, $file, $url);
680 //echo "in getcheck\n";
681 $remotefile = $uconf[$matched]["url"]."/$file";
683 // TODO: i should get remote contents with fopen/fread/fwrite as
684 // it should be more memory conservative and we can push to the end client
686 ignore_user_abort(true);
687 $rf = fopen($remotefile, "r");
688 error_log("attempting to get remote file $remotefile");
691 // hopefully this works. if we get a 30x message, it means we tried to get a directory
692 // i cant think of another way of dealing with it - but this is UGLY
693 // also get content length and content type
695 foreach($http_response_header as $key => $val) {
696 if(preg_match("/HTTP.*30[1-9].*/", $val)) {
697 error_log("got a 30x, must be a directory");
699 header("Location: ".$_SERVER["REQUEST_URI"]."/");
702 // get content length form upstream and print
703 if(preg_match("/^Content-Length:.*/", $val)) {
707 // get content type from upstream and print
708 if(preg_match("/^Content-Type:.*/", $val)) {
712 //error_log("repsonse: $http_response_header");
715 header("HTTP/1.0 404 Not Found");
717 $localfile = fopen($actualfile.".tmp.data.deleteme", "w");
718 $localsizefile = fopen($actualfile.".tmp.data.deleteme.size", "w");
719 fwrite($localsizefile, "$clen");
720 fclose($localsizefile);
722 $data = fread($rf, 8192);
724 fwrite($localfile, $data);
729 rename($actualfile.".tmp.data.deleteme", $actualfile);
730 //error_log("got actualfile, tried to save as $actualfile, did it work?");
734 //echo "got ".$file." for $url which is $actualfile\n";
736 //echo "</html></pre>";
739 function printDir($dir, $localfile, $baseurl)
741 $localfile = preg_replace("/\/\/+/", "/", $localfile);
742 $uri = $_SERVER["REQUEST_URI"];
745 $content .= "<html><head><title>Index of $localfile</title></head><body><h1>Index of $localfile</h1>";
746 $content .= "<table>";
748 while(($file = readdir($dh))!==false) {
749 if($file != "." && $file != "..") $content .= "<tr><td><a href=\"$uri/$file\">$file</a></td></tr>";
751 $content .= "</table></body></html>";
753 GLCASpageBuilder(null, null, $content);
758 function getRepoDetailsApt($url)
760 $action1 = $url."/dists";
762 // we just want to make sure it exists really
763 error_log("in repo details apt for $url");
764 if(!glcas_isRemoteDir($action1)) {
765 //echo "I cant find any valid APT dists's at $url<br>";
769 // ok, now scan for ubuntu dists as
770 $kos = getKnownOSList();
773 $existing_repo["isrepo"] = true;
774 foreach($kos["apt"] as $key => $val) {
775 //echo "<br>$key, $val<br>";
776 //echo "now check, $action1/$key";
777 if(glcas_isRemoteDir($action1."/$key")) {
778 $existing_repos["knownrepo"][$repos] = $key;
780 //echo "Found Distro $val<br>";
783 $existing_repos["nrepos"] = $repos;
784 $existing_repos["distros"] = "Ubuntu, Debian";
787 return $existing_repos;
791 function getRepoDetailsYum($url, $ismirrorlist=false)
793 $actionurl = $url."/repodata/repomd.xml";
795 error_log("Getting for action of $actionurl");
797 $ld = file_get_contents($actionurl);
799 // so here we try and get what this repository provides (os, version, arch), for yum this
800 // should come straight off the url... i.e. centos/6.0/os/x86_64/ (centos, 6.0, base os, 64bit arch)
802 if(!$ld) return false;
804 // ok, now we tokenize the url and try and guess at the content
805 $spurl = explode("/", $url);
807 // first, find the OS
808 $kos = getKnownOSList();
809 $glt["OS"] = "unknown";
810 $glt["verison"] = "unknown";
811 $glt["arch"] = "unknown";
812 $glt["other"] = "unknown";
813 foreach($spurl as $comp) {
816 foreach($kos["os"]["short"] as $kosname => $koslong) {
817 //error_log("Comparing $kosname and $koslong with $comp");
818 if(strcasecmp($kosname, $comp) == 0) {
819 //error_log("got $kosname, $koslong for $comp in $url");
820 //echo "<pre>inone\n"; print_r($koslong); echo "</pre>";
821 $glt["OS"] = $koslong;
825 // find a version, we assume its going to be something [numbers] and a . (optional)
826 if(preg_match("/^[0-9.]+$/", $comp)>0) {
827 //error_log("version match of $comp");
828 $glt["version"] = $comp;
831 // 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
832 foreach($kos["arch"] as $archinter => $archname ) {
833 //error_log("Comparing $archinter, $archname with $comp");
834 if(strcasecmp($archname, $comp) == 0) {
835 //error_log("arch match of $archname with $comp");
836 $glt["arch"] = $archname;
840 // other is a bt harder, we really have to guess at this one
841 if(strcasecmp("os", $comp) == 0) $glt["other"] = "OS";
842 if(strcasecmp("update", $comp) == 0) $glt["other"] = "Updates";
843 if(strcasecmp("updates", $comp) == 0) $glt["other"] = "Updates";
844 if(strcasecmp("everything", $comp) == 0) $glt["other"] = "OS";
851 function deleteRepo($rkey)
853 $uconf = $this->config->getConfigVar("repodata");
854 $repostore = $this->config->getConfigVar("storagelocation");
856 if($uconf !== false) {
857 $conf = unserialize($uconf);
858 foreach($conf as $key => $vla) {
860 unset($conf["$rkey"]);
861 $nconf = serialize($conf);
862 system("rm -rf $repostore/$key");
863 error_log("remove repo as $rkey");
864 $this->config->setConfigVar("repodata", $nconf);
865 $this->config->saveConfig();
871 function addRepo($desc, $os, $version, $arch, $other, $shorturl, $prefix, $repurl, $repotype, $init, $expiretime)
873 $uconf = $this->config->getConfigVar("repodata");
877 $cs["version"] = $version;
879 $cs["other"] = $other;
880 $cs["shorturl"] = $shorturl;
881 $cs["prefix"] = $prefix;
882 $cs["url"] = $repurl;
883 $cs["repotype"] = $repotype;
884 $cs["expiretime"] = $expiretime;
888 if($uconf !== false) {
889 $conf = unserialize($uconf);
890 foreach($conf as $key => $val) {
898 $nconf = serialize($conf);
900 error_log("add repo as $ckey");
901 $this->config->setConfigVar("repodata", $nconf);
902 $this->config->saveConfig();
904 // now create the base structure in the repo
905 $repostore = $this->config->getConfigVar("storagelocation");
908 // now call update repo
909 if($init) $this->updateRepoYum($ckey);
912 function updateRepo($repokey)
914 // we only do yum yet
915 $this->updateRepoYum($repokey);
918 function updateRepoYum($repokey)
920 $repostore = $this->config->getConfigVar("storagelocation");
922 $repod = $this->getRepo($repokey);
924 $repourl = $repod["url"];
926 if(!file_exists("$repostore/$repokey")) {
927 mkdir("$repostore/$repokey");
930 if(!file_exists("$repostore/$repokey/repodata")) {
931 mkdir("$repostore/$repokey/repodata");
934 error_log("background yum repo update, start");
935 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
936 if(file_exists("$WEB_ROOT_FS/../bin/downloadfile.php")) {
937 $scall = "/usr/bin/php $WEB_ROOT_FS/../bin/updateyumrepo.php '$repourl' '$repostore/$repokey/' > /tmp/updateyumrepo.$repokey.log 2>&1 &";
940 error_log("cant find download yum helper... dieing");
944 //ignore_user_abort(true);
947 function getRepo($id)
949 $uconf = $this->config->getConfigVar("repodata");
950 if($uconf !== false) {
951 $lconf = unserialize($uconf);
959 $uconf = $this->config->getConfigVar("repodata");
960 if($uconf !== false) {
961 return unserialize($uconf);