Hi all,
I have been talking with Rodrigo about the last two problems (RFE,
or bug, you name it) that have been sent to the list.
1.- http://0x50.org/archive/2005-October/001027.html
2.- http://0x50.org/archive/2005-October/001031.html
Both of them seem to have a common cause. They need a way to define
properties of independent web objects.
At this moment Cherokee supports two ways to define properties:
directories and extensions, and therefore most of the logic of a
configuration file is based on the "Directory" and "Extension"
clauses.
We have been discussing about add a new way to define properties on
specific resources. A new "Request" clause would fit well to solve
the task, at the same time it keeps the server scheme consistent.
The precedence between them should be:
1.- Requests
2.- Extensions
3.- Directories
Let me show an example of what we have been thinking of:
===
Directory / {
Handler file
}
# Example 1:
#
Request "/cgi-bin/trac.cgi/login" {
Auth Digest { .. }
}
# Example 2:
#
Request "/trackback/.+php" {
Handler redir {
Rewrite "/(.+)\.php$" "/index.php?tb=1&name=$1"
}
}
Directory /cgi-bin {
Handler cgi {
Env TRAC_ENV "/var/projects"
}
DocumentRoot /usr/share/trac/cgi-bin
}
Extension php {
Handler phpcgi
}
===
The inheritance method will remain being the same one. Each single
request will inherit as many properties as possible following the
previous priority definition: request, extension and directory.
Let see case by case how would it work:
1.- The problem John reported configuring trac:
Once the request "/cgi-bin/trac.cgi/login" is received by the
server (have in mind it is a CGI with pathinfo request), it will
match the first Request rule, so it will inherit the Auth entry,
then it will math the directory /cgi-bin inheriting all the rest
of the properties.
2.- About the redirection problem that Kurt reported:
On the request "/trackback/whatever.php" it will match the second
Request entry, so it is going to redirect the request to
/index.php.
In the next attempt to reply the request it will match the
extension php in first place (there weren't any valid Request
entries), so it will be processed as expected.
What do you guys think of this kind of configurations? Does it make
sense for you? Comments?
--
Greetings, alo.
_______________________________________________
Cherokee mailing list
[email protected]
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee