SHARED_PREFIXES
SHARED_PREFIXES = ['frames/', 'packs/', 'media/', 'dicts/']
Key prefixes shared across every site in a bucket.
Content, addressed by its own digest. Two sites holding the same bytes hold them once.
Confines one site's reads and writes to its own namespace.
Multi-site isolation is enforced here rather than in every caller. The commit log, the segment writer, the tree builder and the ref store all compose their own keys, and asking each of them to remember a site prefix would mean one that forgot became a site reading another's history.
Wrapping the provider instead means there is exactly one place the prefix is applied and exactly one place it is stripped, and a listing cannot return a key belonging to another site because the listing itself is prefixed.
Frames are NOT confined, and that is the point of sharing a bucket. A frame is addressed by the digest of its content, so two sites storing the same config object store one frame; confining frames per site would turn the saving into duplication. Only the things that describe a site - commits, refs, trees, segments - are namespaced.
$inner : \Drupal\strata\Storage\StorageProviderInterface
$site : \Drupal\strata\Site\SiteContext
__construct(\Drupal\strata\Storage\StorageProviderInterface $inner, \Drupal\strata\Site\SiteContext $site) : mixed
Constructs a scoped provider.
| \Drupal\strata\Storage\StorageProviderInterface | $inner | The provider being wrapped. |
| \Drupal\strata\Site\SiteContext | $site | Which site's namespace to use. |
put(string $key, mixed $body, array $options = []) : \Drupal\strata\Storage\PutResult
Writes an object.
| string | $key | Object key relative to the store root. |
| mixed | $body | The bytes, or an open readable stream. A stream is read once and not rewound, so a caller that needs it again must seek itself. |
| array | $options | Provider options. |
What was written.
head(string $key) : \Drupal\strata\Storage\ObjectMeta|null
Metadata for one object without reading it.
| string | $key | Object key relative to the store root. |
The metadata, or NULL when the object is absent. Absence is not an error, because every caller of this method is asking precisely in order to find out.
delete(array $keys) : int
Deletes objects.
| array | $keys | Object keys relative to the store root. |
How many keys the endpoint accepted. A store that can tell an absent key from a removed one counts only what it removed; S3 reports success for an absent key and cannot distinguish, so it counts everything it was given. Do not read this as "how many existed" - a prune receipt counts from the frame index, which knows.
list(string $prefix = '', ?string $cursor = null, int $limit = 1000, ?string $delimiter = null) : \Drupal\strata\Storage\ObjectPage
Lists one page of objects under a prefix.
| string | $prefix | Key prefix relative to the store root; an empty string lists everything. |
| ?string | $cursor | Continuation token from a previous page, or NULL to start. |
| int | $limit | Most objects to return in this page. |
| ?string | $delimiter | Grouping delimiter, or NULL for a flat listing. |
The page.