fix: #3636584 Status report never warns when HTTrack, tar or gzip are missing

Closes https://www.drupal.org/project/earkiv/issues/3636584

What this changes

  • Hooks::requirements() reads default_archiver_plugin and default_storage_plugin, the setting names the settings form saves. Before, it read archiver and storage, which do not exist, so no plugin requirements were checked and earkiv_requirements() returned an empty array.
  • HTTrackArchiver::requirements() treats an empty result from shell_exec() as a missing command for httrack, tar and gzip. Before, a missing tar or gzip returned NULL and str_contains(NULL, ...) was FALSE, so no error was reported.
  • The three command checks discard stderr (2>/dev/null), so the shell message for a missing command does not end up in the web server log on every status report.
  • Hooks::create() passes config.factory instead of language_manager. The class is autowired as a service today, so this was not hit.

The deprecated REQUIREMENT_* constants are left as they are; they are replaced in #3597448 (!1 (closed)).

Testing

In DDEV on Drupal 11.4:

  • earkiv_requirements("runtime") with all commands installed: HTTrack shown as info with its version.
  • Same with PATH pointing to an empty directory: httrack, tar and gzip all reported as errors, and no shell messages on stderr.
  • drush core:requirements and the status report page at /admin/reports/status show the HTTrack row without errors.
  • Hooks::create() gets the config factory.

AI-Generated: Yes (Used Claude Code to find the bugs, write the fix, test it in DDEV and draft this description.)

Merge request reports

Loading
Loading