0

I maintain a project that uses an abandoned library with a bug that affects me. I'd like to install a fork that includes the bugfix. I can't find the way.

Relevant settings were this:

{
    "type": "project",
    "license": "proprietary",
    "minimum-stability": "stable",
    "require": {
        "php": "5.3 - 5.6",
        "nuovo/spreadsheet-reader": "^0.5.11"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "vendor-dir": "Vendor/"
    }
}

I've tried too many things to share but my latest iteration is:

{
    "type": "project",
    "license": "proprietary",
    "minimum-stability": "dev",
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/virtua-network/spreadsheet-reader"
        }
    ],
    "require": {
        "php": "5.3 - 5.6",
        "nuovo/spreadsheet-reader": "dev-master"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "vendor-dir": "Vendor/"
    }
}

The package shows up in composer outdated:

PS D:\src> composer outdated
nuovo/spreadsheet-reader             0.5.11   dev-master f6bd49d Spreadsheet reader library for Excel, OpenOffice and structured text files

… but won't update:

PS D:\src> composer update nuovo/spreadsheet-reader
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files

Also, f6bd49d hash is not latest fork revision but latest original package.

How can I install the fork with Composer?

Álvaro González
  • 142,137
  • 41
  • 261
  • 360

1 Answers1

1

You're using incorrect package name - in your fork package is named as virtua-network/spreadsheet-reader, but you're requesting nuovo/spreadsheet-reader. So your fork is not considered as a nuovo/spreadsheet-reader package, but as a virtua-network/spreadsheet-reader, so original package from Packagist is used. You should either revert name change in composer.json of your fork and leave it as nuovo/spreadsheet-reader, or use new name in require of composer.json in your app:

"virtua-network/spreadsheet-reader": "dev-master"
rob006
  • 21,383
  • 5
  • 53
  • 74
  • Thank you! I did so and then `composer require virtua-network/spreadsheet-reader` and `composer remove nuovo/spreadsheet-reader`. I was using the upstream package name because that's what [this answer](https://stackoverflow.com/a/13500676/13508) says and it actually worked for me in another project with another package set. Now I understand that the name that counts is the one in the forks's `composer.json` file. – Álvaro González Jul 19 '18 at 10:23