acquia / lightning-project

A Composer-based installer for the Lightning distribution of Drupal 8. Support ended on November 2, 2021 and this project is no longer maintained.
133 stars 60 forks source link

Should "platform" be specifed for compatibility? #49

Open sdmeyers opened 7 years ago

sdmeyers commented 7 years ago

As is, when run, the composer.json file in lightning 2.2 will install packages that require PHP7.2 or greater (doctorine/annotations seems to cause the most warnings out of the box). This is bad. Acquia Cloud, for example, defaults to 5.6 and only has up to 7.1 available (DevDesktop tops out at 7.0.14). Tweaking the config part of composer.json to

    "config": {
        "bin-dir": "bin/",
        "platform": {
          "php": "5.6.0"
        }
    },

prevents unnecessary breakage while installing adequately sufficiently update packages to seemingly function just fine.

balsama commented 7 years ago

Interesting. I wasn't aware of the config => platform option. That's cool - and I can see it being useful for people that might have a different PHP version locally or in a VM.

But someone might have a perfectly good reason to want to run (for example) doctrine/inflector:1.2.0 and I think this would prevent them from doing so. So I'm hesitant to commit something like that.

sdmeyers commented 7 years ago

Agree there is a trade off; however, I'd suggest it would be best to error on the side of not breaking things on common production servers. At the very least these things should be well documented to help avoid such things.