Puppet Class: php::dev

Inherits:
php::params
Defined in:
manifests/dev.pp

Overview

Install the development package with headers for PHP

Parameters

ensure

The PHP ensure of PHP dev to install

package

The package name for the PHP development files

Parameters:

  • ensure (String) (defaults to: $php::ensure)
  • package (String) (defaults to: "${php::package_prefix}${php::params::dev_package_suffix}")
  • manage_repos (Boolean) (defaults to: $php::manage_repos)


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'manifests/dev.pp', line 11

class php::dev (
  String $ensure        = $php::ensure,
  String $package       = "${php::package_prefix}${php::params::dev_package_suffix}",
  Boolean $manage_repos = $php::manage_repos,
) inherits php::params {
  assert_private()

  # On FreeBSD, Arch there is no 'devel' package. If dev_package_suffix is undef, consider to not install.
  $real_package = $php::params::dev_package_suffix ? {
    undef   => [],
    default => $package,
  }

  if $facts['os']['family'] == 'Debian' {
    # we can set the dependency only if we manage repos
    $require = $manage_repos ? {
      true  => Class['apt::update'],
      false => undef,
    }
  } else {
    $require = undef
  }

  # Default PHP come with xml module and no seperate package for it
  if $facts['os']['name'] == 'Ubuntu' {
    stdlib::ensure_packages(["${php::package_prefix}xml"], { ensure  => present, require => $require, })
  }
  package { $real_package:
    ensure  => $ensure,
    require => Class['php::packages'],
  }
}