$engine
$engine : \Drupal\strata\Engine
The commands that measure rather than change.
A backup is only a backup if it reads back, so strata:verify fetches and decodes what the store
holds and names everything that does not come out. strata:audit and strata:heal read the record
that pass leaves behind: which findings are outstanding, and how far up the repair ladder each
finding code has climbed. Nothing here takes a rung above the automatic ceiling on its own;
quarantine and refuse remove a restore target, and strata:quarantine is where a person asks for
that.
strata:estimate and strata:calibrate answer the two cost questions. The estimate projects a
bill from a site's shape and the policy applied to it. The calibration measures what the codecs on
this host actually achieve on this site's own payloads, and marks its figures as measured so they
are never confused with the shipped reference numbers.
$engine : \Drupal\strata\Engine
$ledger : \Drupal\strata\Health\HealthLedgerInterface
$audit : \Drupal\strata\Restore\RestoreAudit
$classifications : \Drupal\strata\Capture\Classifier\ClassificationRegistry
__construct(\Drupal\strata\Engine $engine, \Drupal\Core\Config\ConfigFactoryInterface $configFactory, \Drupal\strata\Health\HealthLedgerInterface $ledger, \Drupal\strata\Restore\RestoreAudit $audit, \Drupal\strata\Capture\Classifier\ClassificationRegistry $classifications) : mixed
Constructs the command set.
| \Drupal\strata\Engine | $engine | Builds the verifier, the discovery pass and the codec registry. |
| \Drupal\Core\Config\ConfigFactoryInterface | $configFactory | Supplies the policy dials an estimate defaults to. |
| \Drupal\strata\Health\HealthLedgerInterface | $ledger | Holds the findings and the rung each code sits at. |
| \Drupal\strata\Restore\RestoreAudit | $audit | Holds the record of every restore this site has run. |
| \Drupal\strata\Capture\Classifier\ClassificationRegistry | $classifications | Holds what each part of the ephemeral keyspace has been decided to be. |
verify(array$options = ['ref' => \Drupal\strata\Tree\RefStore::MAIN, 'limit' => 0, 'shallow' => false]) : \Consolidation\OutputFormatters\StructuredData\RowsOfFields
Reads the backup back and names what does not come out.
A deep pass fetches and decodes every frame, which is the only check that proves the bytes are still there and still decode. A shallow pass asks only whether each object is present and indexed, at one head request per object instead of a fetch and a decode.
| array |
$options | Command options. |
One row per finding, empty when everything the pass touched read back correctly.
auditLog(array$options = ['limit' => 50, 'unfinished' => false]) : \Consolidation\OutputFormatters\StructuredData\RowsOfFields
Every restore this site has run, newest first.
A restore that is still recorded as pending outlived the process that started it, so those are reported first: the site may hold a partial write nobody has reconciled.
| array |
$options | Command options. |
One row per restore, empty on a site that has never restored anything.
heal(string|null $code = null, array$options = ['list' => false, 'apply' => false, 'rung' => \self::REQ, 'decay' => false]) : \Consolidation\OutputFormatters\StructuredData\RowsOfFields
Reports where each finding code sits on the repair ladder, and runs the pass its rung names.
Rungs run cheapest and most reversible first, and a code moves one rung at a time so an
operator can watch it climb. Everything at or below "rebuild" reconstructs derived state from
data that still exists, so the worst case of running it wrongly is wasted work; that is the
ceiling an unattended run may reach. Moving a code to quarantine or refuse takes a restore
target away, so it is reachable only through an explicit --rung with a confirmation.
| string|null | $code | The finding code to act on, or NULL to report every open code. |
| array |
$options | Command options. |
One row per open finding code, empty when nothing is outstanding.
tiers(array$options = ['restore' => \self::REQ]) : \Consolidation\OutputFormatters\StructuredData\RowsOfFields
Reports what each storage tier holds, whether it answers, and what a restore would need.
Two questions an operator cannot answer from anywhere else. The first is where history actually is, which matters because a bucket that is meant to be cold and is holding nothing means the migration has never run. The second is which buckets a rollback needs, and the point of asking it here is to find out before starting rather than halfway through.
An object with no recorded tier is counted as unplaced rather than assumed to be nearby. While there is one, every tier is reported as possibly needed, because that is the true answer.
| array |
$options | Command options. |
One row per tier, empty when the site writes to a single bucket.
classify(array$options = ['limit' => 10000, 'skip-discovery' => false, 'pattern' => \self::REQ, 'decide' => \self::REQ]) : \Consolidation\OutputFormatters\StructuredData\RowsOfFields
Reports what the ephemeral keyspace holds and which patterns still need a decision.
Caches, sessions, locks and queues are not one thing. Some of it is the only copy of something the site needs and some rebuilds itself the moment it is asked for. Anything the heuristics cannot place is captured verbatim and listed here, busiest first, because a pattern covering two million keys is the one worth deciding.
| array |
$options | Command options. |
One row per classification, plus a row per pattern still undecided.
estimate(array$options = ['users' => 0, 'nodes' => 0, 'rows' => 0, 'files' => 0, 'file-bytes' => 0, 'active-share' => \self::REQ, 'retention' => 365, 'deploys' => 150, 'interval' => \self::REQ, 'access-churn' => \self::REQ]) : \Consolidation\OutputFormatters\StructuredData\PropertyList
Projects what a site of a given shape costs to keep.
The shape decides how much churn there is and the policy decides what that churn costs, so a site twice the size on half the flush interval is not twice the bill. The policy dials default to what this site is configured for, which makes the projection a statement about this installation rather than about an imaginary one.
| array |
$options | Command options. |
The projection.
calibrate(array$options = ['ref' => \Drupal\strata\Tree\RefStore::MAIN, 'samples' => 200, 'level' => 'dense']) : \Consolidation\OutputFormatters\StructuredData\RowsOfFields
Measures what each codec on this host achieves on this site's own payloads.
A compression ratio depends on content, so the shipped figures exist to let two hosts be compared and to give a size estimate somewhere to start. This measures the real thing, and marks every row it produced as measured here so it is never read as a shipped number. A site with no history yet has nothing to sample, and the reference figures are reported instead.
| array |
$options | Command options. |
One row per codec.
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 "-".
measure(\Drupal\strata\Codec\CompressionCodecInterface $codec, int $level, int $frameSize, list$samples) : \Drupal\strata\Codec\CodecMeasurement|null
Compresses and decompresses a sample set, timing both directions.
| \Drupal\strata\Codec\CompressionCodecInterface | $codec | The codec to measure. |
| int | $level | The level to measure at. |
| int | $frameSize | The configured frame size, recorded with the figure. |
| list |
$samples | The payloads. |
The figure, or NULL when the codec could not run.