MAX_SUBJECTS
MAX_SUBJECTS = 500
Subjects one diff examines.
Names what changed between two commits, field by field.
Two commits are compared by replaying each subject at both and comparing the reconstructed field maps. That is the only comparison that means anything: a segment holds the operations that landed in one window, so reading the segments between two commits would say which subjects were touched and not what they were before or after.
Only subjects that exist at one of the two commits are examined. The union of the two subject sets is walked, so a subject created between them shows as added and one deleted shows as removed, while the thousands that did not change cost nothing.
The work is bounded. Each subject costs two replays, and a replay walks from an anchor forward, so a diff across a year of history over a hundred thousand subjects is not a page load. The subject count is capped and the report says when it was cut, rather than silently showing the first hundred as if they were all of them.
Line-level hunks come from core's own diff engine. Values are compared as text only when both sides look like text and at least one of them is more than a line, because running a line differ over two short strings produces a hunk that says less than showing the strings side by side.
$replayer : \Drupal\strata\Restore\Replayer
__construct(\Drupal\strata\Restore\Replayer $replayer, \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager) : mixed
Constructs a builder.
| \Drupal\strata\Restore\Replayer | $replayer | Reconstructs each subject at each commit. |
| \Drupal\Core\Entity\EntityTypeManagerInterface | $entityTypeManager | Resolves an entity subject to a human-readable label. |
between(string $fromCommit, string $toCommit, int $limit = \self::MAX_SUBJECTS, \Drupal\strata\Journal\Realm|null $realm = null) : array{diffs: list<\Drupal\strata\Diff\SubjectDiff>, examined: int, truncated: bool}
Everything that changed between two commits.
| string | $fromCommit | The earlier commit. |
| string | $toCommit | The later commit. |
| int | $limit | Subjects to examine. |
| \Drupal\strata\Journal\Realm|null | $realm | Only subjects in this realm, or NULL for every realm. |
The subjects that changed, how many were examined, and whether the walk was cut short.
subject(string $subject, string $fromCommit, string $toCommit) : \Drupal\strata\Diff\SubjectDiff|null
What changed about one subject.
| string | $subject | Subject path. |
| string | $fromCommit | The earlier commit. |
| string | $toCommit | The later commit. |
The diff, or NULL when nothing changed.
fields(\Drupal\strata\Restore\ReplayResult $before, \Drupal\strata\Restore\ReplayResult $after) : list<\Drupal\strata\Diff\FieldDiff>
What changed between two reconstructed field maps.
| \Drupal\strata\Restore\ReplayResult | $before | The earlier version. |
| \Drupal\strata\Restore\ReplayResult | $after | The later version. |
One entry per field that differs.
status(\Drupal\strata\Restore\ReplayResult $before, \Drupal\strata\Restore\ReplayResult $after) : string|null
Whether and how a subject changed.
| \Drupal\strata\Restore\ReplayResult | $before | The earlier version. |
| \Drupal\strata\Restore\ReplayResult | $after | The later version. |
A SubjectDiff status, or NULL when nothing changed.
label(string $subject) : string
A human-readable name for a subject.
The label comes from the LIVE entity, because a diff is read by someone who wants to know which article changed and the stored field map holds ids rather than titles. A subject that no longer exists has no label, which is correct: there is nothing to name it after.
| string | $subject | Subject path. |
The label, or an empty string when none is available.