Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Locker.php

function Locker::isFresh

Checks whether the lock file is still up to date with the current hash

File

vendor/composer/composer/src/Composer/Package/Locker.php, line 138

Class

Locker
Reads/writes project lockfile (composer.lock).

Namespace

Composer\Package

Code

public function isFresh() : bool {
    $lock = $this->lockFile
        ->read();
    if (!empty($lock['content-hash'])) {
        // There is a content hash key, use that instead of the file hash
        return $this->contentHash === $lock['content-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;
}
RSS feed
Powered by Drupal