axeptio/sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 6
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2024-03-19