Stas Bekman
Mon, 16 Jun 2003 17:09:57 -0700
sub handler {
my $r = shift; my $uri = $r->uri; ... detecting dynamic handlers ... while( my($url, $dirs) = each %STATIC_FILES ) { if( $uri =~ m{$url/(.*)$} ) { foreach my $d (@$dirs) { my $file = "$d/$1"; if( -f $file ) { $r->filename($file); return OK; } } } } }
ah, a real-world example. Just what we need. Care to write a short pod section using this example, explaining the problem and the solution? plain text or pod will do. we will add it to the coding chapter.
Hmm, let's use my english-like language...
The problem: - the application static files are installed in /myapp/img, /myapp/css, ... - local site customization can be made by installing customized files in /custom/img, /custom/css... - in both cases they are accessed via /img/..., /css/... urls
The solution - we use custom transhandler to check whether the customized version exists and use it if so.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com