Ignore:
Timestamp:
May 14, 2006, 4:54:22 PM (15 years ago)
Author:
Dominic Hargreaves
Message:

Use Wiki::Toolkit. Note that CGI::Wiki::Plugin::Diff hasn't been converted yet,
so tests will be broken for now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides/Utils.pm

    r730 r785  
    66
    77use Carp qw( croak );
    8 use CGI::Wiki;
    9 use CGI::Wiki::Formatter::UseMod;
    10 use CGI::Wiki::Plugin::RSS::Reader;
     8use Wiki::Toolkit;
     9use Wiki::Toolkit::Formatter::UseMod;
     10use Wiki::Toolkit::Plugin::RSS::Reader;
    1111use URI::Escape;
    1212
     
    4040
    4141Croaks unless an C<OpenGuides::Config> object is supplied.  Returns a
    42 C<CGI::Wiki> object made from the given config file on success,
     42C<Wiki::Toolkit> object made from the given config file on success,
    4343croaks if any other error occurs.
    4444
     
    7878                        );
    7979
    80     my $cgi_wiki_module = "CGI::Wiki::Store::" . $cgi_wiki_exts{$dbtype};
     80    my $cgi_wiki_module = "Wiki::Toolkit::Store::" . $cgi_wiki_exts{$dbtype};
    8181    eval "require $cgi_wiki_module";
    8282    croak "Can't 'require' $cgi_wiki_module.\n" if $@;
     
    9696              || $config->use_plucene == 1 )
    9797       ) {
    98         require CGI::Wiki::Search::Plucene;
    99         $search = CGI::Wiki::Search::Plucene->new(
     98        require Wiki::Toolkit::Search::Plucene;
     99        $search = Wiki::Toolkit::Search::Plucene->new(
    100100                                       path => $config->indexing_directory,
    101101                                                 );
    102102    } else {
    103         require CGI::Wiki::Search::SII;
     103        require Wiki::Toolkit::Search::SII;
    104104        require Search::InvertedIndex::DB::DB_File_SplitHash;
    105105        my $indexdb = Search::InvertedIndex::DB::DB_File_SplitHash->new(
     
    107107            -lock_mode => "EX"
    108108        );
    109         $search = CGI::Wiki::Search::SII->new( indexdb => $indexdb );
     109        $search = Wiki::Toolkit::Search::SII->new( indexdb => $indexdb );
    110110    }
    111111
     
    119119        qr/\@INDEX_LINK\s+\[\[(Category|Locale)\s+([^\]|]+)\|?([^\]]+)?\]\]/ =>
    120120            sub {
    121                   # We may be being called by CGI::Wiki::Plugin::Diff,
     121                  # We may be being called by Wiki::Toolkit::Plugin::Diff,
    122122                  # which doesn't know it has to pass us $wiki - and
    123123                  # we don't use it anyway.
    124                   if ( UNIVERSAL::isa( $_[0], "CGI::Wiki" ) ) {
     124                  if ( UNIVERSAL::isa( $_[0], "Wiki::Toolkit" ) ) {
    125125                      shift; # just throw it away
    126126                  }
     
    132132                   my ($wiki, $type, $value) = @_;
    133133
    134                    # We may be being called by CGI::Wiki::Plugin::Diff,
     134                   # We may be being called by Wiki::Toolkit::Plugin::Diff,
    135135                   # which doesn't know it has to pass us $wiki
    136                    unless ( UNIVERSAL::isa( $wiki, "CGI::Wiki" ) ) {
     136                   unless ( UNIVERSAL::isa( $wiki, "Wiki::Toolkit" ) ) {
    137137                       return "(unprocessed INDEX_LIST macro)";
    138138                   }
     
    159159                 },
    160160        qr/\@RSS\s+(.+)/ => sub {
    161                     # We may be being called by CGI::Wiki::Plugin::Diff,
     161                    # We may be being called by Wiki::Toolkit::Plugin::Diff,
    162162                    # which doesn't know it has to pass us $wiki - and
    163163                    # we don't use it anyway.
    164                     if ( UNIVERSAL::isa( $_[0], "CGI::Wiki" ) ) {
     164                    if ( UNIVERSAL::isa( $_[0], "Wiki::Toolkit" ) ) {
    165165                        shift; # just throw it away
    166166                    }
     
    174174                    }
    175175
    176                     my $rss = CGI::Wiki::Plugin::RSS::Reader->new(url => $url);
     176                    my $rss = Wiki::Toolkit::Plugin::RSS::Reader->new(url => $url);
    177177                    my @items = $rss->retrieve;
    178178
     
    196196    );
    197197
    198     my $formatter = CGI::Wiki::Formatter::UseMod->new(
     198    my $formatter = Wiki::Toolkit::Formatter::UseMod->new(
    199199        extended_links      => 1,
    200200        implicit_links      => 0,
     
    213213                 formatter => $formatter );
    214214
    215     my $wiki = CGI::Wiki->new( %conf );
     215    my $wiki = Wiki::Toolkit->new( %conf );
    216216    return $wiki;
    217217}
Note: See TracChangeset for help on using the changeset viewer.