"description":"Package type, either 'library' for common packages, 'composer-installer' for custom installers, 'metapackage' for empty packages, or a custom type ([a-z0-9-]+) defined by whatever project this package applies to.",
"description":"Package type, either 'library' for common packages, 'composer-plugin' for plugins, 'metapackage' for empty packages, or a custom type ([a-z0-9-]+) defined by whatever project this package applies to.",
"type":"string"
},
"target-dir":{
@ -180,7 +180,7 @@
},
"extra":{
"type":["object","array"],
"description":"Arbitrary extra data that can be used by custom installers, for example, package of type composer-installer must have a 'class' key defining the installer class name.",
"description":"Arbitrary extra data that can be used by plugins, for example, package of type composer-plugin may have a 'class' key defining an installer class name.",
@ -45,6 +45,9 @@ class InstallerInstaller extends LibraryInstaller
if ('composer-installer' === $package->getType()) {
$this->registerInstaller($package);
}
if ('composer-plugin' === $package->getType()) {
$this->registerInstaller($package);
}
}
}
@ -55,7 +58,7 @@ class InstallerInstaller extends LibraryInstaller
{
$extra = $package->getExtra();
if (empty($extra['class'])) {
throw new \UnexpectedValueException('Error while installing '.$package->getPrettyName().', composer-installer packages should have a class defined in their extra key to be usable.');
throw new \UnexpectedValueException('Error while installing '.$package->getPrettyName().', composer-plugin packages should have a class defined in their extra key to be usable.');
}
parent::install($repo, $package);
@ -69,7 +72,7 @@ class InstallerInstaller extends LibraryInstaller
{
$extra = $target->getExtra();
if (empty($extra['class'])) {
throw new \UnexpectedValueException('Error while installing '.$target->getPrettyName().', composer-installer packages should have a class defined in their extra key to be usable.');
throw new \UnexpectedValueException('Error while installing '.$target->getPrettyName().', composer-plugin packages should have a class defined in their extra key to be usable.');