Le dégradé vers --frss-background-color laissait une bande visible en thème sombre (fond de l'article différent). Durcit aussi reset.php des tests e2e (écriture atomique, attente de la revalidation opcache). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
1.0 KiB
PHP
28 lines
1.0 KiB
PHP
<?php
|
|
// Run inside the FreshRSS container (mounted with the extension):
|
|
// php reset.php [collapsed_height]
|
|
// Enables the extension and mark-read-on-scroll for user "test", sets the
|
|
// collapsed height, reader view, and marks every entry unread.
|
|
declare(strict_types=1);
|
|
|
|
$height = (int)($argv[1] ?? 250);
|
|
$dir = '/var/www/FreshRSS/data/users/test';
|
|
$file = "$dir/config.php";
|
|
$conf = include $file;
|
|
$conf['extensions_enabled']['Read More'] = true;
|
|
$conf['extensions']['Read More']['collapsed_height'] = $height;
|
|
$conf['mark_when']['scroll'] = true;
|
|
$conf['view_mode'] = 'reader';
|
|
$new = "<?php\nreturn " . var_export($conf, true) . ";\n";
|
|
// Only rewrite when changed, atomically: Apache's opcache revalidates every 2 s
|
|
// and a half-written or freshly rewritten config can be served stale.
|
|
if ($new !== file_get_contents($file)) {
|
|
file_put_contents("$file.tmp", $new);
|
|
rename("$file.tmp", $file);
|
|
sleep(3);
|
|
}
|
|
|
|
$pdo = new PDO("sqlite:$dir/db.sqlite");
|
|
$pdo->exec('UPDATE entry SET is_read = 0');
|
|
echo "reset ok (height=$height)\n";
|