The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CGI::Wiki::Simple - A simple wiki application using CGI::Application.

DESCRIPTION

This is an instant wiki.

SYNOPSIS

  use strict;
  use CGI::Wiki::Simple;
  use CGI::Wiki::Simple::Setup; # currently only for SQLite

  # Change this to match your setup
  use CGI::Wiki::Store::SQLite;
  CGI::Wiki::Simple::Setup::setup_if_needed( dbname => "mywiki.db",
                                             dbtype => 'sqlite' );
  my $store = CGI::Wiki::Store::SQLite->new( dbname => "mywiki.db" );

  my $search = undef;
  my $wiki = CGI::Wiki::Simple->new( TMPL_PATH => "templates",
                                     PARAMS => {
                                        store => $store,
                                     })->run;

EXAMPLE WITHOUT HTML::Template

It might be the case that you don't want to use HTML::Template, and in fact, no templates at all. Then you can simple use the following example as your wiki, which does not rely on HTML::Template to prepare the content :

  use strict;
  use CGI::Wiki::Simple::NoTemplates;
  use CGI::Wiki::Store::MySQL; # Change this to match your setup

  my $store = CGI::Wiki::Store::MySQL->new( dbname => "test",
                                            dbuser => "master",
                                            dbpass => "master" );


  my $search = undef;
  my $wiki = CGI::Wiki::Simple::NoTemplates
             ->new( PARAMS => {
                                store => $store,
                              })->run;

METHODS

new

new passes most of the parameters on to the constructor of CGI::Wiki. If HTML::Template is not available, you'll automagically get a non-templated wiki in the subclass CGI::Wiki::Simple::NoTemplates. Note that CGI::Application lists HTML::Template as one of its prerequisites but also works without it.

setup

The setup method is called by the CGI::Application framework when the application should initialize itself and load all necessary parameters. The wiki decides here what to do and loads all needed values from the configuration or database respectively.

wiki

This is the accessor method to the contained CGI::Wiki class.

render_commit

Renders either the display page or a page indicating that there was a version conflict.

cgiapp_prerun

Loads some values for the subsequent rendering.

ACKNOWLEDGEMENTS

Many thanks must go to Kate Plugh, for writing CGI::Wiki and for testing and proofreading this module.

AUTHOR

Max Maischein (corion@cpan.org)

COPYRIGHT

     Copyright (C) 2003 Max Maischein.  All Rights Reserved.

This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

CGI::Wiki,CGI::Application