2 $URL_HANDLERS["*"] = "GLCASRepo";
4 $CRON_CLASSES["GLCASRepo"] = "GLCASRepo";
7 function __construct($config)
9 $this->config = $config;
10 if($this->config->getConfig("storagelocation") == false) {
12 $storloc = "$WEB_ROOT_FS/../var/glcas/cache/";
13 if(!file_exists($storloc)) mkdir($storloc);
14 $this->config->setConfig("storagelocation", realpath($storloc));
15 error_log("set storage location, $storloc");
20 // with the move to the sqlite db, this is going to get painful
24 $uconf = unserialize($this->config->getConfig("repodata"));
25 $repostore = $this->config->getConfig("storagelocation");
29 foreach($uconf as $rkey => $repo) {
30 echo "Repo $rkey: ".$repo["desc"]."<br>";
31 if(isset($repo["frozen"])) {
32 error_log("repo froze set");
33 $repofrozen = $repo["frozen"];
35 error_log("repo froze not set");
38 if(!isset($repo["expiretime"])) {
39 echo " - Expire time not set, setting to 2 days by default<br>";
40 $uconf[$rkey]["expiretime"] = 2;
41 $repo["expiretime"] = 2;
42 $this->config->setConfig("repodata", serialize($uconf));
43 $this->config->saveConfig();
46 if(!isset($repo["repotype"])) {
47 echo "<font color=\"red\">Repo type not set for repo, setting to yum</font><br>";
48 $uconf[$rkey]["repotype"] = "YUM";
49 $this->config->setConfig("repodata", serialize($uconf));
50 $this->config->saveConfig();
51 } else if($repo["repotype"] == "YUM") {
53 error_log("repo frozen");
54 echo " - <font color=\"blue\">Repo Frozen</font><br>";
56 if(file_exists("$repostore/$rkey/repodata/repoupdate.lock")) {
57 echo " - <font color=\"red\">Repo locked for update</font><br>";
61 // we still do this next bit, even if its locked because it may be a stray file
62 echo " - Expire time is ".$repo["expiretime"]." days, checking repo<br>";
63 error_log("checking $repostore/$rkey/repodata/repomd.xml");
64 $tdiff = time() - filemtime("$repostore/$rkey/repodata/repomd.xml");
65 $maxtdiff = $repo["expiretime"] * 24 * 3600;
66 if($tdiff > $maxtdiff) {
67 echo " - <font color=\"green\">updating repo</font><br>";
68 $this->updateRepo($rkey);
70 echo " - not updating repo<br>";
73 } else if($repo["repotype"] == "APT") {
75 error_log("repo frozen");
76 echo " - <font color=\"blue\">Repo Frozen</font><br>";
78 if(file_exists("$repostore/$rkey/update.lock")) {
79 echo " - <font color=\"red\">Repo locaked for update</font><br>";
81 echo " - Expire time is ".$repo["expiretime"]." days, checking repo<br>";
82 $maxtdiff = $repo["expiretime"] * 24 * 3600;
83 // now we check for outdated release files
84 $dh = opendir("$repostore/$rkey/dists/");
86 while(($fn = readdir($dh))!==false) {
87 if($fn != "." && $fn != "..") {
88 if(file_exists("$repostore/$rkey/dists/$fn/Release")) {
89 $tdiff = time() - filemtime("$repostore/$rkey/dists/$fn/Release");
90 if($tdiff > $maxtdiff) $needsupdate = true;
95 echo " - Spawn updater<br>";
96 $this->updateRepo($rkey);
98 echo " - Up to date<br>";
107 error_log("repo:go called");
109 // figure out what we're doing
112 GLCASpageBuilder($this, "body");
115 $this->getRepoForUrl($url);
121 // this is how this will work
122 //$this->decodeUrl();
123 if(strncasecmp("list", $url, 4)==0) {
124 echo "i am the repo list";
127 echo "i am the repo, $url";
131 // TODO: rework this function
133 * What i need to do is have a downloader function
134 * that can cope with lots of different shit
135 * but thats a pipe dream
137 * what *THIS* function needs to do is
138 * 1) figure out the repo
139 * 2) figure out the file in the repo
140 * 2.1) if its a directory, go to print directory
141 * 3) if the file exists, give it to the user (if a range is specified give the user the range)
142 * 4) if the file does not exist
143 * - check if a tmp file exists
144 * - attempt to get an exclusive flock
145 * - if flock fails, donwload in progress
146 * - if flock succeeds, truncate file and re-start download
147 * - if a range request was made, send the range once available
148 * - if range not available, sleep for 5 and check again.
150 * I dont want to code this from scratch, but i probably need to
152 function getRepoForUrl($url)
154 $xurl = split("[/,]", $url);
156 // first get the config
157 $uconf = unserialize($this->config->getConfig("repodata"));
158 $repostore = $this->config->getConfig("storagelocation");
160 // preset matched to -1
163 // first we check for /repo/repoid as a url
165 if($xurl[0] == "repo") {
167 error_log("trying to get repo for repoid, $repid");
168 if(isset($uconf[$repid])) {
169 $matched = ((int)($repid));
170 error_log("set matched, $matched, $repid");
175 // now check for a prefix match
177 if($matched < 0) foreach($uconf as $key => $var) {
178 $pre = $var["prefix"];
181 //echo "Checking pre $pre against ".$xurl[0]."\n";
182 if(strcasecmp($pre, $xurl[0])==0) {
183 //echo "Matched pre\n";
190 // next, check for a short url match
191 if($matched < 0) foreach($uconf as $key => $var) {
192 // if we matched a pre, then we check against the second url component
194 $short = $var["shorturl"];
197 //echo "Checking short $short against ".$xurl[$startat]."\n";
198 if(strcasecmp($xurl[$startat], $short)==0) {
206 // TODO: this deterministic bit
207 // so far nothing has matched - what this next bit needs to do is try and "Determine" a repo from url
208 // for eg, if a user gets /fedora/x86_64/os we need to return something appropriate
210 echo "No such repo<br>";
211 header("HTTP/1.0 404 Not Found");
217 // something was matched, so now we reconstruct the file component of the url
219 if(count($xurl) > $startat) for($i=$startat; $i < count($xurl); $i++) {
220 $file .= "/".$xurl[$i];
223 // so, the ultimate url for the file we need is:
224 $actualfile = "$repostore/$matched/$file";
225 error_log("Atcualfile is $actualfile");
227 // now check for a block in that repo
228 if(isset($uconf[$matched]["blocklist"])) {
229 foreach($uconf[$matched]["blocklist"] as $blockers) {
230 $rfile = ltrim($file, "/");
231 error_log("checking $blockers against $rfile");
232 if(preg_match("/$blockers/", $rfile) > 0) {
233 error_log("should block");
234 header("HTTP/1.0 404 Not Found");
240 // if its a directory, lets do a print
241 if(is_dir($actualfile)) {
242 $this->printDir($actualfile, $file, $url);
246 // check if the file exists and serve it up
247 if(file_exists($actualfile) && !file_exists("$actualfile.size")) {
248 $this->serveUpFile($actualfile, $matched);
251 // the file does not exist, we now need to go into "download" mode
252 $remoteurl = $uconf[$matched]["url"]."/$file";
253 $this->downloadAndServe($actualfile, $matched, $remoteurl);
258 function serveUpFile($actualfile, $repoid)
260 $uconf = unserialize($this->config->getConfig("repodata"));
261 $repostore = $this->config->getConfig("storagelocation");
263 // figure out the range header garbage that centos/redhat send
264 if(isset($_SERVER["HTTP_RANGE"])) {
265 // we're using ranges - screw you stupid installer
266 $pr_range = preg_split("/[:\-=, ]+/", $_SERVER["HTTP_RANGE"]);
269 $rangestart = $pr_range[1];
270 $rangelength = $pr_range[2] - $pr_range[1] +1;
271 $rangestr = $pr_range[1]."-".$pr_range[2];
272 error_log("going ranges at $rangestart, $rangelength,".$rangesa[1].",".$rangesb[0]);
274 // now spit some headers
275 header("HTTP/1.1 206 Partial Content");
276 header("Content-Length: ".$rangelength);
279 header("Content-Range: bytes $rangestr/".filesize($actualfile));
281 // determine mime type
282 $type = mime_content_type($actualfile);
284 // set mime type header
285 header("Content-type: $type");
287 // open the local file (TODO: error check)
288 $localfile = fopen($actualfile, "r");
289 fseek($localfile, $rangestart, SEEK_SET);
291 // read in the data, god i hope its not big
292 $data = fread($localfile, $rangelength);
298 // and close the file
303 // we're not using range's - good on you installer thingy
304 header("Content-Length: ".filesize($actualfile));
306 // set the mime type header
307 $type = mime_content_type($actualfile);
308 header("Content-type: $type");
310 // open the local file
311 $localfile = fopen($actualfile, "r");
313 error_log("normal upload went barf");
317 // iterate over its length, send 8k at a time
318 while(!feof($localfile)) {
319 // read and send data
320 $data = fread($localfile, 32768);
323 // flush so the client sees the data
333 // TODO: this is the function im working on
334 // the alternative to this function is that if a file is in the process of being
335 // downloaded, we simply serve from upstream... not a good idea tho unless we create
336 // a local proxy right here - this function is a race condition waiting to be had
337 // lets hope its a good one!
338 function downloadAndServe($filename, $repoid, $remoteurl)
341 $this->startDownload($filename, $remoteurl);
343 // give the proc a minute to get going
347 // get the configurations we need
348 $uconf = unserialize($this->config->getConfig("repodata"));
349 $repostore = $this->config->getConfig("storagelocation");
353 // determine if we're ranged
358 if(isset($_SERVER["HTTP_RANGE"])) {
359 // we're using ranges - screw you stupid installer
361 $pr_range = preg_split("/[:\-=, ]+/", $_SERVER["HTTP_RANGE"]);
362 error_log("got range ".$_SERVER["HTTP_RANGE"]." and ".print_r($pr_range, true));
365 $rangestart = $pr_range[1];
366 $rangelength = $pr_range[2] - $pr_range[1] +1;
367 $rangestr = $pr_range[1]."-".$pr_range[2];
368 error_log("going ranges at $rangestart, $rangelength, $rangestr");
372 // open the local files
374 // now, lets determine what state we're in
375 // we're either - getting and sending
376 // watching and sending
377 // or a range (Getting and sending)
378 // or a range (watching and sending)
379 // TODO: it may be advicable to start the download as a seperate cli process rather then something goin on here
380 // so it definitely cant be interrupted.
382 // check for a 404 file and wait 2 if it exists - i should really check the timestamp for an updated
383 // file, but thats too much effort for now: TODO: check timestamp on 404 file
385 while(!file_exists("$filename")) {
389 error_log("Sleeping waiting for file");
391 // if 404 file exists, we wait much less time
392 if(file_exists("$filename.404") && $slept > 2) {
393 header("HTTP/1.0 404 Not Found");
397 header("HTTP/1.0 404 Not Found");
403 if(is_dir($filename)) {
405 header("Location: ".$_SERVER["REQUEST_URI"]."/");
410 // first, getting and sending - this is easy.
413 $localfile = fopen($filename, "r");
415 // this is where the fun starts - but this one isnt too bad.
416 error_log("OTHERDOWNLOAD: im another downloader, please work");
417 if(file_exists("$filename.size")) $fsize = file_get_contents("$filename.size");
418 else $fsize = filesize($filename);
419 header("Content-Length: $fsize");
421 while(!feof($localfile)) {
422 $data = fread($localfile, 2048);
424 error_log("dollardata is pair shaped");
426 $sgotten += strlen($data);
427 if($sgotten > $fsize) {
428 error_log("went plop at sgotten, $sgotten, $fsize");
437 // need to think about this in pseudo code.
438 // 1. close the file and wait for it to get to $sgotten + 2048 or $fsize
439 $cursize = filesize($filename);
441 $upload_finished = false;
442 while(!$upload_finished) {
443 while($cursize < $fsize && $cursize < ($sgotten+2048)) {
445 error_log("OTHERDOWNLOAD: halt, $cursize, $sgotten, $fsize");
446 // sleep until the the filesize is greater then what we're up to, or until the file is finished
448 $cursize = filesize($filename);
451 error_log("OTHERDOWNLOAD: continue, $sgotten, $fsize");
452 // reopen local file - if it stopped existing, we need to deal with that
453 $localfile = fopen($filename, "r");
455 // UG, we need to ff, how could i forget that
456 fseek($localfile, $sgotten);
459 error_log("OTHERDOWNLOAD: something went plop");
463 // now loop on the file until we have it at an eof
464 while(!feof($localfile)) {
465 $data = fread($localfile, 512);
467 error_log("OTHERDOWNLOAD: dollar data went plop");
469 $sgotten += strlen($data);
476 if($sgotten >= $fsize) {
477 if($sgotten > $fsize) error_log("OTHERDOWNLOADER: finished but $sgotten, $fsize doesnt make senze");
478 $upload_finished = true;
483 error_log("OTHERDOWNLOADER: done with");
492 // and here too, yay, someone else is doing the
493 // download, but we're the retards getting a range
496 $sgatlen = $rangestart+$rangelength;
498 // the problem is here
499 error_log("Downloader: going ranged as other");
501 if(file_exists($filename.".tmp.data.deleteme.size")) $contentlen = file_get_contents($filename.".tmp.data.deleteme.size");
502 else $contentlen = filesize($filename);
503 $contenttype = mime_content_type($filename);
504 header("HTTP/1.1 206 Partial Content");
505 header("Content-Length: $rangelength");
506 header("Content-Range: bytes $rangestr/$contentlen");
507 $contenttype = "Content-Type: application/x-rpm";
509 error_log("$contenttype");
510 header("$contenttype");
516 // first we wait until the file reaches $rangestart
517 while(filesize("$filename") < $rangestart) {
521 // then we open the file and ff to rangestart
522 $localfile = fopen($filename, "r");
523 fseek($localfile, $rangestart);
526 // need to think about this in pseudo code.
527 // 1. close the file and wait for it to get to $sgotten + 2048 or $fsize
528 $cursize = filesize($filename);
531 $upload_finished = false;
532 while(!$upload_finished) {
533 while($cursize < $sgatlen && $cursize < ($sgotten+2048)) {
535 error_log("OTHERDOWNLOAD: halt, $cursize, $sgotten, $contentlen");
536 // sleep until the the filesize is greater then what we're up to, or until the file is finished
538 $cursize = filesize($filename);
541 error_log("OTHERDOWNLOAD: continue, $sgotten, $contentlen");
542 // reopen local file - if it stopped existing, we need to deal with that
543 $localfile = fopen($filename, "r");
545 // UG, we need to ff, how could i forget that
546 fseek($localfile, $sgotten+$rangestart);
549 error_log("OTHERDOWNLOAD: something went plop");
553 // now loop on the file until we have it at sgatlen
554 while(!feof($localfile) && $sgotten < $rangelength) {
555 $left = $rangelength - $sgotten;
556 if($left > 512) $lenget = 512;
557 else $lenget = $left;
558 $data = fread($localfile, $lenget);
560 error_log("OTHERDOWNLOAD: dollar data went plop");
562 $sgotten += strlen($data);
569 if($sgotten >= $rangelength) {
570 if($sgotten > $rangelength) error_log("OTHERDOWNLOADER: finished but $sgotten, $fsize doesnt make senze");
571 $upload_finished = true;
576 error_log("OTHERDOWNLOADER: done with");
586 function startDownload($file, $url)
589 error_log("background downloader, start");
590 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
591 if(file_exists("$WEB_ROOT_FS/../bin/downloadfile.php")) {
592 $scall = "/usr/bin/php $WEB_ROOT_FS/../bin/downloadfile.php '$url' '$file' > /tmp/dllog 2>&1 &";
595 error_log("cant find download helper... dieing");
599 // this is a nightmare
602 function printDir($dir, $localfile, $baseurl)
604 $localfile = preg_replace("/\/\/+/", "/", $localfile);
605 $uri = $_SERVER["REQUEST_URI"];
608 $content .= "<html><head><title>Index of $localfile</title></head><body><h1>Index of $localfile</h1>";
609 $content .= "<table>";
613 while(($file = readdir($dh))!==false) {
614 if($file != "." && $file != "..") {
615 if(is_dir("$dir/$file")) {
616 $dirlist[$dirn++] = "$file";
618 $filelist[$filen++] = "$file";
622 if(isset($dirlist)) {
624 foreach($dirlist as $dirs) {
625 $icon = "/icons/folder.png";
626 $content .= "<tr><td><img src=\"$icon\"></td><td><a href=\"$uri/$dirs\">$dirs</a></td><td></td></tr>";
629 if(isset($filelist)) {
631 foreach($filelist as $files) {
632 $fsize = filesize("$dir/$files");
633 $icon = "/icons/text.png";
634 $content .= "<tr><td><img src=\"$icon\"></td><td><a href=\"$uri/$files\">$files</a></td><td>$fsize</td></tr>";
637 $content .= "</table></body></html>";
639 GLCASpageBuilder(null, null, $content);
644 function getRepoDetailsApt($url)
646 $action1 = $url."/dists";
648 // we just want to make sure it exists really
649 error_log("in repo details apt for $url");
650 if(!glcas_isRemoteDir($action1)) {
651 //echo "I cant find any valid APT dists's at $url<br>";
655 // ok, now scan for ubuntu dists as
656 $kos = getKnownOSList();
659 $existing_repo["isrepo"] = true;
660 foreach($kos["apt"] as $key => $val) {
661 //echo "<br>$key, $val<br>";
662 //echo "now check, $action1/$key";
663 if(glcas_isRemoteDir($action1."/$key")) {
664 $existing_repos["knownrepo"][$repos]["name"] = $key;
665 //echo "Found Distro $val<br>";
666 if(glcas_fileExists($action1."/$key/Contents-amd64.gz")) $existing_repos["knownrepo"][$repos]["amd64"] = true;
667 else $existing_repos["knownrepo"][$repos]["amd64"] = false;
668 if(glcas_fileExists($action1."/$key/Contents-i386.gz")) $existing_repos["knownrepo"][$repos]["i386"] = true;
669 else $existing_repos["knownrepo"][$repos]["i386"] = false;
674 $existing_repos["nrepos"] = $repos;
676 // TODO: these need to be "calculated"
677 $existing_repos["distros"] = "Ubuntu, Debian";
678 $existing_repos["versions"] = "8.04LTS, 9.10, 10.04LTS, 10.10, 11.04, 11.10";
679 $existing_repos["arch"] = "x86_64, i386";
682 return $existing_repos;
686 function getRepoDetailsYum($url, $ismirrorlist=false)
688 $actionurl = $url."/repodata/repomd.xml";
690 error_log("Getting for action of $actionurl");
692 $ld = file_get_contents($actionurl);
694 // so here we try and get what this repository provides (os, version, arch), for yum this
695 // should come straight off the url... i.e. centos/6.0/os/x86_64/ (centos, 6.0, base os, 64bit arch)
697 if(!$ld) return false;
699 // ok, now we tokenize the url and try and guess at the content
700 $spurl = explode("/", $url);
702 // first, find the OS
703 $kos = getKnownOSList();
704 $glt["OS"] = "unknown";
705 $glt["verison"] = "unknown";
706 $glt["arch"] = "unknown";
707 $glt["other"] = "unknown";
708 foreach($spurl as $comp) {
711 foreach($kos["os"]["short"] as $kosname => $koslong) {
712 //error_log("Comparing $kosname and $koslong with $comp");
713 if(strcasecmp($kosname, $comp) == 0) {
714 //error_log("got $kosname, $koslong for $comp in $url");
715 //echo "<pre>inone\n"; print_r($koslong); echo "</pre>";
716 $glt["OS"] = $koslong;
720 // find a version, we assume its going to be something [numbers] and a . (optional)
721 if(preg_match("/^[0-9.]+$/", $comp)>0) {
722 //error_log("version match of $comp");
723 $glt["version"] = $comp;
726 // 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
727 foreach($kos["arch"] as $archinter => $archname ) {
728 //error_log("Comparing $archinter, $archname with $comp");
729 if(strcasecmp($archname, $comp) == 0) {
730 //error_log("arch match of $archname with $comp");
731 $glt["arch"] = $archname;
735 // other is a bt harder, we really have to guess at this one
736 if(strcasecmp("os", $comp) == 0) $glt["other"] = "OS";
737 if(strcasecmp("update", $comp) == 0) $glt["other"] = "Updates";
738 if(strcasecmp("updates", $comp) == 0) $glt["other"] = "Updates";
739 if(strcasecmp("everything", $comp) == 0) $glt["other"] = "OS";
746 function freezeRepo($rkey)
749 $uconf = $this->config->getConfig("repodata");
750 $repostore = $this->config->getConfig("storagelocation");
752 if($uconf !== false) {
753 $conf = unserialize($uconf);
754 foreach($conf as $key => $vla) {
756 if(isset($conf["$rkey"]["frozen"])) {
757 if($conf["$rkey"]["frozen"]) {
758 $conf["$rkey"]["frozen"] = false;
759 error_log("Unfreeze repo");
761 $conf["$rkey"]["frozen"] = true;
762 error_log("freeze repo");
765 $conf["$rkey"]["frozen"] = true;
767 $nconf = serialize($conf);
768 error_log("freeze repo as $rkey");
769 $this->config->setConfig("repodata", $nconf);
770 $this->config->saveConfig();
776 function deleteRepo($rkey)
778 $uconf = $this->config->getConfig("repodata");
779 $repostore = $this->config->getConfig("storagelocation");
781 if($uconf !== false) {
782 $conf = unserialize($uconf);
783 foreach($conf as $key => $vla) {
785 unset($conf["$rkey"]);
786 $nconf = serialize($conf);
787 system("rm -rf $repostore/$key");
788 error_log("remove repo as $rkey");
789 $this->config->setConfig("repodata", $nconf);
790 $this->config->saveConfig();
796 function addRepo($desc, $os, $version, $arch, $other, $shorturl, $prefix, $repurl, $repotype, $init, $expiretime, $blocklist=null)
798 $uconf = $this->config->getConfig("repodata");
802 $cs["version"] = $version;
804 $cs["other"] = $other;
805 $cs["shorturl"] = $shorturl;
806 $cs["prefix"] = $prefix;
807 $cs["url"] = $repurl;
808 $cs["repotype"] = $repotype;
809 $cs["expiretime"] = $expiretime;
810 if($blocklist != null) {
811 $cs["blocklist"] = $blocklist;
816 if($uconf !== false) {
817 $conf = unserialize($uconf);
818 foreach($conf as $key => $val) {
826 $nconf = serialize($conf);
828 error_log("add repo as $ckey");
829 $this->config->setConfig("repodata", $nconf);
830 $this->config->saveConfig();
832 // now create the base structure in the repo
833 $repostore = $this->config->getConfig("storagelocation");
836 // now call update repo
837 if($init) $this->updateRepoYum($ckey);
840 function updateRepo($repokey)
842 // we only do yum yet
843 $repod = $this->getRepo($repokey);
844 if(isset($repod["frozen"])) if($repod["frozen"]) {
845 error_log("in update repo for frozen repo, ignore update");
849 error_log("in update repo");
851 if($repod["repotype"] == "YUM") $this->updateRepoYum($repokey);
852 if($repod["repotype"] == "APT") $this->updateRepoApt($repokey);
855 function updateRepoApt($repokey)
857 $repostore = $this->config->getConfig("storagelocation");
859 $repod = $this->getRepo($repokey);
861 $repourl = $repod["url"];
863 if(!file_exists("$repostore/$repokey")) {
864 mkdir("$repostore/$repokey");
867 if(!file_exists("$repostore/$repokey/dists/")) {
868 mkdir("$repostore/$repokey/dists/");
869 // no point trying to update if we have no dists directory
874 error_log("background apt repo update, start");
875 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
876 if(file_exists("$WEB_ROOT_FS/../bin/downloadfile.php")) {
877 $scall = "/usr/bin/php $WEB_ROOT_FS/../bin/updateaptrepo.php '$repourl' '$repostore/$repokey/' > /tmp/updateaptrepo.$repokey.log 2>&1 &";
880 error_log("cant find download apt helper... dieing");
884 function updateRepoYum($repokey)
886 $repostore = $this->config->getConfig("storagelocation");
888 $repod = $this->getRepo($repokey);
890 $repourl = $repod["url"];
892 if(!file_exists("$repostore/$repokey")) {
893 mkdir("$repostore/$repokey");
896 if(!file_exists("$repostore/$repokey/repodata")) {
897 mkdir("$repostore/$repokey/repodata");
900 error_log("background yum repo update, start");
901 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
902 if(file_exists("$WEB_ROOT_FS/../bin/downloadfile.php")) {
903 $scall = "/usr/bin/php $WEB_ROOT_FS/../bin/updateyumrepo.php '$repourl' '$repostore/$repokey/' > /tmp/updateyumrepo.$repokey.log 2>&1 &";
906 error_log("cant find download yum helper... dieing");
910 //ignore_user_abort(true);
913 function getRepo($id)
915 $uconf = $this->config->getConfig("repodata");
916 if($uconf !== false) {
917 $lconf = unserialize($uconf);
925 $uconf = $this->config->getConfig("repodata");
926 if($uconf !== false) {
927 return unserialize($uconf);