First integration of the new GW_ design more centralized on connector, and does not require specific feature on GW_APPLICATION depending on the connector.

So this is really more flexible this way, and much easier to write application supporting CGI, FCGI, Nino and so on .. as demonstrated in hello_world

This is a first version, more will come later, mainly migrating from Eiffel Web Reloaded to this Eiffel Web Framework project.
This commit is contained in:
Jocelyn Fiat
2011-07-12 11:53:00 +02:00
parent 4fb42df5fb
commit f74ac66569
101 changed files with 7651 additions and 107 deletions

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="connector_libfcgi" uuid="59C57E56-3EE6-4EF7-873F-7ED084B0EB22" library_target="connector_libfcgi">
<target name="connector_libfcgi">
<root all_classes="true"/>
<file_rule>
<exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude>
<exclude>/\.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
<library name="libfcgi" location="..\..\..\libfcgi\libfcgi-safe.ecf" />
<cluster name="src" location=".\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="connector_libfcgi" uuid="59C57E56-3EE6-4EF7-873F-7ED084B0EB22" library_target="connector_libfcgi">
<target name="connector_libfcgi">
<root all_classes="true"/>
<file_rule>
<exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude>
<exclude>/\.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="ewsgi" location="..\..\ewsgi.ecf" readonly="false"/>
<library name="libfcgi" location="..\..\libfcgi\libfcgi.ecf" />
<cluster name="src" location=".\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1 @@
reference:forum2

View File

@@ -0,0 +1,81 @@
note
description: "Summary description for {GW_LIBFCGI_CONNECTOR}."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class
GW_LIBFCGI_CONNECTOR
inherit
GW_CONNECTOR
redefine
initialize
end
create
make
feature {NONE} -- Initialization
initialize
do
create fcgi.make
create {GW_LIBFCGI_INPUT_STREAM} input.make (fcgi)
create {GW_LIBFCGI_OUTPUT_STREAM} output.make (fcgi)
end
feature -- Server
launch
local
res: INTEGER
do
from
res := fcgi.fcgi_listen
until
res < 0
loop
process_fcgi_request (fcgi.updated_environ_variables, input, output)
res := fcgi.fcgi_listen
end
end
feature -- Execution
process_fcgi_request (vars: HASH_TABLE [STRING, STRING]; a_input: like input; a_output: like output)
local
gw_env: GW_ENVIRONMENT_VARIABLES
do
create gw_env.make_with_variables (vars)
application.process (gw_env, a_input, a_output)
end
feature -- Input/Output
input: GW_INPUT_STREAM
-- Input from client (from httpd server via FCGI)
output: GW_OUTPUT_STREAM
-- Output to client (via httpd server/fcgi)
feature {NONE} -- Implementation
fcgi: FCGI
invariant
fcgi_attached: fcgi /= Void
note
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end

View File

@@ -0,0 +1,66 @@
note
description: "Summary description for GW_LIBFCGI_INPUT_STREAM."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class
GW_LIBFCGI_INPUT_STREAM
inherit
GW_INPUT_STREAM
STRING_HANDLER
create
make
feature {NONE} -- Initialization
make (a_fcgi: like fcgi)
require
valid_fcgi: a_fcgi /= Void
do
fcgi := a_fcgi
initialize
end
initialize
-- Initialize Current
do
create last_string.make_empty
end
feature -- Basic operation
read_stream (nb_char: INTEGER)
-- Read a string of at most `nb_char' bound characters
-- or until end of file.
-- Make result available in `last_string'.
do
fcgi.fill_string_from_stdin (last_string, nb_char)
end
feature -- Access
last_string: STRING
-- Last string read
feature {NONE} -- Implementation
fcgi: FCGI;
-- Bridge to FCGI world
note
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end

View File

@@ -0,0 +1,57 @@
note
description: "Summary description for {GW_LIBFCGI_OUTPUT_STREAM}."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class
GW_LIBFCGI_OUTPUT_STREAM
inherit
GW_OUTPUT_STREAM
create
make
feature {NONE} -- Initialization
make (a_fcgi: like fcgi)
require
valid_fcgi: a_fcgi /= Void
do
fcgi := a_fcgi
end
feature -- Basic operation
put_string (s: STRING)
-- Send `s' to http client
do
fcgi.put_string (s)
end
flush
do
end
feature {NONE} -- Implementation
fcgi: FCGI
-- Bridge to FCGI world
invariant
fcgi_attached: fcgi /= Void
note
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end