| @@ 340-350 (lines=11) @@ | ||
| 337 | WHERE date = '$date' |
|
| 338 | AND endpoint = '$endpoint'"; |
|
| 339 | ||
| 340 | if (count($conn->query($existsSql)->fetchAll()) === 0) { |
|
| 341 | $createSql = "INSERT INTO usage_api_timeline |
|
| 342 | VALUES(NULL, '$date', '$endpoint', 1)"; |
|
| 343 | $conn->query($createSql); |
|
| 344 | } else { |
|
| 345 | $updateSql = "UPDATE usage_api_timeline |
|
| 346 | SET count = count + 1 |
|
| 347 | WHERE endpoint = '$endpoint' |
|
| 348 | AND date = '$date'"; |
|
| 349 | $conn->query($updateSql); |
|
| 350 | } |
|
| 351 | } |
|
| 352 | } |
|
| 353 | ||
| @@ 229-239 (lines=11) @@ | ||
| 226 | WHERE date = '$date' |
|
| 227 | AND tool = '$tool'"; |
|
| 228 | ||
| 229 | if (count($conn->query($existsSql)->fetchAll()) === 0) { |
|
| 230 | $createSql = "INSERT INTO usage_timeline |
|
| 231 | VALUES(NULL, '$date', '$tool', 1)"; |
|
| 232 | $conn->query($createSql); |
|
| 233 | } else { |
|
| 234 | $updateSql = "UPDATE usage_timeline |
|
| 235 | SET count = count + 1 |
|
| 236 | WHERE tool = '$tool' |
|
| 237 | AND date = '$date'"; |
|
| 238 | $conn->query($updateSql); |
|
| 239 | } |
|
| 240 | ||
| 241 | // Update per-project usage, if applicable |
|
| 242 | if (!$this->container->getParameter('app.single_wiki')) { |
|
| @@ 247-257 (lines=11) @@ | ||
| 244 | WHERE tool = '$tool' |
|
| 245 | AND project = '$project'"; |
|
| 246 | ||
| 247 | if (count($conn->query($existsSql)->fetchAll()) === 0) { |
|
| 248 | $createSql = "INSERT INTO usage_projects |
|
| 249 | VALUES(NULL, '$tool', '$project', 1)"; |
|
| 250 | $conn->query($createSql); |
|
| 251 | } else { |
|
| 252 | $updateSql = "UPDATE usage_projects |
|
| 253 | SET count = count + 1 |
|
| 254 | WHERE tool = '$tool' |
|
| 255 | AND project = '$project'"; |
|
| 256 | $conn->query($updateSql); |
|
| 257 | } |
|
| 258 | } |
|
| 259 | ||
| 260 | $response->setStatusCode(Response::HTTP_NO_CONTENT); |
|