Report abuse

1
2
3
4
5
6
7
8
9
10
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
begin of php config definition

define php::config ( 
                $path = "both",
                $max_execution_time = "30",
                $max_input_time = "60",
                $memory_limit = "40M",
                $display_errors = "Off",
                $post_max_size = "8M",
                $upload_max_filesize = "4M",
                $basedir = "/sites"
                ) {

        include php

        case $path {
                "both": {
                        $configpath = ["/etc/php5/apache2/php.ini", "/etc/php5/cli/php.ini"]
                }
                "apache","apache2","mod": {
                        $configpath = "/etc/php5/apache2/php.ini"
                }
                "cli": {
                        $configpath = "/etc/php5/cli/php.ini"
                }
                default: {
                        $configpath = $path
                }
        }
        file { $configpath:
                ensure  => "present",
                content => template("php/php.ini.erb"),
                require => Class["php"],
                # restart apache, also on cli changes, sorry for that.
                notify  => Exec["apache-force-reload"],
        }
}