| 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 |
|