$engine
$engine : \Drupal\strata\Engine
The commands an operator runs on a working site.
Reading is separated from writing here. strata:status, strata:list and strata:sites answer
questions and are safe on any site in any state, so each of them reports a misconfigured store as
a field rather than as an exception: an operator asking why backups are not running needs the
answer printed, not a stack trace. strata:snapshot and strata:flush seal history and fail
loudly, because a flush that quietly did nothing is the failure this module exists to prevent.
Every table is returned as structured data rather than printed, so --format=json and --field
work on all of them without a second code path.
$engine : \Drupal\strata\Engine
$commits : \Drupal\strata\Tree\CommitIndex
$journal : \Drupal\strata\Journal\JournalInterface
$frames : \Drupal\strata\Cas\FrameIndexInterface
$ledger : \Drupal\strata\Health\HealthLedgerInterface
__construct(\Drupal\strata\Engine $engine, \Drupal\Core\Config\ConfigFactoryInterface $configFactory, \Drupal\strata\Tree\CommitIndex $commits, \Drupal\strata\Journal\JournalInterface $journal, \Drupal\strata\Cas\FrameIndexInterface $frames, \Drupal\strata\Health\HealthLedgerInterface $ledger) : mixed
Constructs the command set.
| \Drupal\strata\Engine | $engine | Builds the pipeline this site is configured for. |
| \Drupal\Core\Config\ConfigFactoryInterface | $configFactory | Read for the settings a status report names. |
| \Drupal\strata\Tree\CommitIndex | $commits | The local index history is listed from, which costs no requests. |
| \Drupal\strata\Journal\JournalInterface | $journal | Asked what has been captured but not yet sealed. |
| \Drupal\strata\Cas\FrameIndexInterface | $frames | Asked what the store holds. |
| \Drupal\strata\Health\HealthLedgerInterface | $ledger | Asked how many findings are outstanding. |
commits(array$options = ['limit' => 50, 'level' => \self::REQ, 'since' => \self::REQ, 'until' => \self::REQ]) : \Consolidation\OutputFormatters\StructuredData\RowsOfFields
The commits this site's history holds, newest first.
| array |
$options | Command options. |
One row per commit, empty when nothing has been sealed yet.
sites() : \Consolidation\OutputFormatters\StructuredData\RowsOfFields
Which sites share this bucket.
Frames are shared across sites and history is not, so the prefixes that are neither content nor this site are other sites' histories. Listing them is how an operator confirms that a bucket holds what they think it holds before pointing a restore at it.
One row per site, empty when the store has never been written to.
snapshot(array$options = ['skip-reconcile' => false, 'skip-code' => false, 'tables' => 100, 'ref' => \Drupal\strata\Tree\RefStore::MAIN]) : \Consolidation\OutputFormatters\StructuredData\RowsOfFields
Captures everything no hook observes, then seals a commit covering all of it.
Entity, config and state writes arrive through hooks as they happen. Table drift and code changes do not, so a commit sealed without them describes only part of the site. This runs those passes first and forces the flush afterwards, which makes the resulting commit a complete point in time rather than whatever the hooks happened to see.
| array |
$options | Command options. |
One row per stage.
flush(array$options = ['ref' => \Drupal\strata\Tree\RefStore::MAIN, 'if-due' => false]) : \Consolidation\OutputFormatters\StructuredData\PropertyList
Seals whatever has been captured but not yet stored.
| array |
$options | Command options. |
What the flush did.
value(array$options, string $name) : string|null
Reads an option that carries a value.
A value option declares DrushCommands::REQ as its default, and Drush replaces that with the
string the operator supplied or with NULL before the command body runs. A method called
directly - from a test, a hook, or another command - still sees the sentinel, and both forms
mean that nothing was supplied. Drush only ever passes a string, so an integer sentinel cannot
be confused with a value.
| array |
$options | The options the command was called with. |
| string | $name | The option name. |
The value, or NULL when none was supplied.
number(array$options, string $name, int $fallback) : int
Reads an option that carries a whole number.
| array |
$options | The options the command was called with. |
| string | $name | The option name. |
| int | $fallback | What to return when nothing was supplied. |
The value, or the fallback.
agreed(string $question) : bool
Asks before doing something that removes a restore target or overwrites live data.
Drush answers this itself under --yes and --no, so a scripted run never blocks. The
default is no, because the question is only ever asked about something irreversible.
| string | $question | What is about to happen, phrased as a question. |
TRUE to go ahead.
announce(bool $acted, string $summary) : void
States what a pass did, at the severity the outcome deserves.
A pass that ran and a pass that declined to run both produce a summary worth reading, and the difference between them is what an operator watching a scheduled job needs to see.
| bool | $acted | TRUE when the pass did the thing it was asked to do. |
| string | $summary | The one-line summary to print. |
digest(string|null $digest) : string
Shortens a content address for a table cell.
Anything that is not a digest is returned whole, so an object key or a refusal reason passed here is readable rather than truncated to twelve characters of a path.
| string|null | $digest | The digest, or NULL. |
The first twelve characters of a digest, the value unchanged when it is not one, or "-".
headOf(\Drupal\strata\Storage\StorageProviderInterface $bucket, string $id) : string|null
The commit one site's main ref points at.
| \Drupal\strata\Storage\StorageProviderInterface | $bucket | The unscoped provider. |
| string | $id | The site id. |
The commit id, or NULL when the site has no main ref or it cannot be read.