note
description : "Objects that ..."
author : "$Author$"
date : "$Date$"
revision : "$Revision$"
class
APPLICATION_ROOT
create
make
feature {NONE} -- Initialization
make
-- Initialize `Current'.
local
res: INTEGER
nb: INTEGER
do
initialize
from
res := fcgi.fcgi_listen
until
res < 0
loop
nb := nb + 1
fcgi.put_string (header ("FCGI Eiffel Application"))
fcgi.put_string ("
Hello FCGI Eiffel Application
%N")
fcgi.put_string ("Request number " + nb.out + "
%N")
fcgi.put_string ("Environment variables%N")
print_environment_variables (fcgi.updated_environ_variables)
fcgi.put_string ("
")
fcgi.put_string (footer)
res := fcgi.fcgi_listen
end
end
feature -- Access
header (a_title: STRING): STRING
do
Result := "Content-type: text/html%R%N"
Result.append ("%R%N")
Result.append ("%N")
Result.append ("" + a_title + "")
Result.append ("%N")
end
footer: STRING
do
Result := "%N%N"
end
print_environment_variables (vars: TABLE_ITERABLE [READABLE_STRING_8, READABLE_STRING_GENERAL])
local
utf: UTF_CONVERTER
do
across
vars as ic
loop
fcgi.put_string ("" + utf.utf_32_string_to_utf_8_string_8 (ic.key.as_string_8) + " = " + ic.item + "%N")
end
end
feature {NONE} -- Implementation
initialize
do
create fcgi.make
end
fcgi: FCGI
end