Changeset 13826
- Timestamp:
- 01/26/12 02:45:28 (4 weeks ago)
- Location:
- trunk/core/lib
- Files:
-
- 4 edited
-
Foswiki.pm (modified) (6 diffs)
-
Foswiki/Func.pm (modified) (4 diffs)
-
Foswiki/Plugin.pm (modified) (1 diff)
-
Foswiki/Plugins.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/lib/Foswiki.pm
r13394 r13826 85 85 # corrupting data spaces. 86 86 our $inUnitTestMode = 0; 87 88 sub SINGLE_SINGLETONS { 0 } 89 sub SINGLE_SINGLETONS_TRACE { 0 } 87 90 88 91 # Returns the full path of the directory containing Foswiki.pm … … 1665 1668 my $this = bless( { sandbox => 'Foswiki::Sandbox' }, $class ); 1666 1669 1670 if (SINGLE_SINGLETONS_TRACE) { 1671 require Data::Dumper; 1672 print STDERR "new $this: " 1673 . Data::Dumper->Dump( [ [caller], [ caller(1) ] ] ); 1674 } 1675 1667 1676 # Tell Foswiki::Response which charset we are using if not default 1668 1677 $Foswiki::cfg{Site}{CharSet} ||= 'iso-8859-1'; … … 1675 1684 # This is required in case we get an exception during 1676 1685 # initialisation, so that we have a session to handle it with. 1686 ASSERT( !$Foswiki::Plugins::SESSION ) if SINGLE_SINGLETONS; 1677 1687 $Foswiki::Plugins::SESSION = $this; 1688 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 1678 1689 1679 1690 # hash of zone records … … 2132 2143 2133 2144 undef $this->{DebugVerificationCode}; # from Foswiki::UI::Register 2145 if (SINGLE_SINGLETONS_TRACE) { 2146 require Data::Dumper; 2147 print STDERR "finish $this: " 2148 . Data::Dumper->Dump( [ [caller], [ caller(1) ] ] ); 2149 } 2150 if (SINGLE_SINGLETONS) { 2151 ASSERT( defined $Foswiki::Plugins::SESSION ); 2152 ASSERT( $Foswiki::Plugins::SESSION == $this ); 2153 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ); 2154 } 2155 undef $Foswiki::Plugins::SESSION; 2134 2156 2135 2157 if (DEBUG) { … … 2400 2422 2401 2423 # Make sure func works, for registered tag handlers 2424 if (SINGLE_SINGLETONS) { 2425 ASSERT( defined $Foswiki::Plugins::SESSION ); 2426 ASSERT( $Foswiki::Plugins::SESSION == $this ); 2427 } 2402 2428 local $Foswiki::Plugins::SESSION = $this; 2429 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 2403 2430 2404 2431 my $text = $topicObject->text(); … … 2729 2756 2730 2757 # Make sure func works, for registered tag handlers 2731 $Foswiki::Plugins::SESSION = $this; 2758 if (SINGLE_SINGLETONS) { 2759 ASSERT( defined $Foswiki::Plugins::SESSION ); 2760 ASSERT( $Foswiki::Plugins::SESSION == $this ); 2761 } 2762 local $Foswiki::Plugins::SESSION = $this; 2763 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 2732 2764 2733 2765 # NOTE TO DEBUGGERS -
trunk/core/lib/Foswiki/Func.pm
r13447 r13826 576 576 my ( $tag, $function, $syntax ) = @_; 577 577 ASSERT($Foswiki::Plugins::SESSION) if DEBUG; 578 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 578 579 579 580 # $pluginContext is undefined if a contrib registers a tag handler. … … 589 590 sub { 590 591 my ( $session, $params, $topicObject ) = @_; 591 my $record = $Foswiki::Plugins::SESSION; 592 $Foswiki::Plugins::SESSION = $_[0]; 592 local $Foswiki::Plugins::SESSION = $session; 593 593 594 594 # $pluginContext is defined for all plugins … … 607 607 608 608 # Compatibility; expand $topicObject to the topic and web 609 my $result = 610 &$function( $session, $params, $topicObject->topic, 609 return &$function( $session, $params, $topicObject->topic, 611 610 $topicObject->web, $topicObject ); 612 $Foswiki::Plugins::SESSION = $record;613 return $result;614 611 }, 615 612 $syntax … … 704 701 my $record = $Foswiki::Plugins::SESSION; 705 702 $Foswiki::Plugins::SESSION = $_[0]; 703 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 706 704 my $result = &$function(@_); 707 705 $Foswiki::Plugins::SESSION = $record; -
trunk/core/lib/Foswiki/Plugin.pm
r11849 r13826 164 164 # Set the session for this call stack 165 165 local $Foswiki::Plugins::SESSION = $this->{session}; 166 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 166 167 167 168 my $sub = $p . "::initPlugin"; -
trunk/core/lib/Foswiki/Plugins.pm
r12168 r13826 225 225 # Set the session for this call stack 226 226 local $Foswiki::Plugins::SESSION = $this->{session}; 227 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 227 228 228 229 foreach my $plugin ( @{ $this->{plugins} } ) { … … 247 248 # Set the session for this call stack 248 249 local $Foswiki::Plugins::SESSION = $this->{session}; 250 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 249 251 250 252 foreach my $plugin ( @{ $this->{plugins} } ) { … … 326 328 # Set the value of $SESSION for this call stack 327 329 local $SESSION = $this->{session}; 330 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 328 331 329 332 # apply handler on the remaining list of args
Note: See TracChangeset
for help on using the changeset viewer.
