Core_Upgrader::check_files()

Compare the disk file checksums against the expected checksums.


Return

(bool) True if the checksums match, otherwise false.


Source

File: wp-admin/includes/class-core-upgrader.php

	public function check_files() {
		global $cp_version;

		if ( version_compare( $cp_version, '1.3.0-rc1', '<' ) ) {
			// This version of ClassicPress has a `get_core_checksums()`
			// function which incorrectly expects a WordPress version, so there
			// is no point in continuing.
			return false;
		}

		$checksums = get_core_checksums( $cp_version, 'en_US' );

		if ( ! is_array( $checksums ) )
			return false;

		foreach ( $checksums as $file => $checksum ) {
			// Skip files which get updated
			if ( 'wp-content' == substr( $file, 0, 10 ) )
				continue;
			if ( ! file_exists( ABSPATH . $file ) || md5_file( ABSPATH . $file ) !== $checksum )
				return false;
		}

		return true;
	}


Changelog

Changelog
Version Description
3.7.0
CP-1.3.0 Correctly uses the checksums for the current ClassicPress version, not the equivalent WordPress version. This function is no longer used during the core update process. Introduced. CP-1.3.0 Correctly uses the checksums for the current ClassicPress version, not the equivalent WordPress version. This function is no longer used during the core update process.