SETTINGS
SETTINGS = 'strata.settings'
The configuration object every settings form edits.
Where history is written, how it is compressed, and how it is sealed.
What this form is careful about is telling the operator what the host can actually do. A codec this host has no extension and no binary for is listed as unavailable with the reason, rather than offered and then silently falling back at the first flush; the same for the journal backend and for the encryption key. A settings form that accepts a configuration the host cannot honour produces a site that looks configured and is not.
The flush interval is presented as what it is - a durability window, not a restore granularity. Operations inside a segment stay individually addressable, so a longer interval does not coarsen what a restore can target; it only decides how much is lost if the host dies before a flush.
$keyMaker : ?\Drupal\strata\Crypto\KeyMaker
Makes a key entity, for the operator who has not got one yet.
$engine : ?\Drupal\strata\Engine
The engine, reset after a save.
create(\Symfony\Component\DependencyInjection\ContainerInterface $container) : static
{@inheritdoc}
The engine is asked for, never required. composer.json PSR-4 maps Drupal\strata\ onto
src/, so every class here loads off composer's autoloader whether or not the module is in
core.extension, while strata.services.yml reaches the container only when it is. A router
table still holding this route after the module left - a failed install, a composer remove
with no uninstall - therefore resolves the class, calls this, and answered 500 with
ServiceNotFoundException until 1.0.3. The property is nullable and every use of it is
null-safe, so asking is the whole fix.
| \Symfony\Component\DependencyInjection\ContainerInterface | $container |
generateKey(array$form, \Drupal\Core\Form\FormStateInterface $form_state) : void
Creates a key, selects it, and retires whichever one it displaced.
Saves configuration on its own rather than deferring to the main submit, because it runs with validation limited away and the rest of the submitted values have therefore not been checked.
| array |
$form | The form. |
| \Drupal\Core\Form\FormStateInterface | $form_state | The submitted values. |
providerLabel(string $id) : string
A provider id as something to pick from a list.
A registry entry is a machine name, and rendering b2 beside "Local Directory" asks the
operator to already know which submodule they enabled. An id from an add-on this module does
not ship falls through to itself, which is the right answer for a name only its author knows.
| string | $id | The provider id as it appears in configuration. |
What to show.
coerce(mixed $value, string $type) : mixed
Coerces a submitted value to the type the config schema declares.
A form always submits strings, and configuration is schema-validated on save, so an integer
setting handed the string "15" fails validation on a site running strictConfigSchema.
| mixed | $value | The submitted value. |
| string | $type | One of "string", "int", "float" or "bool". |
The coerced value.
validateCodec(\Drupal\Core\Form\FormStateInterface $form_state) : void
Refuses a codec this host cannot write frames with.
The select lists an unavailable codec on purpose, with its reason, because somebody looking for
zstd has to be told the extension is missing rather than left wondering whether the release
supports it. Listing one is not the same as accepting it: saving it leaves the flush path
quietly on a different codec, and Engine::codecs() then carries a finding for a state a form
could have refused outright.
| \Drupal\Core\Form\FormStateInterface | $form_state | The submitted values. |
validateKey(\Drupal\Core\Form\FormStateInterface $form_state, string $name) : void
Refuses a key the cipher could not seal a frame with.
A key of the wrong length passes every check the form used to make and then raises inside a queue worker at the first flush, where the only trace is a log line. The rule is the cipher's own, so it is applied by building what the cipher builds rather than by restating the length.
| \Drupal\Core\Form\FormStateInterface | $form_state | The submitted values. |
| string | $name | The chosen key entity id. |
validateLocalPath(\Drupal\Core\Form\FormStateInterface $form_state) : void
Warns when the local directory is somewhere this site cannot write.
A warning rather than an error: an operator may be configuring a path a deployment step creates later, and refusing the save would leave the rest of the form unsaveable. What must not happen is the save looking clean and the first flush failing in a queue worker.
| \Drupal\Core\Form\FormStateInterface | $form_state | The submitted values. |
addKeyButton(array$form) : void
The button that makes a key for an operator who has not got one.
Encryption ships on with no key, so the shipped state of a fresh install is a form that cannot be saved and a flush that refuses. Getting out of it means creating a key entity in another module, of the right type and the right byte length.
The same button replaces a key once one exists, and retires the outgoing one in the same step. A new key configured without retiring the old one makes every frame written before it unreadable, and nothing afterwards can tell that apart from corruption.
| array |
$form | The form, added to by reference. |
codecOptions() : array<string,string>
The codecs this host can actually run, and why the others cannot.
An unavailable codec is listed with its reason rather than omitted, because an operator looking for zstd needs to be told the extension is missing, not left wondering whether this release supports it.
Codec id keyed to a label.