PHP client for Emarsys session validator service
composer require emartech/session-validator-client
$client = Client::create('https://session-validator.gservice.emarsys.net', 'escher_key', 'escher_secret');
var_dump($client->isValid('msid'));
For mTLS on GAP.
$client = Client::create('http://session-validator-web.security');
var_dump($client->isValid('msid'));
Returns an array of the invalid MSIDs.
$client = Client::create('https://session-validator.gservice.emarsys.net', 'escher_key', 'escher_secret');
var_dump($client->filterInvalid(['msid1', 'msid2']));
$client = Client::create('https://session-validator.gservice.emarsys.net', 'escher_key', 'escher_secret');
$cachedClient = CachedClient::create($client);
var_dump($cachedClient->isValid('msid'));
To enable logging, add a PSR-3 compatible logger to the client
use Monolog\Logger;
$client = Client::create('https://session-validator.gservice.emarsys.net', 'escher_key', 'escher_secret');
$client->setLogger(new Logger('name'));
Because of the APCu dependency, install extension before composer install
printf "\n" | pecl install apcu
make install
make test
make style