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

package name is used always from the first element #7

Open
alfredbez opened this issue Jul 29, 2019 · 1 comment
Open

package name is used always from the first element #7

alfredbez opened this issue Jul 29, 2019 · 1 comment

Comments

@alfredbez
Copy link
Contributor

Describe the bug
The package name is always fetched from the first element in the json file as you can see here:

function get_package_name($composerData) {
$data = reset($composerData);
if (!isset($data['name'])) {
return false;
}
return strtolower($data['name']);
}

In our case, there was a package with two branches which had another name in the composer.json and we were not able to install the package by the name provided in the composer.json on the develop branch.

composer.json on broken branch:

    "name": "vendorFoo/barWrong",

composer.json on develop branch:

    "name": "vendorFoo/barRight",

The resulting packages.json file showed only vendorFoo/barWrong, but not vendorFoo/barRight.

To Reproduce

  1. Create a new project with a composer.json, using vendorfoo/bar as the name
  2. Commit and push the code
  3. Create a new branch and change the name of the package in the composer.json to vendorbaz/bar. I'm not sure how to force the new branch to be on top of the other available branches and tags (alphabetical order?)
  4. Remove the cached json files on your server
  5. Regenerate the packages.json file
  6. Take a look into that file and check the name of the package, only one package should be available (either vendorfoo/bar or vendorbaz/bar)

Expected behavior
I expected to be able to install both packages.

@keywan-ghadami-oxid
Copy link
Owner

should be fixed on master branch, it collects now all names from all branches.

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

No branches or pull requests

2 participants