How do I download via Github URL or SSH

Asked

Viewed 124 times

0

In the code json below I can only clone from the repository the dependencies of Phpmailer, if the url of the Cpanelinc/xmlapi-php are not set in repositories in the código, when if https or ssh url generates the following error:

 [Composer\Repository\InvalidRepositoryException]                             
  No valid composer.json was found in any branch or tag of [email protected]:Cpa  
  nelInc/xmlapi-php.git, could not load a package from it.

Composer.json

{

    "name": "site.com.br",

    "authors": [
        {
            "name" : "Coringa",
            "email" : "[email protected]"
        }
    ],

    "minimum-stabilty": "alpha",    

    "repositories": [
        {
            "url": "[email protected]:CpanelInc/xmlapi-php.git",
            "type": "git"
        }
    ],

    "require": {
        "php": ">=5.6",
        "phpmailer/phpmailer": "~5.2",
        "CpanelInc/xmlapi-php": "dev-master"

    },

    "autoload": {
        "psr-4": {
            "Vendor\\": "vendor/",
            "Lib\\" : "src/Lib/",
            "Email\\": "src/Email/"
        }
    },

    "config": {
        "vendor-dir": "vendor"
    }

}

I followed this tutorial

https://getcomposer.org/doc/05-repositories.md#vcs

1 answer

1


Since this repository does not have a file composer.json, you specify it as a package instead of a repository.

I changed here and it worked normally:

{

    "name": "site.com.br",

    "authors": [
        {
            "name" : "Coringa",
            "email" : "[email protected]"
        }
    ],

    "minimum-stabilty": "alpha",

    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "CpanelInc/xmlapi-php",
                "version": "v1.0.13",
                "dist": {
                    "url": "https://github.com/CpanelInc/xmlapi-php/archive/v1.0.13.zip",
                    "type": "zip"
                },
                "source": {
                    "url": "[email protected]:CpanelInc/xmlapi-php.git",
                    "type": "git",
                    "reference": "tags/v1.0.13"
                }
            }
        }
    ],

    "require": {
        "php": ">=5.6",
        "phpmailer/phpmailer": "~5.2",
        "CpanelInc/xmlapi-php": "v1.0.13"

    },

    "autoload": {
        "psr-4": {
            "Vendor\\": "vendor/",
            "Lib\\" : "src/Lib/",
            "Email\\": "src/Email/"
        }
    },

    "config": {
        "vendor-dir": "vendor"
    }

}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.