Ignore:
Timestamp:
2005-08-29T10:38:07+12:00 (19 years ago)
Author:
kjdon
Message:

copied classify.pm and BasClas.pm, added -gsdlinfo flag - if this is present (it gets set by pluginfo.pl) then don't bother parsing the args - just set up the arg data structures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugin.pm

    r10482 r10579  
    2828use strict; # to pick up typos and undeclared variables...
    2929no strict 'refs'; # ...but allow filehandles to be variables and vice versa
     30no strict 'subs';
    3031
    3132require util;
     
    4243#globaloptions contains any options that should be passed to all plugins
    4344my ($verbosity, $outhandle, $failhandle, $globaloptions);
     45
     46sub load_plugin_for_info {
     47    my ($pluginname) = shift @_;
     48
     49    # find the plugin
     50    my $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"perllib/plugins",
     51                      "${pluginname}.pm");
     52    my $mainplugname = &util::filename_cat($ENV{'GSDLHOME'},"perllib/plugins",
     53                       "${pluginname}.pm");
     54    if (-e $colplugname) { require $colplugname; }
     55    elsif (-e $mainplugname) { require $mainplugname; }
     56    else {
     57    &gsprintf(STDERR, "{plugin.could_not_find_plugin}\n",
     58         $pluginname);
     59    die "\n";
     60    }
     61
     62    # create a plugin object
     63    my ($plugobj);
     64    my $options = "-gsdlinfo";
     65   
     66    eval ("\$plugobj = new \$pluginname([],[$options])");
     67    die "$@" if $@;
     68
     69    return $plugobj;
     70}
    4471
    4572sub load_plugins {
Note: See TracChangeset for help on using the changeset viewer.