Browse Source

Remove hash from composer.lock as content-hash has been out over a year and since 1.0.0-alpha11, refs #5653

Jordi Boggiano 8 years ago
parent
commit
8313e86877
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/Composer/Package/Locker.php

+ 7 - 2
src/Composer/Package/Locker.php

@@ -131,7 +131,13 @@ class Locker
             return $this->contentHash === $lock['content-hash'];
         }
 
-        return $this->hash === $lock['hash'];
+        // BC support for old lock files without content-hash
+        if (!empty($lock['hash'])) {
+            return $this->hash === $lock['hash'];
+        }
+
+        // should not be reached unless the lock file is corrupted, so assume it's out of date
+        return false;
     }
 
     /**
@@ -285,7 +291,6 @@ class Locker
             '_readme' => array('This file locks the dependencies of your project to a known state',
                                'Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file',
                                'This file is @gener'.'ated automatically', ),
-            'hash' => $this->hash,
             'content-hash' => $this->contentHash,
             'packages' => null,
             'packages-dev' => null,