Puppet Function: php_ini

Defined in:
puppet/modules/wmflib/lib/puppet/parser/functions/php_ini.rb
Function type:
Ruby 3.x API

Overview

php_ini()Any

Returns:

  • (Any)


24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'puppet/modules/wmflib/lib/puppet/parser/functions/php_ini.rb', line 24

newfunction(:php_ini, :type => :rvalue, :arity => -2) do |args|
  if args.map(&:class).uniq != [Hash]
    fail(ArgumentError, 'php_ini(): hash arguments required')
  end
  flat = args.map { |arg| ini_flatten(arg) }.inject(:merge)
  options = flat.map do |k, vs|
    case vs
    when Array then vs.map { |v| "#{k}[#{v}] = #{ini_cast(v)}" }
    else "#{k} = #{ini_cast(vs)}"
    end
  end
  options.flatten.sort.push('').join("\n")
end