From f15d0ba547e9a1b20a069b03e736e70539468ea0 Mon Sep 17 00:00:00 2001
From: Stefan Galinski <stefan@sgalinski.de>
Date: Tue, 23 Jan 2018 19:19:47 +0100
Subject: [PATCH] [FEATURE] Support PHP 7.2 (not set as default)

---
 recipes/default.rb | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/recipes/default.rb b/recipes/default.rb
index e3a894c..f0fa1c2 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -83,9 +83,18 @@ if node['platform_version'] == '16.04'
 			end
 		end
 	else
-		%w(php php-cli php-curl php-intl php-gd php-mcrypt php-mysql php-xml php-json php-mbstring php-soap php-zip php-imagick).each do |name|
-			package name do
-				action :install
+		if node['ubuntu_base']['php_version'] == '7.1'
+			%w(php7.1 php7.1-cli php7.1-curl php7.1-intl php7.1-gd php7.1-mcrypt php7.1-mysql php7.1-xml php7.1-json php7.1-mbstring php7.1-soap php7.1-zip php7.1-imagick).each do |name|
+				package name do
+					action :install
+				end
+			end
+		else
+			# no mcrypt anymore
+			%w(php php-cli php-curl php-intl php-gd php-mysql php-xml php-json php-mbstring php-soap php-zip php-imagick).each do |name|
+				package name do
+					action :install
+				end
 			end
 		end
 	end
-- 
GitLab