PluginProbe
404 Solution / 4.2.0
404 Solution v4.2.0
4.3.5 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.2.0 4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.1.7 4.1.6 4.1.5 4.1.4 4.1.3 trunk 2.30.0 All 109 releases
404-solution / includes / TrackingLogsRepository.php

TrackingLogsRepository.php in 404 Solution 4.2.0, at includes/TrackingLogsRepository.php

54 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH')) {
4 exit;
5 }
6
7 /**
8 * LogsRepository subclass that stubs getMaxLogId() and getMinLogId() with
9 * fixed values for tests that exercise the chunked-rebuild pipeline.
10 *
11 * The pipeline reads MIN/MAX from logsv2 to decide chunk boundaries. A real
12 * DB would need rows; this subclass lets tests control the id range directly.
13 */
14 class ABJ_404_Solution_TrackingLogsRepository extends ABJ_404_Solution_LogsRepository {
15
16 /** @var list<string> Query log forwarded from TrackingDatabaseCore */
17 public array $queries = [];
18 /** @var array<int, list<mixed>> Query params forwarded from TrackingDatabaseCore */
19 public array $queryParams = [];
20 /** @var int */
21 private int $minId;
22 /** @var int */
23 private int $maxId;
24
25 /**
26 * @param ABJ_404_Solution_DatabaseCore $dbCore
27 * @param mixed $functions
28 * @param mixed $logger
29 * @param int $minId Fixed return value for getMinLogId()
30 * @param int $maxId Fixed return value for getMaxLogId()
31 */
32 /**
33 * @param ABJ_404_Solution_DatabaseCore $dbCore
34 * @param ABJ_404_Solution_Functions|null $functions
35 * @param ABJ_404_Solution_Logging|null $logger
36 * @param ABJ_404_Solution_RebuildHealthState|null $rebuildHealth
37 */
38 public function __construct(
39 ABJ_404_Solution_DatabaseCore $dbCore,
40 $functions = null,
41 $logger = null,
42 int $minId = 0,
43 int $maxId = 0,
44 $rebuildHealth = null
45 ) {
46 parent::__construct($dbCore, $functions, $logger, $rebuildHealth);
47 $this->minId = $minId;
48 $this->maxId = $maxId;
49 }
50
51 function getMaxLogId() { return $this->maxId; }
52 function getMinLogId() { return $this->minId; }
53 }
54