function __construct($config)
{
$this->config = $config;
- if($this->config->getConfigVar("storagelocation") == false) {
+ if($this->config->getConfig("storagelocation") == false) {
global $WEB_ROOT_FS;
$storloc = "$WEB_ROOT_FS/../var/glcas/cache/";
if(!file_exists($storloc)) mkdir($storloc);
- $this->config->setConfigVar("storagelocation", realpath($storloc));
- $this->config->saveConfig();
+ $this->config->setConfig("storagelocation", realpath($storloc));
error_log("set storage location, $storloc");
}
}
+
+ // with the move to the sqlite db, this is going to get painful
function cron()
{
//echo "<pre>";
- $uconf = unserialize($this->config->getConfigVar("repodata"));
- $repostore = $this->config->getConfigVar("storagelocation");
+ $uconf = unserialize($this->config->getConfig("repodata"));
+ $repostore = $this->config->getConfig("storagelocation");
//print_r($uconf);
//echo "</pre>";
echo " - Expire time not set, setting to 2 days by default<br>";
$uconf[$rkey]["expiretime"] = 2;
$repo["expiretime"] = 2;
- $this->config->setConfigVar("repodata", serialize($uconf));
+ $this->config->setConfig("repodata", serialize($uconf));
$this->config->saveConfig();
}
if(!isset($repo["repotype"])) {
echo "<font color=\"red\">Repo type not set for repo, setting to yum</font><br>";
$uconf[$rkey]["repotype"] = "YUM";
- $this->config->setConfigVar("repodata", serialize($uconf));
+ $this->config->setConfig("repodata", serialize($uconf));
$this->config->saveConfig();
} else if($repo["repotype"] == "YUM") {
if($repofrozen) {
$xurl = split("[/,]", $url);
// first get the config
- $uconf = unserialize($this->config->getConfigVar("repodata"));
- $repostore = $this->config->getConfigVar("storagelocation");
+ $uconf = unserialize($this->config->getConfig("repodata"));
+ $repostore = $this->config->getConfig("storagelocation");
// preset matched to -1
$matched = -1;
function serveUpFile($actualfile, $repoid)
{
- $uconf = unserialize($this->config->getConfigVar("repodata"));
- $repostore = $this->config->getConfigVar("storagelocation");
+ $uconf = unserialize($this->config->getConfig("repodata"));
+ $repostore = $this->config->getConfig("storagelocation");
// figure out the range header garbage that centos/redhat send
if(isset($_SERVER["HTTP_RANGE"])) {
clearstatcache();
// get the configurations we need
- $uconf = unserialize($this->config->getConfigVar("repodata"));
- $repostore = $this->config->getConfigVar("storagelocation");
+ $uconf = unserialize($this->config->getConfig("repodata"));
+ $repostore = $this->config->getConfig("storagelocation");
function freezeRepo($rkey)
{
- $uconf = $this->config->getConfigVar("repodata");
- $repostore = $this->config->getConfigVar("storagelocation");
+ $uconf = $this->config->getConfig("repodata");
+ $repostore = $this->config->getConfig("storagelocation");
if($uconf !== false) {
$conf = unserialize($uconf);
}
$nconf = serialize($conf);
error_log("freeze repo as $rkey");
- $this->config->setConfigVar("repodata", $nconf);
+ $this->config->setConfig("repodata", $nconf);
$this->config->saveConfig();
}
}
function deleteRepo($rkey)
{
- $uconf = $this->config->getConfigVar("repodata");
- $repostore = $this->config->getConfigVar("storagelocation");
+ $uconf = $this->config->getConfig("repodata");
+ $repostore = $this->config->getConfig("storagelocation");
if($uconf !== false) {
$conf = unserialize($uconf);
$nconf = serialize($conf);
system("rm -rf $repostore/$key");
error_log("remove repo as $rkey");
- $this->config->setConfigVar("repodata", $nconf);
+ $this->config->setConfig("repodata", $nconf);
$this->config->saveConfig();
}
}
function addRepo($desc, $os, $version, $arch, $other, $shorturl, $prefix, $repurl, $repotype, $init, $expiretime, $blocklist=null)
{
- $uconf = $this->config->getConfigVar("repodata");
+ $uconf = $this->config->getConfig("repodata");
$cs["desc"] = $desc;
$cs["os"] = $os;
$nconf = serialize($conf);
error_log("add repo as $ckey");
- $this->config->setConfigVar("repodata", $nconf);
+ $this->config->setConfig("repodata", $nconf);
$this->config->saveConfig();
// now create the base structure in the repo
- $repostore = $this->config->getConfigVar("storagelocation");
+ $repostore = $this->config->getConfig("storagelocation");
// now call update repo
function updateRepoApt($repokey)
{
- $repostore = $this->config->getConfigVar("storagelocation");
+ $repostore = $this->config->getConfig("storagelocation");
$repod = $this->getRepo($repokey);
function updateRepoYum($repokey)
{
- $repostore = $this->config->getConfigVar("storagelocation");
+ $repostore = $this->config->getConfig("storagelocation");
$repod = $this->getRepo($repokey);
function getRepo($id)
{
- $uconf = $this->config->getConfigVar("repodata");
+ $uconf = $this->config->getConfig("repodata");
if($uconf !== false) {
$lconf = unserialize($uconf);
return $lconf[$id];
function getRepos()
{
- $uconf = $this->config->getConfigVar("repodata");
+ $uconf = $this->config->getConfig("repodata");
if($uconf !== false) {
return unserialize($uconf);
} else return false;