chore(config): snapshot stage focus defaults
This commit is contained in:
1 parent
356eeb9806
commit
2180d9e37b
4 files changed
+15
-21
No files matched your search
@@ -21,7 +21,7 @@
|
||||
Ненастроенные параметры (`utm_source`, `keyword`, `subid` и любые другие) проходят как есть. Перед переходом
|
||||
Preland всегда формирует полный resolved-набор своих восьми меток: явное допустимое значение остаётся, `rnd`
|
||||
разрешается по весам, отсутствующее получает `default`. Вместе с внешними рекламными параметрами этот набор
|
||||
уходит в `claim`, а затем сайт переносит его в `upscale`; ни один из семи параметров не должен пропадать только
|
||||
уходит в `claim`, а затем сайт переносит его в `upscale`; ни один из восьми параметров не должен пропадать только
|
||||
потому, что был назначен default.
|
||||
|
||||
| Метка | Что задаёт | Где |
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@
|
||||
"1": 0,
|
||||
"2": 1
|
||||
},
|
||||
"default": "1"
|
||||
"default": "2"
|
||||
},
|
||||
"focus": {
|
||||
"weights": {
|
||||
|
||||
@@ -30,6 +30,7 @@ if (!is_string($query)) {
|
||||
}
|
||||
|
||||
parse_str($query, $params);
|
||||
$config = json_decode((string) file_get_contents(dirname(__DIR__) . '/config.json'), true);
|
||||
$expected = [
|
||||
'indpic' => '1',
|
||||
'theme' => 'dark',
|
||||
@@ -37,7 +38,7 @@ $expected = [
|
||||
'registration' => 'after',
|
||||
'bchoice' => 'a',
|
||||
'chb' => 'b',
|
||||
'tp' => '1',
|
||||
'tp' => $config['utm']['tp']['default'] ?? null,
|
||||
'focus' => 'face',
|
||||
'utm_source' => 'stage-ad',
|
||||
'subid' => 'click-42',
|
||||
|
||||
@@ -17,27 +17,20 @@ $config = is_file($configPath) ? json_decode((string) file_get_contents($configP
|
||||
if (!is_array($config)) {
|
||||
$failures[] = 'Рабочий config.json должен существовать в корне приленда и содержать валидный JSON.';
|
||||
} else {
|
||||
$expected = [
|
||||
'host' => 'zoomzilla.ru',
|
||||
'indpic' => ['1' => 1, '2' => 0, 'default' => '1'],
|
||||
'theme' => ['light' => 0, 'dark' => 1, 'default' => 'dark'],
|
||||
'degr' => ['1' => 1, '2' => 0, 'default' => '1'],
|
||||
'registration' => ['before' => 0, 'after' => 1, 'default' => 'after'],
|
||||
'bchoice' => ['a' => 1, 'b' => 0, 'default' => 'a'],
|
||||
'chb' => ['a' => 1, 'b' => 0, 'default' => 'b'],
|
||||
'tp' => ['1' => 0, '2' => 1, 'default' => '1'],
|
||||
'focus' => ['center' => 0, 'face' => 1, 'default' => 'face'],
|
||||
];
|
||||
|
||||
if (($config['host'] ?? null) !== $expected['host']) {
|
||||
if (($config['host'] ?? null) !== 'zoomzilla.ru') {
|
||||
$failures[] = 'Рабочий config.json обязан направлять загрузку на zoomzilla.ru.';
|
||||
}
|
||||
|
||||
foreach (array_diff_key($expected, ['host' => true]) as $key => $settings) {
|
||||
$actual = $config['utm'][$key] ?? [];
|
||||
if (($actual['weights'] ?? null) !== array_diff_key($settings, ['default' => true])
|
||||
|| ($actual['default'] ?? null) !== $settings['default']) {
|
||||
$failures[] = "Рабочий config.json должен сохранять stage-настройку UTM {$key}.";
|
||||
$focus = $config['utm']['focus'] ?? null;
|
||||
if (($focus['weights'] ?? null) !== ['center' => 0, 'face' => 1]
|
||||
|| ($focus['default'] ?? null) !== 'face') {
|
||||
$failures[] = 'Рабочий config.json должен фиксировать явно согласованный focus=face.';
|
||||
}
|
||||
|
||||
foreach (['indpic', 'theme', 'degr', 'registration', 'bchoice', 'chb', 'tp'] as $key) {
|
||||
$setting = $config['utm'][$key] ?? null;
|
||||
if (!is_array($setting) || !is_array($setting['weights'] ?? null) || !is_string($setting['default'] ?? null)) {
|
||||
$failures[] = "Рабочий config.json должен хранить валидный stage-снимок UTM {$key}.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user