فهرست منبع

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

Jordi Boggiano 10 سال پیش
والد
کامیت
ddd140fd1c
2فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  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;
             }