10

I forked a library on Github and now want to load my fork into the project without adding the forked library into packagist. I get the following error after adding the repository and require to my composer.json:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package cnizzardini/ssl-certificate could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Here is my full composer.json

{
    "name": "cakephp/app",
    "description": "CakePHP skeleton app",
    "homepage": "http://cakephp.org",
    "type": "project",
    "license": "MIT",
    "require": {
        "php": ">=5.5.9",
        "cakephp/cakephp": "~3.4",
        "mobiledetect/mobiledetectlib": "2.*",
        "cakephp/migrations": "~1.0",
        "cakephp/plugin-installer": "*",
        "guzzlehttp/guzzle": "^6.2",
        "donatj/phpuseragentparser": "^0.7.0",
        "cnizzardini/ssl-certificate": "dev-master"
    },
    "require-dev": {
        "psy/psysh": "@stable",
        "cakephp/debug_kit": "~3.2",
        "cakephp/bake": "~1.1",
        "phpunit/phpunit": "^5.5"
    },
    "suggest": {
        "phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
        "cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
    },
    "autoload": {
        "psr-4": {
            "App\\": "src",
            "Api\\": "./plugins/Api/src",
            "Channel\\": "./plugins/Channel/src",
            "System\\": "./plugins/System/src",
            "Admin\\": "./plugins/Admin/src"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Test\\": "tests",
            "Cake\\Test\\": "./vendor/cakephp/cakephp/tests",
            "Api\\Test\\": "./plugins/Api/tests",
            "Channel\\Test\\": "./plugins/Channel/tests",
            "System\\Test\\": "./plugins/System/tests",
            "Admin\\Test\\": "./plugins/Admin/tests"
        }
    },
    "scripts": {
        "post-install-cmd": "App\\Console\\Installer::postInstall",
        "post-create-project-cmd": "App\\Console\\Installer::postInstall",
        "post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/cnizzardini/ssl-certificate.git"
        }
    ],
    "minimum-stability": "stable",
    "prefer-stable": true
}

I have tried adding https://github.com/cnizzardini/ssl-certificate with and without the .git. I have also tried setting minimum-stability to dev and prefer-stable to false.

Nothing works :-(

cnizzardini
  • 1,196
  • 1
  • 13
  • 29

1 Answers1

10

The composer.json file on your fork still calls the package "spatie/ssl-certificate", so that's the name of the package you need to require.

This should work:

{
    ...
    "require": {
        ...
        "spatie/ssl-certificate": "dev-master"
    },
    ...
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/cnizzardini/ssl-certificate.git"
        }
    ],
    ...
}

If it doesn't, you can rename the package on your own fork by changing the name property in its composer.json file:

{
    "name": "cnizzardini/ssl-certificate",
    "description": "A class to easily query the properties of an ssl certificate ",
    ...
}
rickdenhaan
  • 10,857
  • 28
  • 37
  • Now that pulls in the spatie/ssl-certificate. I want my fork: cnizzardini/ssl-certificate – cnizzardini Jul 28 '17 at 15:45
  • 2
    If this doesn't work, what you could try is to change the package name in your fork's [composer.json file](https://github.com/cnizzardini/ssl-certificate/blob/master/composer.json) – rickdenhaan Jul 28 '17 at 17:06
  • That worked, if you update your answer I will accept it as correct. – cnizzardini Jul 28 '17 at 17:38
  • 1
    I accepted, I'd change the solution to just say I needed to change the package name in the fork to what I was referencing in my composer.json file so others don't get confused. Thanks. – cnizzardini Jul 28 '17 at 18:05