Skip to content
This repository has been archived by the owner on Oct 11, 2018. It is now read-only.

Version switch #165

Open
wants to merge 6 commits into
base: php7.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion manifests/apache/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
$section = 'PHP',
$value = undef,
) {

include ::php::apache::params

if $file {
Expand Down
34 changes: 30 additions & 4 deletions manifests/apache/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,37 @@
class php::apache::params {

$ensure = $php::params::ensure
$package = 'libapache2-mod-php5'
$provider = undef
$inifile = '/etc/php/7.0/apache2/php.ini'
$settings = [ ]

$service_name = 'apache2'

case $::osfamily {
'Debian': {
case $::operatingsystem {
'Debian': {
if (versioncmp($::operatingsystemrelease, '9') >= 0) {
$service_name = 'apache2'
$package = 'libapache2-mod-php7.0'
$inifile = '/etc/php/7.0/apache2/php.ini'
} else {
$service_name = 'apache2'
$package = 'libapache2-mod-php5'
$inifile = '/etc/php5/apache2/php.ini'
}
}
default: {
$server_name = 'apache2'
$package = 'libapache2-mod-php7.0'
$inifile = '/etc/php/7.0/apache2/php.ini'
}
}
}
#
# @todo RedHat uses 'httpd' as service name
#
default: {
$service_name = 'apache2'
$package = 'libapache2-mod-php7.0'
$inifile = '/etc/php/7.0/apache2/php.ini'
}
}
}
25 changes: 23 additions & 2 deletions manifests/cli/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,30 @@
class php::cli::params {

$ensure = $php::params::ensure
$package = 'php7.0-cli'
$provider = undef
$inifile = '/etc/php/7.0/cli/php.ini'
$settings = [ ]

case $::osfamily {
'Debian': {
case $::operatingsystem {
'Debian': {
if (versioncmp($::operatingsystemrelease, '9') >= 0) {
$inifile = '/etc/php/7.0/cli/php.ini'
$package = 'php7.0-cli'
} else {
$inifile = '/etc/php5/cli/php.ini'
$package = 'php5-cli'
}
}
default: {
$inifile = '/etc/php/7.0/cli/php.ini'
$package = 'php7.0-cli'
}
}
}
default: {
$inifile = '/etc/php/7.0/cli/php.ini'
$package = 'php7.0-cli'
}
}
}
4 changes: 2 additions & 2 deletions manifests/composer.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# Copyright 2012-2015 Christian "Jippi" Winther, unless otherwise noted.
#
class php::composer (
$cli_package = $php::composer::params::cli_package,
$source = $php::composer::params::source,
$destination = $php::composer::params::destination
) inherits php::composer::params {
Expand All @@ -36,7 +37,7 @@
creates => $destination,
path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ],
require => [
Package['php7.0-cli']
Package[$cli_package]
]
}

Expand All @@ -46,5 +47,4 @@
group => root,
require => Exec['download composer'],
}

}
20 changes: 20 additions & 0 deletions manifests/composer/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,24 @@
$max_age = 30
$source = 'https://getcomposer.org/composer.phar'
$destination = '/usr/local/bin/composer'

case $::osfamily {
'Debian': {
case $::operatingsystem {
'Debian': {
if (versioncmp($::operatingsystemrelease, '9') >= 0) {
$cli_package = 'php7.0-cli'
} else {
$cli_package = 'php5-cli'
}
}
default: {
$cli_package = 'php7.0-cli'
}
}
}
default: {
$cli_package = 'php7.0-cli'
}
}
}
23 changes: 21 additions & 2 deletions manifests/contrib/base_package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,28 @@
$ensure,
$provider = undef
) {
case $::osfamily {
'Debian': {
case $::operatingsystem {
'Debian': {
if (versioncmp($::operatingsystemrelease, '9') >= 0) {
$package = 'php7.0-common'
} else {
$package = 'php5-common'
}
}
default: {
$package = 'php7.0-common'
}
}
}
default: {
$package = 'php7.0-common'
}
}

if !defined(Package['php7.0-common']) {
package { 'php7.0-common':
if !defined(Package[$package]) {
package { $package:
ensure => $ensure,
provider => $provider
}
Expand Down
20 changes: 19 additions & 1 deletion manifests/dev/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,25 @@
class php::dev::params {

$ensure = $php::params::ensure
$package = 'php7.0-dev'
$provider = undef

case $::osfamily {
'Debian': {
case $::operatingsystem {
'Debian': {
if (versioncmp($::operatingsystemrelease, '9') >= 0) {
$package = 'php7.0-dev'
} else {
$package = 'php5-dev'
}
}
default: {
$package = 'php7.0-dev'
}
}
}
default: {
$package = 'php7.0-dev'
}
}
}
37 changes: 21 additions & 16 deletions manifests/extension/apc/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,29 @@
class php::extension::apc::params {

$ensure = $php::params::ensure
$package = $::lsbdistcodename ? {
# php-apc is phased out as of Ubuntu 13.10 (saucy)
# and Debian jessie in favour of php5-apcu
# Debian
'squeeze' => 'php-apc',
'wheezy' => 'php-apc',

# Ubuntu
'lucid' => 'php-apc',
'precise' => 'php-apc',
'quantal' => 'php-apc',
'raring' => 'php-apc',

# Default to support future distros cleanly.
default => 'php7.0-apcu',
}
$provider = undef
$inifile = "${php::params::config_root_ini}/apc.ini"
$settings = [ ]

case $::osfamily {
'Debian': {
case $::operatingsystem {
'Debian': {
if (versioncmp($::operatingsystemrelease, '8') == 0) {
$package = 'php5-apcu'
} elsif (versioncmp($::operatingsystemrelease, '9') >= 0) {
$package = 'php-apcu'
} else {
$package = 'php-apc'
}
}
default: {
$package = 'php-apcu'
}
}
}
default: {
$package = 'php-apcu'
}
}
}
21 changes: 20 additions & 1 deletion manifests/extension/apcu/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,27 @@
class php::extension::apcu::params {

$ensure = $php::params::ensure
$package = 'php7.0-apcu'
$provider = undef
$inifile = "${php::params::config_root_ini}/apcu.ini"
$settings = []

case $::osfamily {
'Debian': {
case $::operatingsystem {
'Debian': {
if (versioncmp($::operatingsystemrelease, '9') >= 0) {
$package = 'php-apcu'
} else {
$package = 'php5-apcu'
}
}
default: {
$package = 'php-apcu'
}
}
}
default: {
$package = 'php-apcu'
}
}
}
20 changes: 19 additions & 1 deletion manifests/extension/curl/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,27 @@
class php::extension::curl::params {

$ensure = $php::params::ensure
$package = 'php7.0-curl'
$provider = undef
$inifile = "${php::params::config_root_ini}/curl.ini"
$settings = [ ]

case $::osfamily {
'Debian': {
case $::operatingsystem {
'Debian': {
if (versioncmp($::operatingsystemrelease, '9') >= 0) {
$package = 'php7.0-curl'
} else {
$package = 'php5-curl'
}
}
default: {
$package = 'php7.0-curl'
}
}
}
default: {
$package = 'php7.0-curl'
}
}
}
20 changes: 19 additions & 1 deletion manifests/extension/gd/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,27 @@
class php::extension::gd::params {

$ensure = $php::params::ensure
$package = 'php7.0-gd'
$provider = undef
$inifile = "${php::params::config_root_ini}/gd.ini"
$settings = [ ]

case $::osfamily {
'Debian': {
case $::operatingsystem {
'Debian': {
if (versioncmp($::operatingsystemrelease, '9') >= 0) {
$package = 'php7.0-gd'
} else {
$package = 'php5-gd'
}
}
default: {
$package = 'php7.0-gd'
}
}
}
default: {
$package = 'php7.0-gd'
}
}
}
20 changes: 19 additions & 1 deletion manifests/extension/gearman/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,27 @@
class php::extension::gearman::params {

$ensure = $php::params::ensure
$package = 'php7.0-gearman'
$provider = undef
$inifile = "${php::params::config_root_ini}/gearman.ini"
$settings = [ ]

case $::osfamily {
'Debian': {
case $::operatingsystem {
'Debian': {
if (versioncmp($::operatingsystemrelease, '9') >= 0) {
$package = 'php-gearman'
} else {
$package = 'php5-gearman'
}
}
default: {
$package = 'php-gearman'
}
}
}
default: {
$package = 'php-gearman'
}
}
}
19 changes: 19 additions & 0 deletions manifests/extension/http/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,23 @@
$inifile = "${php::params::config_root_ini}/http.ini"
$settings = [ ]

case $::osfamily {
'Debian': {
case $::operatingsystem {
'Debian': {
if (versioncmp($::operatingsystemrelease, '9') >= 0) {
$package = 'php-http'
} else {
warning('php::extension::http package does not exists on php5')
}
}
default: {
$package = 'php-http'
}
}
}
default: {
$package = 'php-http'
}
}
}
Loading