PHP code example of kaliop / abacusadvancebundle
1. Go to this page and download the library: Download kaliop/abacusadvancebundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kaliop / abacusadvancebundle example snippets
// Get Abacus ADvance api as a service
$advanceApiGateway = $this->get('abacus.advance.api');
// Get GateKeeper service
$gateKeeperService = $advanceApiGateway->getGateKeeper();
// Call API and get response (NB: can throw an exception)
$accessAllowResponse = $gateKeeperService
->accessAllowed(
[
'Url' => 'myUrl',
'CookieID' => 'myAnonymousUserId',
]
);
// Use response methods
$access = $accessAllowResponse->hasAccessGranted(); // true|false
$accessStatus = $accessAllowResponse->getAccessStatus(); // GateKeeper::ACCESS_GRANTED|GateKeeper::ACCESS_DENIED
// Or get response as Abacus returned to us
$rawResponse = $accessAllowResponse->getRawResponse();
// See also getData, getVersion, getStatusCode, getStatusMessages functions