1
0
Fork 0

Rollback plugin api version to 1.0.0 for now, add warning about requiring 1.0.0 exactly

pull/4813/merge
Jordi Boggiano 2016-01-22 18:50:30 +00:00
parent 5ec6988218
commit ddd140fd1c
2 changed files with 4 additions and 2 deletions

View File

@ -27,7 +27,7 @@ interface PluginInterface
* *
* @var string * @var string
*/ */
const PLUGIN_API_VERSION = '1.1.0'; const PLUGIN_API_VERSION = '1.0.0';
/** /**
* Apply plugin modifications to Composer * Apply plugin modifications to Composer

View File

@ -123,7 +123,9 @@ class PluginManager
$currentPluginApiVersion = $this->getPluginApiVersion(); $currentPluginApiVersion = $this->getPluginApiVersion();
$currentPluginApiConstraint = new Constraint('==', $this->versionParser->normalize($currentPluginApiVersion)); $currentPluginApiConstraint = new Constraint('==', $this->versionParser->normalize($currentPluginApiVersion));
if (!$requiresComposer->matches($currentPluginApiConstraint)) { if ($requiresComposer->getPrettyString() === '1.0.0' && $this->getPluginApiVersion() === '1.0.0') {
$this->io->writeError('<warning>The "' . $package->getName() . '" plugin requires composer-plugin-api 1.0.0, this *WILL* break in the future and it should be fixed ASAP (require ^1.0 for example).</warning>');
} elseif (!$requiresComposer->matches($currentPluginApiConstraint)) {
$this->io->writeError('<warning>The "' . $package->getName() . '" plugin was skipped because it requires a Plugin API version ("' . $requiresComposer->getPrettyString() . '") that does not match your Composer installation ("' . $currentPluginApiVersion . '"). You may need to run composer update with the "--no-plugins" option.</warning>'); $this->io->writeError('<warning>The "' . $package->getName() . '" plugin was skipped because it requires a Plugin API version ("' . $requiresComposer->getPrettyString() . '") that does not match your Composer installation ("' . $currentPluginApiVersion . '"). You may need to run composer update with the "--no-plugins" option.</warning>');
return; return;
} }