Defined Type: php::config

Defined in:
manifests/config.pp

Overview

Class: php::config

Configure php.ini settings for a PHP SAPI

Parameters

file

The path to ini file

config

An array of augeas commands to execute

Variables

No variables

Examples

php::config { ‘$unique-name’:

file  => '$full_path_to_ini_file'
config => [
  'set .anon/apc.enabled 1'
]

}

Authors

Christian “Jippi” Winther <jippignu@gmail.com>

Copyright 2012-2014 Christian “Jippi” Winther, unless otherwise noted.

Parameters:

  • file (Any)
  • ensure (Any) (defaults to: 'present')
  • config (Any) (defaults to: undef)
  • section (Any) (defaults to: 'PHP')
  • setting (Any) (defaults to: undef)
  • value (Any) (defaults to: undef)
  • source (Any) (defaults to: undef)


34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'manifests/config.pp', line 34

define php::config(
  $file,
  $ensure   = 'present',
  $config   = undef,
  $section  = 'PHP',
  $setting  = undef,
  $value    = undef,
  $source   = undef,
) {

  include ::php

  if $config {

    $unique_title = $source ? {
      undef   => $title,
      default => "${source}-${title}",
    }

    php::config::augeas { $unique_title:
      file   => $file,
      config => $config,
    }

  } else {
    validate_re($ensure, '(absent|present)', "${module_name}'s php::config: ensure must either be 'absent' or 'present' on ${::fqdn}")


    php::config::dwim { $title:
      ensure  => $ensure,
      file    => $file,
      section => $section,
      setting => $setting,
      value   => $value,
    }
  }
}