$journal
$journal : \Drupal\strata\Journal\JournalInterface
Records configuration changes as they are saved.
Config is the realm where a single change does the most damage per byte. Twelve operations a day on a 50,000-user site, under 1% of write volume, and among them are the ones that take a site down: a permission grant, a text format's allowed tags, a mail server, a cache backend. So it is captured in full rather than as a delta - a whole config object is small, and having the complete value means a restore does not depend on replaying every change since the object was created.
A rename is recorded as one operation against the NEW name carrying the old one, plus a delete of the old. Recording only the new name would leave the old object present in every earlier commit with nothing saying it went away, and a restore walking forward would resurrect it.
$journal : \Drupal\strata\Journal\JournalInterface
$scope : \Drupal\strata\Capture\CaptureScope
__construct(\Drupal\strata\Journal\JournalInterface $journal, \Drupal\strata\Capture\CaptureScope $scope, \Drupal\Core\Session\AccountProxyInterface $currentUser, \Psr\Log\LoggerInterface $logger, string $requestId = '') : mixed
Constructs the subscriber.
| \Drupal\strata\Journal\JournalInterface | $journal | Where operations are appended. |
| \Drupal\strata\Capture\CaptureScope | $scope | Decides what is captured. |
| \Drupal\Core\Session\AccountProxyInterface | $currentUser | Attributes an operation to whoever caused it. |
| \Psr\Log\LoggerInterface | $logger | Records a capture that failed. |
| string | $requestId | Groups every operation captured in one request. |
onSave(\Drupal\Core\Config\ConfigCrudEvent $event) : void
Records a saved config object.
A save that changed nothing is still recorded. Drupal saves config objects on module install, on import and on form submit whether or not the data moved, and the frame store deduplicates an unchanged value to nothing, so the operation costs its header and buys an accurate record of when the object was last written.
| \Drupal\Core\Config\ConfigCrudEvent | $event | The save event. |
isCreate(\Drupal\Core\Config\StorableConfigBase $config) : bool
Whether a save created the object rather than changing it.
Config::isNew() cannot answer this from inside a save subscriber. Config::save() sets the
flag to FALSE and only then dispatches, so by the time this runs every save looks like an
update. The pre-save data is still intact at that point - it is copied over on the line AFTER
the dispatch - so an empty original is what identifies a create.
| \Drupal\Core\Config\StorableConfigBase | $config | The config object being saved. |
TRUE when the object held nothing before this save.
record(string $name, \Drupal\strata\Journal\Verb $verb, array|null $data, string|null $from = null) : void
Appends one operation.
| string | $name | The config object name, which is the subject. |
| \Drupal\strata\Journal\Verb | $verb | What happened to it. |
| array |
$data | The object's data, or NULL for a delete. |
| string|null | $from | The name it was renamed from, or NULL. |
label(string $name, \Drupal\strata\Journal\Verb $verb, string|null $from) : string
The label the timeline shows.
| string | $name | The config object name. |
| \Drupal\strata\Journal\Verb | $verb | What happened to it. |
| string|null | $from | The name it was renamed from, or NULL. |
The label.