Changeset 5822


Ignore:
Timestamp:
12/18/09 11:22:13 (2 years ago)
Author:
CrawfordCurrie
Message:

Item2511: 'use' would compile the core unconditionally. Wrapping it in an eval delays evaluation until the code is actually run (lazy loading) for a significantly reduced load time for the plugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/TablePlugin/lib/Foswiki/Plugins/TablePlugin.pm

    r5756 r5822  
    2323# headings and data cells. See %SYSTEMWEB%.TablePlugin for details of use 
    2424 
     25package Foswiki::Plugins::TablePlugin; 
     26 
    2527use strict; 
    26  
    27 package Foswiki::Plugins::TablePlugin; 
    28  
    29 use Foswiki::Func    ();    # The plugins API 
    30 use Foswiki::Plugins ();    # For the API version 
    3128 
    3229our $VERSION = '$Rev$'; 
     
    7976 
    8077    # on-demand inclusion 
    81     use Foswiki::Plugins::TablePlugin::Core; 
     78    eval "use Foswiki::Plugins::TablePlugin::Core ()"; 
     79    die $@ if $@; 
    8280    Foswiki::Plugins::TablePlugin::Core::handler(@_); 
    8381} 
Note: See TracChangeset for help on using the changeset viewer.