KMP PHP API Reference

TenantHostResolver
in package

Resolves request hostnames to platform tenant metadata.

Table of Contents

Constants

CACHE_CONFIG  : mixed = 'tenant_host_map'
CACHE_KEY_PREFIX  : mixed = 'tenant_host_map:'

Properties

$cache  : TenantAwareCache
$connectionName  : string

Methods

__construct()  : mixed
clearCache()  : bool
Clear the shared tenant host map cache after platform tenant/host changes.
normalizeHost()  : string
Normalize host names before platform lookup.
resolve()  : TenantMetadata|null
Resolve a host to tenant metadata using active host mappings.
cacheKey()  : string
Build the platform cache key for a datasource-specific host map.
hostMap()  : array<string, array<string, mixed>>
Load active host mappings once for all users/processes.
writeHostMapCache()  : void
Write the host map without letting cache backend/debug wrapper failures break requests.

Constants

Properties

Methods

clearCache()

Clear the shared tenant host map cache after platform tenant/host changes.

public static clearCache([string $connectionName = 'platform' ]) : bool
Parameters
$connectionName : string = 'platform'

Platform datasource name

Return values
bool

normalizeHost()

Normalize host names before platform lookup.

public normalizeHost(string $host) : string
Parameters
$host : string

Host name

Return values
string

cacheKey()

Build the platform cache key for a datasource-specific host map.

private static cacheKey(string $connectionName) : string
Parameters
$connectionName : string

Platform datasource name

Return values
string

hostMap()

Load active host mappings once for all users/processes.

private hostMap() : array<string, array<string, mixed>>
Return values
array<string, array<string, mixed>>

writeHostMapCache()

Write the host map without letting cache backend/debug wrapper failures break requests.

private writeHostMapCache(string $cacheKey, array<string, array<string, mixed>> $map) : void
Parameters
$cacheKey : string

Logical platform cache key

$map : array<string, array<string, mixed>>

Host map

On this page

Search results