r92 - 05 Feb 2006 - 08:21:18 - PeterThoenyYou are here: TWiki >  Main Web > ThomasWeigert > ThomasWeigertDocumentationPointers
Tags:
, create new tag

  • 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

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r92 < r91 < r90 < r89 < r88 | More topic actions
Main.ThomasWeigertDocumentationPointers moved from Main.DocumentationPointers on 08 Jun 2002 - 05:25 by PeterThoeny - put it back
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo