#!/usr/bin/pugs =head1 TITLE test.p6 - WWW::Kontent CGI driver =head1 SYNOPSIS # in httpd.conf Alias /kontent /path/to/test.p6 =head1 DESCRIPTION test.p6 (the name is for historical reasons) is the CGI driver for Kontent. Edit the C line to reflect your store's information, and the various C lines to include your page classes, renderers, and stores, and save your changes. Then add the line in L to Apache's httpd.conf and restart Apache, or perform an equivalent bit of configuration on whatever software you use. Finally, run F to create a base hierarchy in the store. You should now be able to access F. =head1 SEE ALSO L =cut use WWW::Kontent; my $root = WWW::Kontent::get_root(); # Perl 6's CGI.pm doesn't have cookies yet use perl5:CGI; my $q=CGI.new(); my %params; for $q.param() -> $p { %params{lc $p}=~$q.param($p); } my $request=WWW::Kontent::Request.new( :path(~( $q.path_info() || %params) or '/' ), :sid(~($q.cookie('sid') || %params ) or undef), :root($root), :parameters(%params) ); my $sess=$request.session; my $cookie=$q.cookie('-name', 'sid', '-value', $sess.sid); my $output=$request.go(); WWW::Kontent::Supervisor::emit_header(); print $output; sub WWW::Kontent::Supervisor::emit_header() { state $run_before = 0; return if $run_before; print $q.header( '-status', $request.status, '-content_type', $request.type, '-cookie', $cookie ); $run_before = 1; }