SilverStripe\Bambusa\Models\EnvVarSnapshot
The component handling environment variable snapshots, solving our particular use case which is distribution of database snapshots across kubernetes pods that don't have environment variables defined on the original environment (where the database snapshot gets taken).
This functionality lets us control environment variables in a centralised way
through SilverStripe Platform UI and then distribute them across kubernetes cluster through the database
snapshots.
How it works:
- On /dev/build it persists into the database all environment variables starting with SS_
- If you override variable with an empty string, then it deletes it from the database
Synopsis
class EnvVarSnapshot
extends DataObject
{
- // constants
- const IGNORED_KEYS = ;
- // members
- private static string $table_name = 'EnvVarSnapshot';
- private static array $db = ;
- private static array $indexes = ;
- // methods
- public void canCreate()
- public void canEdit()
- public void canDelete()
- public void canView()
- public void requireDefaultRecords()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Constants
Name | Value |
---|---|
IGNORED_KEYS |
Members
private
- $db
- $indexes
- $table_name
Methods
public
- canCreate()
- canDelete()
- canEdit()
- canView()
- requireDefaultRecords() — Take a snapshot of the environment variables and persist it to the database