Browse Source

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

Jordi Boggiano 9 years ago
parent
commit
ddd140fd1c
2 changed files with 4 additions and 2 deletions
  1. 1 1
      src/Composer/Plugin/PluginInterface.php
  2. 3 1
      src/Composer/Plugin/PluginManager.php

+ 1 - 1
src/Composer/Plugin/PluginInterface.php

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

+ 3 - 1
src/Composer/Plugin/PluginManager.php

@@ -123,7 +123,9 @@ class PluginManager
             $currentPluginApiVersion = $this->getPluginApiVersion();
             $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>');
                 return;
             }