Puppet Function: php_ini

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

Overview

php_ini()Any

Returns:

  • (Any)


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

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