Skip to content

Commit

Permalink
duplicate php_admin_{value,flag} for php_{value,flag}
Browse files Browse the repository at this point in the history
  • Loading branch information
jweisner committed Oct 22, 2014
1 parent 0e93f27 commit 3e50bae
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
$suphp_addhandler = $::apache::params::suphp_addhandler,
$suphp_engine = $::apache::params::suphp_engine,
$suphp_configpath = $::apache::params::suphp_configpath,
$php_flags = {},
$php_values = {},
$php_admin_flags = {},
$php_admin_values = {},
$no_proxy_uris = [],
Expand Down Expand Up @@ -708,6 +710,17 @@
}
}

# Template uses:
# - $php_values
# - $php_flags
if ($php_values and ! empty($php_values)) or ($php_flags and ! empty($php_flags)) {
concat::fragment { "${name}-php":
target => "${priority_real}-${filename}.conf",
order => 220,
content => template('apache/vhost/_php.erb'),
}
}

# Template uses:
# - $php_admin_values
# - $php_admin_flags
Expand Down
11 changes: 11 additions & 0 deletions templates/vhost/_directories.erb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@
<%- if directory['passenger_enabled'] and directory['passenger_enabled'] != '' -%>
PassengerEnabled <%= directory['passenger_enabled'] %>
<%- end -%>
<%- if directory['php_flags'] and ! directory['php_flags'].empty? -%>
<%- directory['php_flags'].each do |flag,value| -%>
<%- value = if value =~ /true|yes|on|1/i then 'on' else 'off' end -%>
php_flag <%= "#{flag} #{value}" %>
<%- end -%>
<%- end -%>
<%- if directory['php_values'] and ! directory['php_values'].empty? -%>
<%- directory['php_values'].each do |key,value| -%>
php_value <%= "#{key} #{value}" %>
<%- end -%>
<%- end -%>
<%- if directory['php_admin_flags'] and ! directory['php_admin_flags'].empty? -%>
<%- directory['php_admin_flags'].each do |flag,value| -%>
<%- value = if value =~ /true|yes|on|1/i then 'on' else 'off' end -%>
Expand Down
12 changes: 12 additions & 0 deletions templates/vhost/_php.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<% if @php_values and not @php_values.empty? -%>
<%- @php_values.sort.each do |key,value| -%>
php_value <%= key %> <%= value %>
<%- end -%>
<% end -%>
<% if @php_flags and not @php_flags.empty? -%>
<%- @php_flags.sort.each do |key,flag| -%>
<%-# normalize flag -%>
<%- if flag =~ /true|yes|on|1/i then flag = 'on' else flag = 'off' end -%>
php_flag <%= key %> <%= flag %>
<%- end -%>
<% end -%>

0 comments on commit 3e50bae

Please sign in to comment.