| @@ 327-337 (lines=11) @@ | ||
| 324 | WHERE date = '$date' |
|
| 325 | AND tool = '$tool'"; |
|
| 326 | ||
| 327 | if (count($conn->query($existsSql)->fetchAll()) === 0) { |
|
| 328 | $createSql = "INSERT INTO usage_timeline |
|
| 329 | VALUES(NULL, '$date', '$tool', 1)"; |
|
| 330 | $conn->query($createSql); |
|
| 331 | } else { |
|
| 332 | $updateSql = "UPDATE usage_timeline |
|
| 333 | SET count = count + 1 |
|
| 334 | WHERE tool = '$tool' |
|
| 335 | AND date = '$date'"; |
|
| 336 | $conn->query($updateSql); |
|
| 337 | } |
|
| 338 | ||
| 339 | // Update per-project usage, if applicable |
|
| 340 | if (!$this->container->getParameter('app.single_wiki')) { |
|
| @@ 345-355 (lines=11) @@ | ||
| 342 | WHERE tool = '$tool' |
|
| 343 | AND project = '$project'"; |
|
| 344 | ||
| 345 | if (count($conn->query($existsSql)->fetchAll()) === 0) { |
|
| 346 | $createSql = "INSERT INTO usage_projects |
|
| 347 | VALUES(NULL, '$tool', '$project', 1)"; |
|
| 348 | $conn->query($createSql); |
|
| 349 | } else { |
|
| 350 | $updateSql = "UPDATE usage_projects |
|
| 351 | SET count = count + 1 |
|
| 352 | WHERE tool = '$tool' |
|
| 353 | AND project = '$project'"; |
|
| 354 | $conn->query($updateSql); |
|
| 355 | } |
|
| 356 | } |
|
| 357 | ||
| 358 | return new View( |
|