How do I make composer download via URL or SSH of GitHub

0

In the code json below I can only clone the PHPMailer dependencies from the repository if the CpanelInc / xmlapi-php url is not set to repositories in código , when I go to https url or ssh 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

link

    
asked by anonymous 13.07.2016 / 02:47

1 answer

1

Because this repository does not have a composer.json file, you specify it as a package rather than 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"
    }

}
    
13.07.2016 / 09:16