# Puppet Class: php::packages

Inherits:
  ::php::params

Defined in:
  manifests/packages.pp

## Overview

Install common PHP packages

=== Parameters

[ensure] Specify which version of PHP packages to install

[names] List of the names of the package to install

[names_to_prefix] List of packages names that should be prefixed with the common package prefix `$php::package_prefix`

Parameters:

- ensure (`String`) (defaults to: `$::php::ensure`)
- manage_repos (`Boolean`) (defaults to: `$::php::manage_repos`)
- names_to_prefix (`Array`) (defaults to: `prefix($::php::params::common_package_suffixes, $::php::package_prefix)`)
- names (`Array`) (defaults to: `$::php::params::common_package_names`)

    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
    # File 'manifests/packages.pp', line 15

    class php::packages (
      String $ensure         = $::php::ensure,
      Boolean $manage_repos  = $::php::manage_repos,
      Array $names_to_prefix = prefix($::php::params::common_package_suffixes, $::php::package_prefix),
      Array $names           = $::php::params::common_package_names,
    ) inherits ::php::params {

      if $caller_module_name != $module_name {
        warning('php::packages is private')
      }

      $real_names = union($names, $names_to_prefix)
      if $facts['os']['family'] == 'debian' {
        if $manage_repos {
          include ::apt
          Class['::apt::update'] -> Package[$real_names]
        }
        package { $real_names:
          ensure => $ensure,
        }
      } else {
        package { $real_names:
          ensure => $ensure,
        }
      }
    }