TABLE_NAME
TABLE_NAME ='revision'
Create a mechanism to catch all settings and create an unique revision.
Note: A revision holds any option in "raw", so there isn't any filter or postprocess like a getter.
EXCLUDE_OPTIONS_FROM_REVISION =array(\DevOwl\RealCookieBanner\settings\TCF::SETTING_TCF_FIRST_ACCEPTED_TIME, \DevOwl\RealCookieBanner\settings\TCF::SETTING_TCF_ACCEPTED_TIME, \DevOwl\RealCookieBanner\settings\TCF::SETTING_TCF_GVL_DOWNLOAD_TIME, \DevOwl\RealCookieBanner\settings\CountryBypass::SETTING_COUNTRY_BYPASS_DB_DOWNLOAD_TIME)
INDEPENDENT_OPTIONS =array(\DevOwl\RealCookieBanner\settings\General::SETTING_BANNER_ACTIVE, \DevOwl\RealCookieBanner\settings\General::SETTING_BLOCKER_ACTIVE, \DevOwl\RealCookieBanner\settings\General::SETTING_HIDE_PAGE_IDS, \DevOwl\RealCookieBanner\settings\Consent::SETTING_RESPECT_DO_NOT_TRACK, \DevOwl\RealCookieBanner\settings\Consent::SETTING_SAVE_IP, \DevOwl\RealCookieBanner\settings\Consent::SETTING_CONSENT_DURATION)
$me :\DevOwl\RealCookieBanner\settings\Revision
Singleton instance.
create(boolean|string $persist = false,boolean $forceNewConsent = true): array
Create a MD5 hash from all available settings of Real Cookie Banner and save also as "current".
If the hash differs, a new consent is needed! Note also, that some settings are excluded and prevent
a retrigger. See also createIndependent
.
boolean|string | $persist | Persist the revision in database, pass |
boolean | $forceNewConsent |
'revision' and 'hash'
getCurrent(boolean $recreate = false)
Get the current revision as array. It also includes the following infos:
public_to_users
: The revision hash currently published to userscalculated
: The current revision hash from the latest settingshas_manager
: Has a cookie with a valid Google/Matomo Tag Manager script (so you can show a notice in your config UI)public_count
: A total count of public cookiesboolean | $recreate | If true, a new revision gets created so new consents need to be made. Always recreates when no consents are given yet. |
fromOptions(array<mixed,string> $whiteBlackList = null,boolean $isInArray = false,boolean $asOptionName = false)
Read all available options. This does not impact the performance in any way, because all `autoload=yes` options are loaded already.
array<mixed,string> | $whiteBlackList | Allows to skip / only options by option name |
boolean | $isInArray | The needed result of |
boolean | $asOptionName | If true, the returned map contains the option name instead of value |
getByHash(string|array<mixed,string> $hash,boolean $independent = false,boolean $applyBackwardsCompatibility = false)
Get the revision(s) by hash(es).
string|array<mixed,string> | $hash | |
boolean | $independent | |
boolean | $applyBackwardsCompatibility | See method |