Changeset 13836
- Timestamp:
- 01/27/12 05:14:49 (4 weeks ago)
- Location:
- branches/Release01x01/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
-
branches/Release01x01/core/lib/Foswiki.pm
r13483 r13836 80 80 our $OC = "<!--\0"; 81 81 our $CC = "\0-->"; 82 83 # This variable is set if Foswiki is running in unit test mode. 84 # It is provided so that modules can detect unit test mode to avoid 85 # corrupting data spaces. 86 our $inUnitTestMode = 0; 87 88 sub SINGLE_SINGLETONS { 0 } 89 sub SINGLE_SINGLETONS_TRACE { 0 } 82 90 83 91 # Returns the full path of the directory containing Foswiki.pm … … 1673 1681 CGI::charset( $Foswiki::cfg{Site}{CharSet} ); 1674 1682 } 1683 if (SINGLE_SINGLETONS_TRACE) { 1684 require Data::Dumper; 1685 print STDERR "new $this: " 1686 . Data::Dumper->Dump( [ [caller], [ caller(1) ] ] ); 1687 } 1675 1688 1676 1689 $this->{request} = $query; … … 1681 1694 # This is required in case we get an exception during 1682 1695 # initialisation, so that we have a session to handle it with. 1696 ASSERT( !$Foswiki::Plugins::SESSION ) if SINGLE_SINGLETONS; 1683 1697 $Foswiki::Plugins::SESSION = $this; 1698 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 1684 1699 1685 1700 # Tell Foswiki::Response which charset we are using if not default … … 2131 2146 2132 2147 undef $this->{DebugVerificationCode}; # from Foswiki::UI::Register 2148 if (SINGLE_SINGLETONS_TRACE) { 2149 require Data::Dumper; 2150 print STDERR "finish $this: " 2151 . Data::Dumper->Dump( [ [caller], [ caller(1) ] ] ); 2152 } 2153 if (SINGLE_SINGLETONS) { 2154 ASSERT( defined $Foswiki::Plugins::SESSION ); 2155 ASSERT( $Foswiki::Plugins::SESSION == $this ); 2156 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ); 2157 } 2158 undef $Foswiki::Plugins::SESSION; 2133 2159 2134 2160 if (DEBUG) { … … 2396 2422 2397 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 } 2398 2428 local $Foswiki::Plugins::SESSION = $this; 2429 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 2399 2430 2400 2431 my $text = $topicObject->text(); … … 2733 2764 2734 2765 # Make sure func works, for registered tag handlers 2735 $Foswiki::Plugins::SESSION = $this; 2766 if (SINGLE_SINGLETONS) { 2767 ASSERT( defined $Foswiki::Plugins::SESSION ); 2768 ASSERT( $Foswiki::Plugins::SESSION == $this ); 2769 } 2770 local $Foswiki::Plugins::SESSION = $this; 2771 ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; 2736 2772 2737 2773 # NOTE TO DEBUGGERS -
branches/Release01x01/core/lib/Foswiki/Func.pm
r13638 r13836 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; -
branches/Release01x01/core/lib/Foswiki/Plugin.pm
r11862 r13836 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"; -
branches/Release01x01/core/lib/Foswiki/Plugins.pm
r12169 r13836 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.
