CGI::Wiki::Simple - A simple wiki application using CGI::Application.
This is an instant wiki.
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;
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;
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.
new
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.
setup
This is the accessor method to the contained CGI::Wiki class.
Renders either the display page or a page indicating that there was a version conflict.
Loads some values for the subsequent rendering.
Many thanks must go to Kate Plugh, for writing CGI::Wiki and for testing and proofreading this module.
Max Maischein (corion@cpan.org)
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.
CGI::Wiki,CGI::Application
To install CGI::Wiki::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CGI::Wiki::Simple
CPAN shell
perl -MCPAN -e shell install CGI::Wiki::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.