From b0a8b3ca1ea8cbc5af061cb913837a28d9b3bfea Mon Sep 17 00:00:00 2001 From: mattyrob Date: Fri, 26 Feb 2021 17:03:32 +0000 Subject: [PATCH] Add API generator for browser or direct use --- api-hashes-generator.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 api-hashes-generator.php diff --git a/api-hashes-generator.php b/api-hashes-generator.php new file mode 100644 index 0000000..51b366e --- /dev/null +++ b/api-hashes-generator.php @@ -0,0 +1,30 @@ +offers as $wp_version ) { + $filename = dirname( __FILE__ ) . '/' . 'hashes-' . $wp_version->version . '.php'; + if ( ! file_exists( $filename ) ) { + $checksums = file_get_contents( $checksum_url . $wp_version->version . $locale ); + $checksums = json_decode( $checksums, true ); + $hashes = " $checksum ) { + if ( ! strstr( $file, 'wp-content' ) ) { + $hashes .= "\t'" . $file . "' => '" . $checksum . "',\n"; + } + } + $hashes .= ");\n"; + file_put_contents( $filename, $hashes ); + echo 'Hash file created for ' . $wp_version->version . "\n"; + } +}