From 8313e8687756059ef318a01386de2e3b789cebdd Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 10 Sep 2016 11:34:17 +0200 Subject: [PATCH] Remove hash from composer.lock as content-hash has been out over a year and since 1.0.0-alpha11, refs #5653 --- src/Composer/Package/Locker.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Composer/Package/Locker.php b/src/Composer/Package/Locker.php index 5f491ae9a..12102e3e6 100644 --- a/src/Composer/Package/Locker.php +++ b/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,