axeptio/sdk
Composer 安装命令:
composer require axeptio/sdk
包简介
A PHP SDK for Axeptio
README 文档
README
How to use Cookies features
To use the Axeptio SDK Cookies properly, you need to use the Axeptio\SDK\Cookies\AxeptioCookieManager class.
This class will allow you to define all the necessary cookies and set them.
You got at your disposition builders for each necessary cookie.
For each cookie, the associated builder allow you to set different data required for the cookie. (expiry, path, secure, httponly, samesite are common data availables for each cookie).
Here is an example :
$cookieManager = new AxeptioCookieManager(); $userPreferences = ['fb-pixel']; // Define AxeptioCookies $axeptioCookieBuilder = new AxeptioCookiesBuilder(); $axeptioCookieBuilder->setUserToken('test-user-token'); $axeptioCookieBuilder->setUserPreferences($userPreferences); $axeptioCookieBuilder->setExpiry(172800); $axeptioCookie = $axeptioCookieBuilder->create(); // Define AuthorizedVendorCookies $authorizedVendorCookiesBuilder = new AuthorizedVendorCookiesBuilder(); $authorizedVendorCookiesBuilder->setUserPreferences($userPreferences); $authorizedVendorCookies = $authorizedVendorCookiesBuilder->create(); // Define AllVendorCookies $allVendorCookiesBuilder = new AllVendorCookiesBuilder(); $allVendorCookiesBuilder->setVendors(['test', 'test1']); $allVendorCookies = $allVendorCookiesBuilder->create(); // Use the cookie manager to set the cookies and use the set() method to set them. // Take note : If one cookie is missing, an UndefinedCookie Exception will be thrown. $cookieManager->addAxeptioCookies($axeptioCookie); $cookieManager->addAuthorizedVendorCookies($authorizedVendorCookies); $cookieManager->addAllVendorCookies($allVendorCookies); $cookieManager->set();
统计信息
- 总下载量: 84
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2024-03-19