Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add composer source for PHP #182

Merged
merged 3 commits into from
Sep 6, 2019
Merged

Add composer source for PHP #182

merged 3 commits into from
Sep 6, 2019

Conversation

jonabc
Copy link
Contributor

@jonabc jonabc commented Sep 6, 2019

Closes #152

Adds a new dependency source enumerator for composer to enumerate php package dependencies.

The primary source of information is the composer.lock file. Since licensed requires dependencies to be installed locally before it can be run and php composer.phar install will autocreate a lockfile, it should be rare to have dependencies installed without a lockfile being present.

In order for dependencies to be enumerated

  1. a php runtime needs to be present
  2. a composer.lock file must be available at the licensed app source path
  3. a composer application must be available

The composer application path defaults to composer.phar, which is appended to the licensed app source path for a final result of <repository root>/composer.phar. The composer application path can be overridden by adding a composer.application_path configuration value to .licensed.yml. The configuration value can be relative to the licensed app source path or an absolute path, and it can contain path directives like ~ or ...

BE WARNED
I haven't used PHP in about 15 years, and I haven't ever used composer before this. The implementation seemed relatively straightforward but if there are edge cases that aren't handled I will be asking those that submit issues for help 😆

@jonabc jonabc merged commit 367342e into master Sep 6, 2019
@jonabc jonabc deleted the composer branch September 6, 2019 00:12
@jonabc jonabc mentioned this pull request Sep 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Add composer dependency source
1 participant