Skip to content

Windows task execution fix and refactored system task registry - #2429

Open
elcreator wants to merge 2 commits into
evolution-cms:3.5.xfrom
elcreator:feat-system-task-registry
Open

Windows task execution fix and refactored system task registry#2429
elcreator wants to merge 2 commits into
evolution-cms:3.5.xfrom
elcreator:feat-system-task-registry

Conversation

@elcreator

@elcreator elcreator commented Aug 23, 2026

Copy link
Copy Markdown

#2428 should be merged first

Fix 1 — Composer detection on Windows

Turned out to need three parts, not one. The third only surfaced because I tested instead of assuming:

  • shellCommandExists() — command -v X >/dev/null 2>&1 → branches to where X >NUL 2>NUL on Windows. Verified: exit 0 for a real command, 1 for a bogus one.
  • composerBinaryCandidates() — added %ProgramData%\ComposerSetup\bin\composer.bat|.exe, %APPDATA%\Composer\composer.bat|.exe, and the AppData/Roaming form of each home directory. composer.phar is deliberately excluded: it
    needs php in front, and this list feeds a directly-executed command.
  • isExecutableFile() — new, and the part I'd have missed. is_executable() returns false on Windows even for a genuine composer.bat (verified against the real C:\ProgramData\ComposerSetup\bin\composer.bat: is_file()=true,
    is_executable()=false). Without this, every Windows candidate would be rejected no matter which paths I added, and fix 2 of 3 would have been silently useless.

One design change mid-way: I first made composerBinaryCandidates() switch on platform, which broke the existing test site updater checks user local composer path as a fallback (it asserts the POSIX path is present, and passed
on Windows before). Candidates are filtered by existence anyway, so I made the list a superset instead — an impossible entry costs one is_file() call, and a platform branch is just a new way to guess wrong under WSL.

Fix 2 — PostgreSQL backup on Windows

PGPASSWORD=… pg_dump … >> file via exec() replaced with Symfony Process taking an argument list and ['PGPASSWORD' => $password] as env. Verified the old form fails here: 'PGPASSWORD' is not recognized as an internal or
external command.

I kept it streaming. The shell redirect it replaces streamed to disk; getOutput() would have buffered an entire database dump in memory, which would have been a regression on exactly the databases worth backing up. The run
callback writes each chunk to an append handle. Also added clearstatcache() before the filesize() check, which the shell version didn't need.

@elcreator elcreator changed the title Feat system task registry Windows task execution fix and refactored system task registry Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant