CoolCMS API

SettingUsageReport
in package

FinalYes

Joins the keys from `cms_system_settings` with the {@see SettingReadProbe} data.

A pure function without I/O so it can be tested; used by bin/settings-usage.php. The result has four groups:

  • used: the key is in the database and the probe recorded reads (module:key to count),
  • unread: the key is in the database but was never recorded (a deletion candidate, only after a long enough collection),
  • readNotInDb: the key was read and found in the settings map (neon params/publicParams) but is not in the database,
  • missing: the key was read but found nowhere (a silent fall-through to null: a code bug or an orphaned reader).

NOTE: the probe sees only SettingContext::get(module, key). Keys read through getSettings()[module][key] or settings presenter constants (TEXT_KEYS, BOOL_KEYS, ...) show up in unread although they are read; bulk lists who reads the whole map.

Table of Contents

Methods

build()  : array{used: array, unread: list, readNotInDb: array, missing: array, bulk: array, since: ?int, totalReads: int}
compareFields()  : int
sortFields()  : void

Methods

build()

public static build(array<int, array{module: int, key: string}> $dbKeys, array{hit: array, miss: array, bulk: array, since: ?int} $probe) : array{used: array, unread: list, readNotInDb: array, missing: array, bulk: array, since: ?int, totalReads: int}
Parameters
$dbKeys : array<int, array{module: int, key: string}>

rows from cms_system_settings

$probe : array{hit: array, miss: array, bulk: array, since: ?int}
Return values
array{used: array, unread: list, readNotInDb: array, missing: array, bulk: array, since: ?int, totalReads: int}

compareFields()

private static compareFields(string $a, string $b) : int
Parameters
$a : string
$b : string
Return values
int

sortFields()

private static sortFields(array<string, int> &$fields) : void
Parameters
$fields : array<string, int>
On this page

Search results