SilverStripe\Bambusa\Middleware\EnvVarSnapshotApplicationMiddleware
The application middleware 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:
- As an application middleware it restores the environment variables from the database,
but does not overwrite defined ones
WARNING: this component has to run before Kernel is booted and as such it is not a Director,
but HTTPApplication middleware
Synopsis
class EnvVarSnapshotApplicationMiddleware
implements
HTTPMiddleware
{
- // methods
- public void process()
Hierarchy
Implements
- SilverStripe\Control\Middleware\HTTPMiddleware
Methods
public
- process() — Restore undefined environment variables from the snapshot.