Редакция 617 | Редакция 623 | К новейшей редакции | Весь файл | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 617 | Редакция 618 | ||
---|---|---|---|
Строка 2065... | Строка 2065... | ||
2065 | }
|
2065 | }
|
2066 | 2066 | ||
2067 | return $result; |
2067 | return $result; |
2068 | }
|
2068 | }
|
2069 | 2069 | ||
- | 2070 | /**
|
|
- | 2071 | * Обновление информации о репозитории
|
|
- | 2072 | *
|
|
- | 2073 | * @author Alexander Wolf
|
|
- | 2074 | * @category Core
|
|
- | 2075 | *
|
|
- | 2076 | * @param integer $repID
|
|
- | 2077 | * @param integer $verionID
|
|
- | 2078 | * @param string $rname
|
|
- | 2079 | * @param string $rinfo
|
|
- | 2080 | * @param string $rkey
|
|
- | 2081 | * @param integer $proto
|
|
- | 2082 | * @param integer $rhost
|
|
- | 2083 | * @param integer $rfolder
|
|
- | 2084 | * @param integer $rtype
|
|
- | 2085 | * @param array $sections
|
|
- | 2086 | * @param array $arch
|
|
- | 2087 | * @param integer $scheme
|
|
- | 2088 | * @param integer $sign
|
|
- | 2089 | * @return array
|
|
- | 2090 | */
|
|
- | 2091 | public function updateRepository($repID, $verionID, $rname, $rinfo, $rkey, $proto, $rhost, $rfolder, $rtype, $scheme, $sign, $sections, $arch) { |
|
- | 2092 | $result = array(); |
|
- | 2093 | $sRepID = $this->secure->checkInt($repID); |
|
- | 2094 | $sVersionID = $this->secure->checkInt($verionID); |
|
- | 2095 | $sRName = $this->secure->checkStr($rname); |
|
- | 2096 | $sRInfo = $this->secure->checkStr($rinfo); |
|
- | 2097 | $sRKey = $this->secure->checkStr($rkey); |
|
- | 2098 | $sProto = $this->secure->checkInt($proto); |
|
- | 2099 | $sRHost = $this->secure->checkInt($rhost); |
|
- | 2100 | $sRFolder = $this->secure->checkInt($rfolder); |
|
- | 2101 | $sRType = $this->secure->checkInt($rtype); |
|
- | 2102 | $sRScheme = $this->secure->checkInt($scheme); |
|
- | 2103 | $sRSign = $this->secure->checkInt($sign); |
|
- | 2104 | ||
- | 2105 | $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."'"; |
|
- | 2106 | $rq =& $this->db->query($query); |
|
- | 2107 | ||
- | 2108 | $query = "DELETE FROM ".$this->prefix."sect2rep WHERE rep_id='".$sRepID."'"; |
|
- | 2109 | $rq =& $this->db->query($query); |
|
- | 2110 | for($i=0;$i<count($sections);$i++) { |
|
- | 2111 | $query = "INSERT INTO ".$this->prefix."sect2rep SET rep_id='".$sRepID."', sect_id='".$sections[$i]."'"; |
|
- | 2112 | $rq =& $this->db->query($query); |
|
- | 2113 | }
|
|
- | 2114 | ||
- | 2115 | $query = "DELETE FROM ".$this->prefix."arch2rep WHERE rep_id='".$sRepID."'"; |
|
- | 2116 | $rq =& $this->db->query($query); |
|
- | 2117 | for($i=0;$i<count($arch);$i++) { |
|
- | 2118 | $query = "INSERT INTO ".$this->prefix."arch2rep SET rep_id='".$sRepID."', arch_id='".$arch[$i]."'"; |
|
- | 2119 | $rq =& $this->db->query($query); |
|
- | 2120 | }
|
|
- | 2121 | ||
- | 2122 | if (PEAR::isError($this->db)) { |
|
- | 2123 | $result["ERR"] = 1; |
|
- | 2124 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 2125 | } else { |
|
- | 2126 | $result["ERR"] = 0; |
|
- | 2127 | }
|
|
- | 2128 | ||
- | 2129 | return $result; |
|
- | 2130 | }
|
|
- | 2131 | ||
- | 2132 | /**
|
|
- | 2133 | * Удаление информации о репозитории
|
|
- | 2134 | *
|
|
- | 2135 | * @author Alexander Wolf
|
|
- | 2136 | * @category Core
|
|
- | 2137 | *
|
|
- | 2138 | * @param integer $repID
|
|
- | 2139 | * @return array
|
|
- | 2140 | */
|
|
- | 2141 | public function dropRepository($repID) { |
|
- | 2142 | $result = array(); |
|
- | 2143 | $sRepID = $this->secure->checkInt($repID); |
|
- | 2144 | ||
- | 2145 | // Удаление репозитория
|
|
- | 2146 | $query = "DELETE FROM ".$this->prefix."repository WHERE rep_id='".$sRepID."'"; |
|
- | 2147 | $rq =& $this->db->query($query); |
|
- | 2148 | if (PEAR::isError($this->db)) { |
|
- | 2149 | $result["ERR"] = 1; |
|
- | 2150 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 2151 | } else { |
|
- | 2152 | $result["ERR"] = 0; |
|
- | 2153 | }
|
|
- | 2154 | ||
- | 2155 | // Удаление секций репозитория
|
|
- | 2156 | $query = "DELETE FROM ".$this->prefix."sect2rep WHERE rep_id='".$sRepID."'"; |
|
- | 2157 | $rq =& $this->db->query($query); |
|
- | 2158 | if (PEAR::isError($this->db)) { |
|
- | 2159 | $result["ERR"] = 1; |
|
- | 2160 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 2161 | } else { |
|
- | 2162 | $result["ERR"] = 0; |
|
- | 2163 | }
|
|
- | 2164 | ||
- | 2165 | // Удаление архитектур репозитория
|
|
- | 2166 | $query = "DELETE FROM ".$this->prefix."arch2rep WHERE rep_id='".$sRepID."'"; |
|
- | 2167 | $rq =& $this->db->query($query); |
|
- | 2168 | if (PEAR::isError($this->db)) { |
|
- | 2169 | $result["ERR"] = 1; |
|
- | 2170 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 2171 | } else { |
|
- | 2172 | $result["ERR"] = 0; |
|
- | 2173 | }
|
|
- | 2174 | ||
- | 2175 | return $result; |
|
- | 2176 | }
|
|
- | 2177 | ||
2070 | }
|
2178 | }
|
2071 | 2179 | ||
2072 | ?>
|
2180 | ?>
|
2073 | 2181 |