Remote Config
Remote Config in the PHP SDK.
// access
$nexus->remoteConfig()RemoteConfig
classclass Inverge\Nexus\Resource\RemoteConfigRemote Config — fetch the active, published configuration template resolved for a given app-instance context. Conditions (platform, version, country, percentile, user properties, …) are evaluated server-side; you get back the final value for every parameter. Useful server-side for headless config, feature gating, and rendering server-driven UIs without a redeploy.
View source__construct
constructorfunction __construct(Inverge\Nexus\NexusClient $client)Parameters
Prop
Type
fetch()
methodfunction fetch(array $context = [], ?string $etag = NULL): arrayFetch and resolve the active template for this instance's context.
Pass the previous response's etag to skip the payload when nothing has
changed (notModified will be true).
Parameters
Prop
Type
Returns array{version:int,etag:string,notModified:bool,throttled?:bool,parameters:array<string,array{value:mixed,valueType:string,source:?string}>}
all()
methodfunction all(array $context = []): arrayConvenience: the resolved config as a flat key => value map.
Parameters
Prop
Type
Returns array<string, — mixed>
get()
methodfunction get(string $key, mixed $default = NULL, array $context = []): mixedConvenience: a single parameter's resolved value, or [$default].
Parameters
Prop
Type
Returns mixed
setParameter()
methodfunction setParameter(string $key, string $valueType, mixed $defaultValue = NULL, ?array $conditionalValues = NULL, ?string $description = NULL): arrayCreate or update a parameter in the draft template.
Parameters
Prop
Type
Returns array<string, — mixed> the stored parameter
deleteParameter()
methodfunction deleteParameter(string $key): voidRemove a parameter from the draft template. */
Parameters
Prop
Type
publish()
methodfunction publish(?string $description = NULL): arrayPublish the current draft — makes all pending parameter changes live for every fetch() from now on.
Parameters
Prop
Type
Returns array{versionNumber:int,etag:string,createdAt:string}
set()
methodfunction set(string $key, mixed $value, ?string $valueType = NULL, ?string $description = NULL): arrayConvenience: set one parameter and publish it in a single call. The value type is inferred from $value unless given explicitly.
Parameters
Prop
Type
Returns array{versionNumber:int,etag:string,createdAt:string} — the new version
