Tags:
create new tag
, view all tags

  • Performance measurements
    • echo|time ./view > /dev/null
    • skin=normal|time ./view

-- ThomasWeigert - 18 May 2002

Thomas, I have not looked at the code, but where possible use only the official TWiki::Func interface to avoid "gotchas". Do not assume that undocumented functions will not change, in fact we have the largest code refactor ever in the current DEVELOP branch.

Although not pretty, but if you must use undocumented functions or variables you still can make the Plugin work for several TWiki versions. Do that with conditional code. Here is an example of the InterwikiPlugin:

if( $TWiki::Plugins::VERSION >= 1.020 ) {
    $upperAlpha    = TWiki::Func::getRegularExpression("upperAlpha");
    $mixedAlphaNum = TWiki::Func::getRegularExpression("mixedAlphaNum");
} else {
    $upperAlpha    = $TWiki::upperAlpha;
    $mixedAlphaNum = $TWiki::mixedAlphaNum;
}

Here is an untested code snippet for your encode challenge:

# =========================
sub _encodeSpecialChars
{
    if( $TWiki::Plugins::VERSION >= 1.020 ) { # Not sure about the version number, please check!!
        TWiki::Render::encodeSpecialChars( @_ );
    } else {
        TWiki::encodeSpecialChars( @_ );
    }
}

But, mind you, the current DevelopBranch does not have a TWiki::Render::encodeSpecialChars anymore. So you would have to chace that one again...

-- PeterThoeny - 23 Mar 2005

Topic revision: r92 - 2006-02-05 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.