pantheon-systems / terminus-installer

Installer for Pantheon Terminus
MIT License
7 stars 6 forks source link

Warn or fail if required php extensions are not present #43

Open mbaynton opened 5 years ago

mbaynton commented 5 years ago

I think it's easy enough for a user's first experience with terminus to go something like:

$ curl -O https://raw.githubusercontent.com/pantheon-systems/terminus-installer/master/builds/installer.phar && php installer.phar install
$ vendor/bin/terminus
PHP Fatal error:  Uncaught ReflectionException: Class DOMDocument does not exist in /home/mpantheon/terminus/vendor/consolidation/output-formatters/src/Transformations/DomToArraySimplifier.php:24

I can think of a few alternatives to improve on this UX:

  1. Quick & dirty: add ext-xml and any other required extensions to terminus's composer.json (granted, this one isn't really the purview of the installer.) This is easy and should net error messages that are a little composery/cryptic, but at least say there's a problem with unmet requirements, instead of "Fatal error."
  2. Add runtime checks to the installer that generate clear error messages and/or reference pantheon.io/docs page.
    • Advantages: Better error message possible.
    • Disadvantages: Must develop & tests.
  3. Add runtime checks to terminus that generate clear error messages and/or reference pantheon.io/docs page.
    • Advantages: Better error message possible. Covers terminus as .phar users.
    • Disadvantages: Must develop & tests.

I'm happy to tackle 2 or 3 or both but wanted to have a conversation around it as next step.