20 lines
1.9 KiB
Python
20 lines
1.9 KiB
Python
from pathlib import Path
|
|
import json
|
|
|
|
ROOT = Path(__file__).resolve().parent.parent
|
|
D = ROOT / 'storage/app/private/investmoz-v2/portal-audit'
|
|
original = (ROOT / 'tools/portal-country-https-persistence.php').read_text(encoding='utf-8')
|
|
original = original.replace("$dir.'/country-https-chromium-20261011.json'", "$dir.'/portal-stability-country-chromium-20261011.json'")
|
|
original = original.replace("$target=$backup['restored_target'];", "$restoration=json_decode(file_get_contents($dir.'/portal-stability-country-final-restore.json'),true,512,JSON_THROW_ON_ERROR);$target=$restoration['target'];")
|
|
original = original.replace('country-production-installer@example.invalid', 'stability-installer@example.invalid')
|
|
original = original.replace('candidate-browser-qa-only', 'stability-qa-only')
|
|
original = original.replace("['\"public\".\"sessions\"']", "['\"public\".\"sessions\"','\"public\".\"cache\"','\"public\".\"cache_locks\"']")
|
|
original = original.replace("$link['directory'].'/files-restored/runtime/effective-runtime.json'", "$restoration['file_directory'].'/runtime/effective-runtime.json'")
|
|
original = original.replace("$dir.'/country-https-persistence-20261011.json'", "$dir.'/portal-stability-country-persistence.json'")
|
|
original = original.replace("source_system='organization-country' ORDER BY id", "source_system='organization-country' ORDER BY created_at,id")
|
|
(ROOT / 'tools/portal-stability-country-persistence.php').write_text(original, encoding='utf-8')
|
|
# The template now matches the actual guarded runtime exercised by both Apache vhosts.
|
|
plan = json.loads((D / 'portal-stability-latest.json').read_text(encoding='utf-8'))
|
|
(ROOT / 'tools/portal-stability-runtime.php').write_bytes((Path(plan['source']) / 'tools/portal-stability-runtime.php').read_bytes())
|
|
print(json.dumps({'generated': 'QA-only COUNTRY persistence verifier', 'template': 'guarded dual-vhost runtime', 'active_writes': 0}))
|