| @@ 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 | ||
| @@ 231-241 (lines=11) @@ | ||
| 228 | WHERE date = '$date' |
|
| 229 | AND tool = '$tool'"; |
|
| 230 | ||
| 231 | if (count($conn->query($existsSql)->fetchAll()) === 0) { |
|
| 232 | $createSql = "INSERT INTO usage_timeline |
|
| 233 | VALUES(NULL, '$date', '$tool', 1)"; |
|
| 234 | $conn->query($createSql); |
|
| 235 | } else { |
|
| 236 | $updateSql = "UPDATE usage_timeline |
|
| 237 | SET count = count + 1 |
|
| 238 | WHERE tool = '$tool' |
|
| 239 | AND date = '$date'"; |
|
| 240 | $conn->query($updateSql); |
|
| 241 | } |
|
| 242 | ||
| 243 | // Update per-project usage, if applicable |
|
| 244 | if (!$this->container->getParameter('app.single_wiki')) { |
|
| @@ 249-259 (lines=11) @@ | ||
| 246 | WHERE tool = '$tool' |
|
| 247 | AND project = '$project'"; |
|
| 248 | ||
| 249 | if (count($conn->query($existsSql)->fetchAll()) === 0) { |
|
| 250 | $createSql = "INSERT INTO usage_projects |
|
| 251 | VALUES(NULL, '$tool', '$project', 1)"; |
|
| 252 | $conn->query($createSql); |
|
| 253 | } else { |
|
| 254 | $updateSql = "UPDATE usage_projects |
|
| 255 | SET count = count + 1 |
|
| 256 | WHERE tool = '$tool' |
|
| 257 | AND project = '$project'"; |
|
| 258 | $conn->query($updateSql); |
|
| 259 | } |
|
| 260 | } |
|
| 261 | ||
| 262 | $response->setStatusCode(Response::HTTP_NO_CONTENT); |
|