r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

Dockimbel
23-Apr-2007
[396x2]
You should be able to obtain an equivalent to REQUEST_URI by join 
several values from system/options/cgi.
join => joining
Chris
23-Apr-2007
[398x3]
Except without being able to rewrite, the request_uri will always 
be the same...
If I type http://localhost/pages/this-- I need to run /cgi/qm.r 
and have access to '/pages/this'
I haven't delved deep enough to understand if this'd be better written 
as a Cheyenne handler, though that would require forking the cgi 
script, which for the time being, also has to run under Apache.
Dockimbel
23-Apr-2007
[401x2]
I see the problem.
If I give you a customized Cheyenne handler for QM that can check 
URLs (with parse rules) and send them to /cgi/qm.r before checking 
the local filesystem, would it suit your needs ?
Graham
23-Apr-2007
[403x4]
Sounds good.
Isn't this how Zope works?
The whole Zope website is just a huge Python object, and when you 
access a path, the Zope webserver executes the object referred to 
...
But you can remap paths on the fly
Dockimbel
23-Apr-2007
[407]
Don't know how Zope handles rewriting, but the solution I've proposed 
to Chris is quite specific (even if it could be parameterized). The 
solution I had in mind for a Rewriting engine would be much more 
generic.
Graham
23-Apr-2007
[408]
A few of us are experiementing with Chris' project .. so something 
that just sends everything to qm.cgi or qm.r would be helpful.
Dockimbel
23-Apr-2007
[409]
The Mod-MapURL that I'll provide in the next release will act like 
that, mapping URLS to REBOL objects (with nesting supported).
Graham
23-Apr-2007
[410]
so, the application could just be a large object?  Or the objects 
are on disk?
Dockimbel
23-Apr-2007
[411]
in-memory objects
Graham
23-Apr-2007
[412x2]
Ok.
From memory Zope has a disk based object database ...
Dockimbel
23-Apr-2007
[414]
All the application in a large object, if you design it like that, 
sure.
Graham
23-Apr-2007
[415]
How's sessions going? :)
Dockimbel
23-Apr-2007
[416x3]
Yes, I know about ZODB, quite interesting OODB.
Very well, I'm currently testing the whole RSP framework by building 
a "test" application : a new web-based bugtracker ;-)
It helps me tweak the session system and add some small but useful 
features.
Graham
23-Apr-2007
[419x2]
bootstrapping ?
Anyway, sounds like progress is being made :)
Dockimbel
23-Apr-2007
[421x4]
Yes, I quite happy with the speed and stability of the new implementation, 
I have RSP pages with 3 SQL queries to a MySQL backend, input and 
output filters, session handling, tables constructed dynamically 
with data from DB, all this occuring in a few milliseconds...I still 
need to test how it scales.
I => I'm
RSP now supports a thin layer for easier DB access. No need to open/close 
connections, they are persistent and pooled.
As soon as the bugtracker is ready, I'll put it online and release 
a new beta of Cheyenne.
Graham
23-Apr-2007
[425]
I think I just opened a connection from start up and kept it open.
Dockimbel
23-Apr-2007
[426]
The "thin layer" I was talking about doesn't do much more than that, 
but it's done in a clean and handy way, and once for all.
Graham
23-Apr-2007
[427]
ok.
Dockimbel
23-Apr-2007
[428]
I'm finishing a mod-qm for Cheyenne. I'll need to test it and will 
drop here a download URL.
Graham
23-Apr-2007
[429]
Nice
Dockimbel
23-Apr-2007
[430]
hum, problem with [get-env "REQUEST_URI"], I can't set-env ! Is there 
a simple way to set an environment variable from REBOL ?
Graham
23-Apr-2007
[431x2]
no
I think you can set it for the session, but as soon as you reboot 
.. it's gone.
Dockimbel
23-Apr-2007
[433]
If not it can't run under Cheyenne without changing qm.r...but Chris 
said it has to work with Apache...:-(
Graham
23-Apr-2007
[434]
kernel32: make object! [ lib: load/library %kernel32.dll win32api-GetEnvironmentVariable: 
make routine! [ name [string!] buffer [string!] size [ struct! [ 
size [integer!] ] ] return: [integer!] ] lib "GetEnvironmentVariableA" 
get-env: func [name [string!] /local size][ buffer: copy "" repeat 
sp 255 [buffer: append buffer " "] size: make struct! [size [integer!]] 
reduce [length? buffer] win32api-GetEnvironmentVariable name buffer 
size trim buffer ] win32api-SetEnvironmentVariable: make routine! 
[ name [string!] value [string!] return: [integer!] ] lib "SetEnvironmentVariableA" 
set-env: func [name [string!] value [string!] ][ win32api-SetEnvironmentVariable 
name value ] ]
Dockimbel
23-Apr-2007
[435x2]
making a custom module if just not enough, I need a way to set  "REQUEST_URI" 
env variable.
thanks :-)
Graham
23-Apr-2007
[437]
except we are all testing under linux!
Dockimbel
23-Apr-2007
[438]
doh!
Graham
23-Apr-2007
[439x2]
here's another one ...

kernel32: make object! [
lib:  load/library %msvcrt.dll

get-env: make routine! [
	varname [string!]
	return: [string!]
] lib "getenv"

put-env: make routine! [
	env-string [string!]
	return:    [integer!]
] lib "_putenv"

remove-env-var: func [name [string!]] [put-env join name "="]

env-var-exists?: func [name [string!]] [
	either "^@" = get-env name [false][true]
]

tz-set: make routine! [
	return:    [integer!]
] lib "_tzset"

free_lib: does [ free lib ]

]
since they both work while the app is running, I guess that's okay 
for windows.
Dockimbel
23-Apr-2007
[441]
Thanks, but still for win32, do you have one for linux ?
Graham
23-Apr-2007
[442]
aren't linux env variables just disk files ?
Dockimbel
23-Apr-2007
[443]
don't know, possibly, but I'm on Windows, I can't test that for now...
Graham
23-Apr-2007
[444x2]
http://www.linux.com/howtos/Secure-Programs-HOWTO/environment-variables.shtml
maybe that will help