diff --git a/res/composer-schema.json b/res/composer-schema.json index 96b708f88..bba26f718 100644 --- a/res/composer-schema.json +++ b/res/composer-schema.json @@ -143,6 +143,10 @@ "type": "string" } }, + "gitlab-protocol": { + "enum": ["git", "http", "https"], + "description": "A protocol to force use of when creating a repository URL for the `source` value of the package metadata. One of `git` or `http`. By default, Composer will generate a git URL for private repositories and http one for public repos." + }, "bearer": { "type": "object", "description": "A hash of domain name => bearer authentication token, for example {\"example.com\":\"\"}.", diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index 232bb3742..650daa594 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -330,6 +330,14 @@ EOT return $val; }, ), + 'gitlab-protocol' => array( + function ($val) { + return in_array($val, array('git', 'http', 'https'), true); + }, + function ($val) { + return $val; + }, + ), 'store-auths' => array( function ($val) { return in_array($val, array('true', 'false', 'prompt'), true);