Хранилища Subversion ant

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

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

/branches/ant/0.9.x/lib/core.php
2003,6 → 2003,66
return $show;
}
 
/**
* Добавление нового репозитория
*
* @author Alexander Wolf
* @category Core
*
* @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 addRepository($verionID, $rname, $rinfo, $rkey, $proto, $rhost, $rfolder, $rtype, $sections, $arch, $scheme, $sign) {
$result = array();
$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 = "INSERT INTO ".$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."'";
$rq =& $this->db->query($query);
 
$query = "SELECT rep_id FROM ".$this->prefix."repository ORDER BY rep_id DESC LIMIT 0, 1";
$rq =& $this->db->query($query);
$rq->fetchInto($repository);
 
for($i=0;$i<count($sections);$i++) {
$query = "INSERT INTO ".$this->prefix."sect2rep SET rep_id='".$repository["rep_id"]."', sect_id='".$sections[$i]."'";
$rq =& $this->db->query($query);
}
 
for($i=0;$i<count($arch);$i++) {
$query = "INSERT INTO ".$this->prefix."arch2rep SET rep_id='".$repository["rep_id"]."', 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;
}
}