Repository navigation
Conversation
…efused
disable_php_session_upload_progress backs up custom.ini before it writes the file. When site-command then refuses the write without touching the file (a hard link, a symlink swapped in, a changed file, an older site-command), the warning still said "The original custom.ini is <backup>", as if the file had been changed, and the backup and its dir stayed after up() and down().
Only a failed write ("could not write ...") can leave the file changed, so only that case keeps the backup and names it. Any other refusal now warns "Skipped disabling session.upload_progress for <site>: <reason>", like the other skips, and removes the site's backup dir, and the migration's backup dir once it is empty. A backup that fails part-way is cleaned up the same way.
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
Same change as in site-type-wp, for PHP sites. The session upload progress migration backs up custom.ini before writing it. When the write is then refused and the file is left as it was (for example because custom.ini is a hard link), the warning pointed to the backup as "the original custom.ini" as if the file had been changed, and the backup dir under
/opt/easyengine/.backup/session-upload-progress-php-<date>/was left behind after up() and down().Now only a write that failed part-way keeps the backup and names it in the warning, as before. Any other refusal is reported as "Skipped disabling session.upload_progress for : ", like the other skips, and its backup is removed, along with the migration's backup dir once it is empty. A failed backup is cleaned up the same way.
This migration already shipped in v4.13.3, and container migrations run once per host, so the change only reaches hosts that upgrade from 4.13.2 or older. A host already on 4.13.3 or 4.14.0 where a write was refused keeps that backup dir; it holds only an unchanged copy of the site's custom.ini and can be deleted by hand.
Tested with new PHPUnit tests on PHP 7.4 and 8.5: a hard-linked custom.ini leaves no backup and no backup path in the warning, and a run with one refused site and one changed site keeps only the changed site's backup until down() restores it. Both tests fail before the change. A write that fails part-way (file size limit) still keeps its backup, names it and leaves custom.ini with its original content, before and after. An end-to-end run of the migration differs from before only in the hard-linked site's warning and in leaving no backup dir.
Summary by CodeRabbit