Install Private Extension Using Composer

Is there a way to install extension from private git server using composer so it gets signed in to the extension.php?

We have our main repository in our private server and we managed the composer to download it properly by adding following code:




"repositories": [

    {

        "type": "package",

        "package": {

            "name": "author/yii2-user",

            "version": "dev-master",

            "source": {

                "url": "ssh://git@my.server.pl/srv/git/user.git",

                "type": "git",

                "reference": "origin/master"

            }

        }

    }

],



and




"author/yii2-user": "*"



to the require section in projects composer.json.

The extensions composer.json is:




{

	"name": "author/yii2-user",

	"description": "Auth and user manager for our apps",

	"keywords": ["yii", "admin", "auth"],

	"type": "yii2-extension",

	"support": {

		"issues": "",

		"source": ""

	},

	"authors": [

		{

			"name": "j2",

			"email": "j2@j2.j2"

		}

	],

	"require": {

		"yiisoft/yii2": "*",

		"yiisoft/yii2-bootstrap": "*"

	},

	"autoload": {

		"psr-4": {

			"author\\user\\": ""

		}

	}

    }



Unfortunately extension.php file is not being changed.

It seems the type packages in repositories section is not the way to go. It has to be done like this:




"repositories": [

      {

          "type": "git",

          "url": "ssh://git@my.server.pl/srv/git/user.git"

      }  

    ],



That causes it to be properly configured after downloading. It’s still not added to yiisoft/extension.php but it’s normal. I was misguided by some answer before.