More debugging shit:
[semece.git] / Semece.psgi.orig
bloba46de6dde1fd5b276bb339c1151f81a0661a4190
1 #!/usr/bin/env perl
3 # Copyright (c) 2010 Abel Abraham Camarillo Ojeda <acamari@verlet.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.
18 # PSGI entry point and configuration file.
19 # Please copy this file as 'Semece.psgi', and edit it!.
21 my $semece = undef;
22 my $conf = undef;
24 ######################
25 # USER CONFIGURATION #
26 ######################
27 sub setconf {{
28 srcd => "", # Absolute filesystem path to
29 # the current dir. (No default
30 # value)
31 postd => "", # Absolute filesystem path to
32 # the data dir. (No default
33 # value)
34 mkd_sufx => ".mkd", # Suffix for markdown files
35 # (default: ".mkd")
36 mkd_idx => "index.mkd", # Index file: file to parse when
37 # a user request the parent
38 # directory. (default:
39 # "index.mkd")
42 ##############
43 # DON'T EDIT #
44 ##############
45 # Adds $conf->{srcd} to the search path for libraries, this must be done at
46 # compiling time.
47 sub grow_inc {unshift(@INC, $conf->{srcd}. "/lib")}
48 BEGIN {$conf = setconf(); grow_inc();}
50 # PSGI entry point.
51 $semece = sub {
52 my $env = shift;
54 # XXX: The $conf set in the BEGIN is lost for unknown reasons...
55 $conf = setconf();
57 use Semece;
58 $env->{"semece.conf"} = $conf;
59 return &Semece::serv($env);