Changeset 871


Ignore:
Timestamp:
11/23/08 09:40:00 (4 years ago)
Author:
CrawfordCurrie
Message:

Item175: restore the module parameter to the plugin constructor; required by unit tests

Location:
trunk/core/lib/Foswiki
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/lib/Foswiki/Engine.pm

    r830 r871  
    405405=cut 
    406406 
    407 sub write { } 
     407sub write { 
     408    ASSERT('Pure virtual method - should never be called'); 
     409} 
    408410 
    4094111; 
  • trunk/core/lib/Foswiki/Plugin.pm

    r830 r871  
    7979=pod 
    8080 
    81 ---++ ClassMethod new( $session, $name ) 
     81---++ ClassMethod new( $session, $name, [, $module] ) 
    8282 
    8383   * =$session= - Foswiki object 
    8484   * =$name= - name of the plugin e.g. MyPlugin 
    85  
     85   * =$module= - name of implementing package; optional, used for tests. 
     86     Normally =load= is used to discover the module from the config. 
    8687=cut 
    8788 
    8889sub new { 
    89     my ( $class, $session, $name ) = @_; 
     90    my ( $class, $session, $name, $module ) = @_; 
    9091    my $this = bless( { session => $session }, $class ); 
    9192 
     
    9394    $name = Foswiki::Sandbox::untaintUnchecked($name); 
    9495    $this->{name}   = $name   || ''; 
     96    if ( defined($module) ) { 
     97        $this->{module} = $module; # otherwise use discovery 
     98    } 
    9599 
    96100    return $this; 
Note: See TracChangeset for help on using the changeset viewer.