Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 1a7728c

Browse files
authored
Merge pull request #1551 from oxyc/php72
Update php-versions role for PHP 7.2 support
2 parents 3c84e2d + 45b2812 commit 1a7728c

File tree

11 files changed

+83
-20
lines changed

11 files changed

+83
-20
lines changed

default.config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ firewall_log_dropped_packets: false
254254
firewall_disable_firewalld: true
255255
firewall_disable_ufw: true
256256

257-
# PHP Configuration. Currently-supported versions: 5.6, 7.0, 7.1.
257+
# PHP Configuration. Currently-supported versions: 5.6, 7.0, 7.1, 7.2.
258258
# See version-specific notes: http://docs.drupalvm.com/en/latest/configurations/php/
259259
php_version: "7.1"
260260
php_install_recommends: no

docs/configurations/php.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
Drupal VM defaults to PHP 7.1, but you can also install and use 5.6 or 7.0.
1+
Drupal VM defaults to PHP 7.1, but you can also install and use 5.6, 7.0 or 7.2.
22

33
## Ubuntu
44

5-
Ondřej Surý's PPA for PHP is used to install PHP 7.1, but you can switch to using 5.6 or 7.0 packages by changing `php_version` inside `config.yml` to `"5.6"` or `"7.0"`.
5+
Ondřej Surý's PPA for PHP is used to install PHP 7.1, but you can switch version by changing `php_version` inside `config.yml` to `"5.6"`, `"7.0"` or `"7.2"`.
66

77
If you're using Apache with `mod_php` you should also add `libapache2-mod-php5.6` or `libapache2-mod-php7.0` to the `extra_packages` list.
88

9-
_Note: XHProf does currently not work with PHP 7.1, make sure you don't have it listed in `installed_extras`._
9+
_Note: XHProf does currently not work with PHP 7.1+, make sure you don't have it listed in `installed_extras`._
1010

1111
## RedHat/CentOS 7
1212

13-
Remi's RPM repository is included with Drupal VM, and you can make the following changes to use it to install PHP 7.0 or PHP 5.6 instead of 7.1:
13+
Remi's RPM repository is included with Drupal VM, and you can make the following changes to use it to install a different version of PHP than 7.1:
1414

1515
1. Make sure you've followed the directions for switching to CentOS 7 in the [use a different base OS](base-os.md) guide.
16-
2. Change `php_version` inside `config.yml` to `"5.6"` or `"7.0"`.
16+
2. Change `php_version` inside `config.yml` to `"5.6"`, `"7.0"` or `"7.2"`.
1717

1818
## Using default distribution packages
1919

docs/extras/xhprof.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[XHProf](http://xhprof.io/) allows easy code profiling and can be used in many different ways. Ensure `xhprof` is in the list of `installed_extras` inside `config.yml`.
22

3-
_Note: XHProf does currently not work with PHP 7.1. The PHP extension has barely been maintained since Facebook abandoned the project around 2015, so it's difficult to get it running under newer versions of PHP. If you require support for PHP 7.1 you should use [Tideways](tideways.md) instead._
3+
_Note: XHProf does currently not work with PHP 7.1+. The PHP extension has barely been maintained since Facebook abandoned the project around 2015, so it's difficult to get it running under newer versions of PHP. If you require support for PHP 7.1 or newer, you should use [Tideways](tideways.md) instead._
44

55
### XHProf module
66

provisioning/requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
- src: geerlingguy.php-tideways
5757
version: 1.1.0
5858
- src: geerlingguy.php-versions
59-
version: 1.1.0
59+
version: 2.0.0
6060
- src: geerlingguy.php-xdebug
6161
version: 2.3.1
6262
- src: geerlingguy.php-xhprof

provisioning/roles/geerlingguy.php-versions/.travis.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,33 @@
22
services: docker
33

44
env:
5-
- distro: centos7
6-
- distro: centos6
7-
- distro: debian8
8-
- distro: ubuntu1604
9-
- distro: ubuntu1404
5+
global:
6+
php_version: "7.1"
7+
8+
matrix:
9+
# Default - PHP 7.1
10+
- distro: centos7
11+
- distro: centos6
12+
- distro: debian8
13+
- distro: ubuntu1604
14+
- distro: ubuntu1404
15+
16+
# PHP 7.2
17+
- distro: centos7
18+
playbook: test-7.2.yml
19+
php_version: "7.2"
20+
- distro: centos6
21+
playbook: test-7.2.yml
22+
php_version: "7.2"
23+
- distro: debian8
24+
playbook: test-7.2.yml
25+
php_version: "7.2"
26+
- distro: ubuntu1604
27+
playbook: test-7.2.yml
28+
php_version: "7.2"
29+
- distro: ubuntu1404
30+
playbook: test-7.2.yml
31+
php_version: "7.2"
1032

1133
script:
1234
# Configure test script so we can run extra tests after playbook is run.
@@ -21,7 +43,7 @@ script:
2143
- ${PWD}/tests/test.sh
2244

2345
# Run script to test PHP version.
24-
- 'docker exec ${container_id} env TERM=xterm php -v | grep "7.1."'
46+
- 'docker exec ${container_id} env TERM=xterm php -v | grep -F "${php_version}."'
2547

2648
notifications:
2749
webhooks: https://galaxy.ansible.com/api/v1/notifications/

provisioning/roles/geerlingguy.php-versions/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The PHP version to be installed. Any [currently-supported PHP major version](htt
2626
- hosts: webservers
2727

2828
vars:
29-
php_version: 7.1
29+
php_version: '7.1'
3030

3131
roles:
3232
- role: geerlingguy.repo-remi

provisioning/roles/geerlingguy.php-versions/tasks/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
- name: Include OS-specific variables.
3-
include_vars: "{{ ansible_os_family }}.yml"
3+
include_vars: "{{ item }}"
4+
with_fileglob:
5+
- "../vars/{{ ansible_os_family }}.yml"
6+
- "../vars/{{ ansible_os_family }}-php{{ php_version }}.yml"
47

58
- name: Define PHP variables.
69
set_fact: "{{ item.key }}={{ hostvars[inventory_hostname][item.value] }}"

provisioning/roles/geerlingguy.php-versions/tasks/setup-Debian.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
purge: yes
4646
force: yes
4747
when: "'php' + php_version not in item"
48-
with_flattened:
49-
- "{{ php_packages|regex_replace('php' + php_version, 'php5.6') }}"
50-
- "{{ php_packages|regex_replace('php' + php_version, 'php7.0') }}"
51-
- "{{ php_packages|regex_replace('php' + php_version, 'php7.1') }}"
48+
with_items:
49+
- php5.6-common
50+
- php7.0-common
51+
- php7.1-common
52+
- php7.2-common

provisioning/roles/geerlingguy.php-versions/tasks/setup-RedHat.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@
1010
- name: Enable remi repo for PHP 7.1.
1111
set_fact: php_enablerepo="remi,remi-php71"
1212
when: php_version == "7.1"
13+
14+
- name: Enable remi repo for PHP 7.2.
15+
set_fact: php_enablerepo="remi,remi-php72"
16+
when: php_version == "7.2"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
- hosts: all
3+
4+
vars:
5+
php_enable_webserver: false
6+
php_version: "7.2"
7+
8+
pre_tasks:
9+
- name: Update apt cache.
10+
apt: update_cache=yes cache_valid_time=600
11+
when: ansible_os_family == 'Debian'
12+
13+
roles:
14+
- role: geerlingguy.repo-remi
15+
when: ansible_os_family == 'RedHat'
16+
- role_under_test
17+
- geerlingguy.php

0 commit comments

Comments
 (0)