| @@ 256-266 (lines=11) @@ | ||
| 253 | WHERE date = '$date' |
|
| 254 | AND tool = '$tool'"; |
|
| 255 | ||
| 256 | if (count($conn->query($existsSql)->fetchAll()) === 0) { |
|
| 257 | $createSql = "INSERT INTO usage_timeline |
|
| 258 | VALUES(NULL, '$date', '$tool', 1)"; |
|
| 259 | $conn->query($createSql); |
|
| 260 | } else { |
|
| 261 | $updateSql = "UPDATE usage_timeline |
|
| 262 | SET count = count + 1 |
|
| 263 | WHERE tool = '$tool' |
|
| 264 | AND date = '$date'"; |
|
| 265 | $conn->query($updateSql); |
|
| 266 | } |
|
| 267 | ||
| 268 | // Update per-project usage, if applicable |
|
| 269 | if (!$this->container->getParameter('app.single_wiki')) { |
|
| @@ 274-284 (lines=11) @@ | ||
| 271 | WHERE tool = '$tool' |
|
| 272 | AND project = '$project'"; |
|
| 273 | ||
| 274 | if (count($conn->query($existsSql)->fetchAll()) === 0) { |
|
| 275 | $createSql = "INSERT INTO usage_projects |
|
| 276 | VALUES(NULL, '$tool', '$project', 1)"; |
|
| 277 | $conn->query($createSql); |
|
| 278 | } else { |
|
| 279 | $updateSql = "UPDATE usage_projects |
|
| 280 | SET count = count + 1 |
|
| 281 | WHERE tool = '$tool' |
|
| 282 | AND project = '$project'"; |
|
| 283 | $conn->query($updateSql); |
|
| 284 | } |
|
| 285 | } |
|
| 286 | ||
| 287 | return new View( |
|