Hi Daniel,
On 19.04.2013 14:53, Daniel Gruno wrote:
Yeah, that should be r.exists_config_define.
ok, new test:

function call_exists_config_define(r, text)
  if r.exists_config_define(text) then
r:puts("httpd was probably run with -D" .. text .. ", or it was defined in the configuration.\n")
  end
end

function handle(r)
  r.content_type = "text/plain"

  local text1 = "Everything"
  local text2 = "seems"
  local text3 = "here"
  local text4 = "defined!"

  call_exists_config_define(r, text1)
  call_exists_config_define(r, text2)
  call_exists_config_define(r, text3)
  call_exists_config_define(r, text4)

  r:puts( ("\nPowered by %s on %s\n"):format(_VERSION, r.banner) )
end

result:
httpd was probably run with -DEverything, or it was defined in the configuration.
httpd was probably run with -Dseems, or it was defined in the configuration.
httpd was probably run with -Dhere, or it was defined in the configuration.
httpd was probably run with -Ddefined!, or it was defined in the configuration.

Do you want me to just fix the docs, or should we turn it into
r:exists_config_define for the sake of consistency?
hmm, not sure; what did we do with the other one recently?

Gün.



Reply via email to