Skip to content

Commit

Permalink
Merge pull request #61 from palantirnet/update-php-7.1
Browse files Browse the repository at this point in the history
Update to PHP 7.1
  • Loading branch information
becw authored Apr 6, 2018
2 parents b5365a6 + 71827b2 commit f8163e9
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 32 deletions.
21 changes: 13 additions & 8 deletions drupalbox/tests/php_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative 'spec_helper'

# Different PHP cli packages should be installed depending on the Ubuntu version.
describe package("php7.0-cli") do
describe package("php7.1-cli") do
it { should be_installed }
end

Expand All @@ -12,12 +12,11 @@
intl
json
mbstring
mcrypt
sqlite3
xml
}.each do |pkg|
# The PHP extension's package should be installed from apt.
describe package("php7.0-#{pkg}") do
describe package("php7.1-#{pkg}") do
it { should be_installed }
end

Expand All @@ -27,16 +26,22 @@
end
end

# The memcached extension uses a package naming pattern.
# The following extensions use different package naming patterns.
describe package("php-memcached") do
it { should be_installed }
end
context php_extension("memcached") do
it { should be_loaded }
end

# The MySQL extension uses a different name for the package vs. the extension.
describe package("php7.0-mysql") do
describe package("php7.1-mcrypt") do
it { should be_installed }
end
context php_extension("mcrypt") do
it { should be_loaded }
end

describe package("php7.1-mysql") do
it { should be_installed }
end
context php_extension("mysqli") do
Expand All @@ -47,10 +52,10 @@
describe package("php-xdebug") do
it { should be_installed }
end
describe file('/etc/php/7.0/fpm/conf.d/20-xdebug.ini') do
describe file('/etc/php/7.1/fpm/conf.d/20-xdebug.ini') do
it { should be_symlink }
end
describe file('/etc/php/7.0/cli/conf.d/20-xdebug.ini') do
describe file('/etc/php/7.1/cli/conf.d/20-xdebug.ini') do
it { should_not exist }
end

Expand Down
28 changes: 14 additions & 14 deletions provisioning/roles/php7/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
php7_modules:
- php-curl
- php-gd
- php-intl
- php-json
- php-mcrypt
- php-mysql
- php-sqlite3
- php7.1-curl
- php7.1-gd
- php7.1-intl
- php7.1-json
- php7.1-mcrypt
- php7.1-mysql
- php7.1-sqlite3
- php-memcached
- php7.0-mbstring
- php-bcmath
- php-bz2
- php7.0-dba
- php-soap
- php-xml
- php-zip
- php7.1-mbstring
- php7.1-bcmath
- php7.1-bz2
- php7.1-dba
- php7.1-soap
- php7.1-xml
- php7.1-zip

php7_modules_enable:
- mcrypt
Expand Down
22 changes: 14 additions & 8 deletions provisioning/roles/php7/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
---

- name: Add apt-repository
become: yes
apt_repository:
repo: "ppa:ondrej/php"
tags: php5

- name: Install PHP
become: yes
apt: name={{ item }} state=latest
with_items:
- php7.0-cli
- php7.0-fpm
- libapache2-mod-php7.0
- php7.1-cli
- php7.1-fpm
- libapache2-mod-php7.1
- php-pear
- php7.0-common
- php7.0-dev
- php7.1-common
- php7.1-dev
- php-console-table
tags: php7

Expand All @@ -27,15 +33,15 @@

- name: Enable Apache Module
become: yes
command: /usr/sbin/a2enmod php7.0
command: /usr/sbin/a2enmod php7.1
tags: php7

- name: Update php.ini (cli)
become: yes
template: src=php.ini.j2 dest={{ item }} owner=root group=root
with_items:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/fpm/php.ini
- /etc/php/7.1/cli/php.ini
- /etc/php/7.1/fpm/php.ini
tags: php7

- include: pecl.yml
Expand Down
2 changes: 1 addition & 1 deletion provisioning/roles/php7/tasks/pecl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
become: yes
template:
src: yaml.ini.j2
dest: /etc/php/7.0/mods-available/yaml.ini
dest: /etc/php/7.1/mods-available/yaml.ini
tags: php7

- name: Enable YAML extension
Expand Down
2 changes: 1 addition & 1 deletion provisioning/roles/php7/tasks/xdebug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
become: yes
template:
src: xdebug.ini.j2
dest: /etc/php/7.0/mods-available/xdebug.ini
dest: /etc/php/7.1/mods-available/xdebug.ini
tags: php7

- name: Enable XDebug
Expand Down

0 comments on commit f8163e9

Please sign in to comment.