| @@ 239-249 (lines=11) @@ | ||
| 236 | WHERE date = '$date' |
|
| 237 | AND tool = '$tool'"; |
|
| 238 | ||
| 239 | if (count($conn->query($existsSql)->fetchAll()) === 0) { |
|
| 240 | $createSql = "INSERT INTO usage_timeline |
|
| 241 | VALUES(NULL, '$date', '$tool', 1)"; |
|
| 242 | $conn->query($createSql); |
|
| 243 | } else { |
|
| 244 | $updateSql = "UPDATE usage_timeline |
|
| 245 | SET count = count + 1 |
|
| 246 | WHERE tool = '$tool' |
|
| 247 | AND date = '$date'"; |
|
| 248 | $conn->query($updateSql); |
|
| 249 | } |
|
| 250 | ||
| 251 | // Update per-project usage, if applicable |
|
| 252 | if (!$this->container->getParameter('app.single_wiki')) { |
|
| @@ 257-267 (lines=11) @@ | ||
| 254 | WHERE tool = '$tool' |
|
| 255 | AND project = '$project'"; |
|
| 256 | ||
| 257 | if (count($conn->query($existsSql)->fetchAll()) === 0) { |
|
| 258 | $createSql = "INSERT INTO usage_projects |
|
| 259 | VALUES(NULL, '$tool', '$project', 1)"; |
|
| 260 | $conn->query($createSql); |
|
| 261 | } else { |
|
| 262 | $updateSql = "UPDATE usage_projects |
|
| 263 | SET count = count + 1 |
|
| 264 | WHERE tool = '$tool' |
|
| 265 | AND project = '$project'"; |
|
| 266 | $conn->query($updateSql); |
|
| 267 | } |
|
| 268 | } |
|
| 269 | ||
| 270 | return new View( |
|