Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature: Specify a different path of composer.json file #894

@meteorlxy

Description

@meteorlxy

Describe the feature

Per the docs:

php-version (optional)

  • ...
  • If not specified, it looks for the following in order:
    • The php-version-file input if it exists
    • A composer.lock file and the platform-overrides.php value
    • A composer.json file and the config.platform.php value

However, if composer.json file is in a different sub directory, it could not be located correctly.

So it would be better to support specifying a different path of composer.json file.

Please check the latest release

  • I have checked releases, and the feature is missing in the latest patch version of v2.

Underlying issue

Currently the filepath is hard-coded. It would be better to make it customizable:

setup-php/src/utils.ts

Lines 455 to 456 in 85a8dfd

const composerJson = 'composer.json';
if (fs.existsSync(composerJson)) {

Describe alternatives

No response

Additional context

No response

Are you willing to submit a PR?

Yes

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions