drupal-finder
drupal-finder copied to clipboard
Drastically simplify using Composer Runtime API
I think this is all thats needed now that Composer provides a Runtime API to get the paths we want.
- No longer dependant on authors customizing their composer.json
- Comes with tests.
- This should be a new major version.
This PR was motivated by DrupalFinder not working at https://github.com/ddev/ddev-drupal-contrib/pull/14 (composer.json not customized, on purpose)
I was converging on this, as well, for phpstan-drupal. I think it's safe to say everyone is on the correct version of Composer, which added this. It's been two or three years, maybe more?
It'd be great to have this merged and kick off the 2.x of the package.
I have extended the test coverage and added support for custom vendor-dir. This is rarely used, but we should nevertheless have it supported.
Added a test-case for "default" Drupal with customized path in extra.installer-paths.
Are there more obscure test cases?
I think this is OK. Custom vendor directory should automatically be handled in the compiled runtime data, as Composer installed its information there.
The README file needs work. The purpose of this library has changed with this PR. It no longer uses the "current path" or filesystem.
I was wondering if we should keep the old DrupalFinder
class around, and rename it to DrupalFinderFilesystemDiscovery
or something similar. The composer runtime approach works for tools within the shared autoloader. DrupalFinderFilesystemDiscovery
should be used to locale a Drupal installation in a generic way.
I personally would recommend the 1.x branch for non composer tools.
Updated README.
- 🚀 would love to see this get in
Hit this while trying to add mglaman/phpstan-drupal
to a local module that uses ddev/ddev-drupal-contrib
Merged https://github.com/webflo/drupal-finder/pull/65 instead