DrupalStand / drupal-dev-docker

An opinionated Drupal development environment based on Docker.
GNU General Public License v2.0
22 stars 19 forks source link

bin/composer require doesn't work #27

Closed subtera745 closed 6 years ago

subtera745 commented 6 years ago

Orignal master branch of drupal-dev-docker had an issue with composer require when trying to install new files. An error would throw requiring various php extensions enabled. Added an ignore command to bypass the php requirements, and now the command works as required. The command is now, 'composer-require'. When ran the command is,'make composer-require drupal/example'.

smfsh commented 6 years ago

More than that, I really don't like the solution. We do not run any user exposed composer commands through the make file and we shouldn't assume we know exactly which composer commands will be run by any given user. You're adding a command specifically for require but what about remove or update or any of those like them. bin/composer is exposed to the user as a replacement for composer just as it would be on their own machine. The user can pass the ignore directive if they feel so inclined. Additionally, they can "spoof" this information in the composer.json file.

More importantly, I do not want to be in the business of suppressing errors and warnings when users might not know they're there. If this PR does anything, I'd say its adding a section to the README that states the nature of whats going on: "Because composer doesn't know what your production server or development containers enabled extensions might be, it might be nescessary to force your installation using the --ignore-platform-reqs directive."

subtera745 commented 6 years ago

Updated the repository. Had to add the exact php version because symfony started throwing errors.

jackinloadup commented 6 years ago

@smfsh looks good to me. Like you said symfony required 7.1... well 7.1.3 hence setting it more specifically.

Any additional thoughts before this gets merged in ?