From 3533b186614e5b2ed5c629b61b0dd6e0bba37008 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 23 Apr 2022 10:43:51 +0100 Subject: [PATCH] Switch wordpress version check to use the JSON API --- cookbooks/wordpress/libraries/wordpress.rb | 6 +++--- cookbooks/wordpress/metadata.rb | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cookbooks/wordpress/libraries/wordpress.rb b/cookbooks/wordpress/libraries/wordpress.rb index dead03256..1ea858587 100644 --- a/cookbooks/wordpress/libraries/wordpress.rb +++ b/cookbooks/wordpress/libraries/wordpress.rb @@ -2,7 +2,7 @@ require "chef/mixin/shell_out" require "addressable" require "httpclient" -require "php_serialize" +require "json" class Chef module Wordpress @@ -27,11 +27,11 @@ class Chef private def core_version_check - api_get("https://api.wordpress.org/core/version-check/1.6") + api_get("https://api.wordpress.org/core/version-check/1.7") end def api_get(url) - @api_responses[url] ||= ::PHP.unserialize(::HTTPClient.new.get_content(url)) + @api_responses[url] ||= ::JSON.parse(::HTTPClient.new.get_content(url)) end def svn_cat(url) diff --git a/cookbooks/wordpress/metadata.rb b/cookbooks/wordpress/metadata.rb index ae7816541..09e29c133 100644 --- a/cookbooks/wordpress/metadata.rb +++ b/cookbooks/wordpress/metadata.rb @@ -15,4 +15,3 @@ depends "mysql" depends "php" depends "ssl" gem "httpclient" -gem "php_serialize" -- 2.39.5