3 # Copyright (c) 2010 Abel Abraham Camarillo Ojeda <acamari@the00z.org>
5 # Permission to use, copy, modify, and distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 # Stores common functions
21 # get $q->uri minus $q->location
27 my $uri = undef; # stores short uri
29 $uri = substr $q->uri, (length &g_location
($q));
30 $uri =~ s!/+!/!g; # normalization
32 print STDERR
"g_suri: da suri (", $uri, ")\n";
37 # returns the postd (fs directory where the posts are)
43 # reads SemecePostd from apache configuration
44 if (my $tmp = $q->dir_config('SemecePostd')) {
45 # sends directory names without final slash
49 print STDERR
"keys:", (join(',', keys %ENV)), "\n";
50 croak
"I cannot get SemecePostd, stopped";
51 return undef; # NOTREACHED
57 # returns the <Location > from the apache conf
64 # reads Current Working Dir from apache configuration
65 if (my $tmp = $q->location) {
66 print STDERR
"g_location: location ($tmp)\n";
67 # sends directory names without final slash
71 croak
"I cannot get Location, stopped";