Хранилища Subversion ant

Сравнить редакции

Не учитывать пробелы Редакция 617 → Редакция 618

/branches/ant/0.9.x/lib/core.php
2066,6 → 2066,114
return $result;
}
 
/**
* Обновление информации о репозитории
*
* @author Alexander Wolf
* @category Core
*
* @param integer $repID
* @param integer $verionID
* @param string $rname
* @param string $rinfo
* @param string $rkey
* @param integer $proto
* @param integer $rhost
* @param integer $rfolder
* @param integer $rtype
* @param array $sections
* @param array $arch
* @param integer $scheme
* @param integer $sign
* @return array
*/
public function updateRepository($repID, $verionID, $rname, $rinfo, $rkey, $proto, $rhost, $rfolder, $rtype, $scheme, $sign, $sections, $arch) {
$result = array();
$sRepID = $this->secure->checkInt($repID);
$sVersionID = $this->secure->checkInt($verionID);
$sRName = $this->secure->checkStr($rname);
$sRInfo = $this->secure->checkStr($rinfo);
$sRKey = $this->secure->checkStr($rkey);
$sProto = $this->secure->checkInt($proto);
$sRHost = $this->secure->checkInt($rhost);
$sRFolder = $this->secure->checkInt($rfolder);
$sRType = $this->secure->checkInt($rtype);
$sRScheme = $this->secure->checkInt($scheme);
$sRSign = $this->secure->checkInt($sign);
 
$query = "UPDATE ".$this->prefix."repository SET proto_id='".$sProto."', rhost_id='".$sRHost."', rfolder_id='".$sRFolder."', version='".$sVersionID."', rtype_id='".$sRType."', scheme_id='".$sRScheme."', sign_id='".$sRSign."', repname='".$sRName."', repinfo='".$sRInfo."', repkey='".$sRKey."' WHERE rep_id='".$sRepID."'";
$rq =& $this->db->query($query);
 
$query = "DELETE FROM ".$this->prefix."sect2rep WHERE rep_id='".$sRepID."'";
$rq =& $this->db->query($query);
for($i=0;$i<count($sections);$i++) {
$query = "INSERT INTO ".$this->prefix."sect2rep SET rep_id='".$sRepID."', sect_id='".$sections[$i]."'";
$rq =& $this->db->query($query);
}
 
$query = "DELETE FROM ".$this->prefix."arch2rep WHERE rep_id='".$sRepID."'";
$rq =& $this->db->query($query);
for($i=0;$i<count($arch);$i++) {
$query = "INSERT INTO ".$this->prefix."arch2rep SET rep_id='".$sRepID."', arch_id='".$arch[$i]."'";
$rq =& $this->db->query($query);
}
 
if (PEAR::isError($this->db)) {
$result["ERR"] = 1;
$result["ERRINFO"] = $this->db->getMessage();
} else {
$result["ERR"] = 0;
}
 
return $result;
}
 
/**
* Удаление информации о репозитории
*
* @author Alexander Wolf
* @category Core
*
* @param integer $repID
* @return array
*/
public function dropRepository($repID) {
$result = array();
$sRepID = $this->secure->checkInt($repID);
 
// Удаление репозитория
$query = "DELETE FROM ".$this->prefix."repository WHERE rep_id='".$sRepID."'";
$rq =& $this->db->query($query);
if (PEAR::isError($this->db)) {
$result["ERR"] = 1;
$result["ERRINFO"] = $this->db->getMessage();
} else {
$result["ERR"] = 0;
}
 
// Удаление секций репозитория
$query = "DELETE FROM ".$this->prefix."sect2rep WHERE rep_id='".$sRepID."'";
$rq =& $this->db->query($query);
if (PEAR::isError($this->db)) {
$result["ERR"] = 1;
$result["ERRINFO"] = $this->db->getMessage();
} else {
$result["ERR"] = 0;
}
 
// Удаление архитектур репозитория
$query = "DELETE FROM ".$this->prefix."arch2rep WHERE rep_id='".$sRepID."'";
$rq =& $this->db->query($query);
if (PEAR::isError($this->db)) {
$result["ERR"] = 1;
$result["ERRINFO"] = $this->db->getMessage();
} else {
$result["ERR"] = 0;
}
 
return $result;
}
}