Ignore:
Timestamp:
11/19/08 16:05:12 (4 years ago)
Author:
CrawfordCurrie
Message:

Item175: corrected references to TWiki in comments and error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/lib/Foswiki.pm

    r811 r812  
    44=pod 
    55 
    6 ---+ package TWiki 
    7  
    8 TWiki operates by creating a singleton object (known as the Session 
     6---+ package Foswiki 
     7 
     8Foswiki operates by creating a singleton object (known as the Session 
    99object) that acts as a point of reference for all the different 
    1010modules in the system. This package is the class for this singleton, 
     
    3131                        not consistently used. Avoid. 
    3232   * =security=         Foswiki::Access singleton 
    33    * =SESSION_TAGS=     Hash of TWiki variables whose value is specific to 
     33   * =SESSION_TAGS=     Hash of preference settings whose value is specific to 
    3434                        the current request. 
    3535   * =store=            Foswiki::Store singleton 
     
    8888# Token character that must not occur in any normal text - converted 
    8989# to a flag character if it ever does occur (very unlikely) 
    90 # TWiki uses $TranslationToken to mark points in the text. This is 
     90# Foswiki uses $TranslationToken to mark points in the text. This is 
    9191# normally \0, which is not a useful character in any 8-bit character 
    9292# set we can find, nor in UTF-8. But if you *do* encounter problems 
     
    100100=pod 
    101101 
    102 ---++ StaticMethod getTWikiLibDir() -> $path 
     102---++ StaticMethod getLibDir() -> $path 
    103103 
    104104Returns the full path of the directory containing Foswiki.pm 
     
    106106=cut 
    107107 
    108 sub getTWikiLibDir { 
     108sub getLibDir { 
    109109    if ($twikiLibDir) { 
    110110        return $twikiLibDir; 
     
    124124    if ( $twikiLibDir =~ /^\./ ) { 
    125125        print STDERR 
    126 "WARNING: TWiki lib path $twikiLibDir is relative; you should make it absolute, otherwise some scripts may not run from the command line."; 
     126"WARNING: Foswiki lib path $twikiLibDir is relative; you should make it absolute, otherwise some scripts may not run from the command line."; 
    127127        my $bin; 
    128128 
     
    356356        import POSIX qw( locale_h LC_CTYPE LC_COLLATE ); 
    357357 
    358         # SMELL: mod_perl compatibility note: If TWiki is running under Apache, 
     358        # SMELL: mod_perl compatibility note: If Foswiki is running under Apache, 
    359359        # won't this play with the Apache process's locale settings too? 
    360360        # What effects would this have? 
     
    388388 
    389389        # No locales needed/working, or Perl 5.005, so just use 
    390         # any additional national characters defined in TWiki.cfg 
     390        # any additional national characters defined in LocalSite.cfg 
    391391        $regex{upperAlpha} = 'A-Z' . $Foswiki::cfg{UpperNational}; 
    392392        $regex{lowerAlpha} = 'a-z' . $Foswiki::cfg{LowerNational}; 
     
    423423    $regex{headerPatternNoTOC} = '(\!\!+|%NOTOC%)'; 
    424424 
    425     # TWiki concept regexes 
     425    # Foswiki concept regexes 
    426426    $regex{wikiWordRegex} = 
    427427qr/[$regex{upperAlpha}]+[$regex{lowerAlphaNum}]+[$regex{upperAlpha}]+[$regex{mixedAlphaNum}]*/o; 
     
    511511 
    512512    # initialize lib directory early because of later 'cd's 
    513     getTWikiLibDir(); 
     513    getLibDir(); 
    514514 
    515515    # initialize the runtime engine 
     
    567567        # We still don't have Codev.UnicodeSupport 
    568568        $this->writeWarning( 'UTF-8 not yet supported as site charset -' 
    569               . 'TWiki is likely to have problems' ); 
     569              . 'Foswiki is likely to have problems' ); 
    570570        return $text; 
    571571    } 
     
    11151115---++ ObjectMethod getScriptUrl( $absolute, $script, $web, $topic, ... ) -> $scriptURL 
    11161116 
    1117 Returns the URL to a TWiki script, providing the web and topic as 
     1117Returns the URL to a Foswiki script, providing the web and topic as 
    11181118"path info" parameters.  The result looks something like this: 
    11191119"http://host/twiki/bin/$script/$web/$topic". 
     
    11211121 
    11221122If $absolute is set, generates an absolute URL. $absolute is advisory only; 
    1123 TWiki can decide to generate absolute URLs (for example when run from the 
     1123Foswiki can decide to generate absolute URLs (for example when run from the 
    11241124command-line) even when relative URLs have been requested. 
    11251125 
     
    11671167 
    11681168        # See http://www.ietf.org/rfc/rfc2396.txt for the definition of 
    1169         # "absolute URI". TWiki bastardises this definition by assuming 
     1169        # "absolute URI". Foswiki bastardises this definition by assuming 
    11701170        # that all relative URLs lack the <authority> component as well. 
    11711171        $url = $this->{urlHost} . $url; 
     
    12101210Composes a pub url. If $absolute is set, returns an absolute URL. 
    12111211If $absolute is set, generates an absolute URL. $absolute is advisory only; 
    1212 TWiki can decide to generate absolute URLs (for example when run from the 
     1212Foswiki can decide to generate absolute URLs (for example when run from the 
    12131213command-line) even when relative URLs have been requested. 
    12141214 
     
    12311231 
    12321232        # See http://www.ietf.org/rfc/rfc2396.txt for the definition of 
    1233         # "absolute URI". TWiki bastardises this definition by assuming 
     1233        # "absolute URI". Foswiki bastardises this definition by assuming 
    12341234        # that all relative URLs lack the <authority> component as well. 
    12351235        $url = $this->{urlHost} . $url; 
     
    13211321Normalize a Web<nop>.<nop>TopicName 
    13221322 
    1323 See TWikiFuncDotPm for a full specification of the expansion (not duplicated 
     1323See =Foswiki::Func= for a full specification of the expansion (not duplicated 
    13241324here) 
    13251325 
     
    13551355---++ ClassMethod new( $loginName, $query, \%initialContext ) 
    13561356 
    1357 Constructs a new TWiki object. Parameters are taken from the query object. 
     1357Constructs a new Foswiki object. Parameters are taken from the query object. 
    13581358 
    13591359   * =$loginName= is the login username (*not* the wikiname) of the user you 
     
    14151415    # SMELL: can this be done in a BEGIN block? Or is the environment 
    14161416    # set per-query? 
    1417     # Item4382: Default $ENV{PATH} must be untainted because TWiki runs 
     1417    # TWikibug:Item4382: Default $ENV{PATH} must be untainted because Foswiki runs 
    14181418    # with use strict and calling external programs that writes on the disk 
    14191419    # will fail unless Perl seens it as set to safe value. 
     
    15401540    } 
    15411541 
    1542     # Item3270 - here's the appropriate place to enforce TWiki spec: 
     1542    # Item3270 - here's the appropriate place to enforce Foswiki spec: 
    15431543    # All topic name sources are evaluated, site charset applied 
    15441544    # SMELL: This untaint unchecked is duplicate of one just above 
     
    15991599    $Foswiki::Plugins::SESSION = $this; 
    16001600 
    1601     Monitor::MARK("TWiki session created"); 
     1601    Monitor::MARK("Foswiki session created"); 
    16021602 
    16031603    return $this; 
     
    21132113# Return value: $tableOfContents 
    21142114# Handles %<nop>TOC{...}% syntax.  Creates a table of contents 
    2115 # using TWiki bulleted 
     2115# using Foswiki bulleted 
    21162116# list markup, linked to the section headings of a topic. A section heading is 
    21172117# entered in one of the following forms: 
     
    23292329    else { 
    23302330        $text = 
    2331             CGI::h1('TWiki Installation Error') 
     2331            CGI::h1('Foswiki Installation Error') 
    23322332          . 'Template "' 
    23332333          . $template 
     
    25512551 
    25522552Escape special characters to HTML numeric entities. This is *not* a generic 
    2553 encoding, it is tuned specifically for use in TWiki. 
     2553encoding, it is tuned specifically for use in Foswiki. 
    25542554 
    25552555HTML4.0 spec: 
     
    25682568characters (except for \n and \r) using numeric entities. 
    25692569 
    2570 FURTHER this method also encodes characters that are special in TWiki 
     2570FURTHER this method also encodes characters that are special in Foswiki 
    25712571meta-language. 
    25722572 
     
    26282628In two cases, no URL encoding is needed:  For EBCDIC mainframes, we assume that  
    26292629site charset URLs will be translated (outbound and inbound) by the web server to/from an 
    2630 EBCDIC character set. For sites running in UTF-8, there's no need for TWiki to 
     2630EBCDIC character set. For sites running in UTF-8, there's no need for Foswiki to 
    26312631do anything since all URLs and attachment filenames are already in UTF-8. 
    26322632 
     
    28092809} 
    28102810 
    2811 # Process TWiki %TAGS{}% by parsing the input tokenised into 
     2811# Process Foswiki %TAGS{}% by parsing the input tokenised into 
    28122812# % separated sections. The parser is a simple stack-based parse, 
    28132813# sufficient to ensure nesting of tags is correct, but no more 
     
    30953095 
    30963096Adds a function to the dispatch table of the REST interface  
    3097 for a given subject. See TWikiScripts#rest for more info. 
     3097for a given subject. See System.CommandAndCGIScripts#rest for more info. 
    30983098 
    30993099   * =$subject= - The subject under which the function will be registered. 
     
    31063106</verbatim> 
    31073107where: 
    3108    * =\%session= - a reference to the TWiki session object (may be ignored) 
     3108   * =\%session= - a reference to the Foswiki session object (may be ignored) 
    31093109   * =$subject= - The invoked subject (may be ignored) 
    31103110   * =$verb= - The invoked verb (may be ignored) 
     
    31903190    $this->renderer->putBackBlocks( \$text, $verbatim, 'verbatim' ); 
    31913191 
    3192     # TWiki Plugin Hook (for cache Plugins only) 
     3192    # Foswiki Plugin Hook (for cache Plugins only) 
    31933193    $this->{plugins} 
    31943194      ->dispatch( 'afterCommonTagsHandler', $text, $theTopic, $theWeb, $meta ); 
     
    32033203Add =$html= to the HEAD tag of the page currently being generated. 
    32043204 
    3205 Note that TWiki variables may be used in the HEAD. They will be expanded 
     3205Note that macros may be used in the HEAD. They will be expanded 
    32063206according to normal variable expansion rules. 
    32073207 
     
    32103210   * =_DEFAULT= optional, id of the head block. Used to generate a comment in the output HTML. 
    32113211   * =text= optional, text to use for the head block. Mutually exclusive with =topic=. 
    3212    * =topic= optional, full TWiki path name of a topic that contains the full text to use for the head block. Mutually exclusive with =text=. Example: =topic="%WEB%.MyTopic"=. 
     3212   * =topic= optional, full Foswiki path name of a topic that contains the full text to use for the head block. Mutually exclusive with =text=. Example: =topic="%WEB%.MyTopic"=. 
    32133213   * =requires= optional, comma-separated list of id's of other head blocks this one depends on. 
    32143214=%<nop>ADDTOHEAD%= expands in-place to the empty string, unless there is an error in which case the variable expands to an error string. 
     
    32413241    my ( $this, $tag, $header, $requires ) = @_; 
    32423242 
    3243     # Expand TWiki variables in the header 
     3243    # Expand macros in the header 
    32443244    $header = 
    32453245      $this->handleCommonTags( $header, $this->{webName}, $this->{topicName} ); 
     
    33323332 
    33333333Static method to construct a new singleton session instance. 
    3334 It creates a new TWiki and sets the Plugins $SESSION variable to 
     3334It creates a new Foswiki and sets the Plugins $SESSION variable to 
    33353335point to it, so that Foswiki::Func methods will work. 
    33363336 
     
    33593359    if ( $theUrl && $theUrl ne $query->url() ) { 
    33603360        die 
    3361 'Sorry, this version of TWiki does not support the url parameter to Foswiki::initialize being different to the url in the query'; 
     3361'Sorry, this version of Foswiki does not support the url parameter to Foswiki::initialize being different to the url in the query'; 
    33623362    } 
    33633363    my $twiki = new Foswiki( $theRemoteUser, $query ); 
     
    37493749 
    37503750#deprecated functionality, now implemented using %ENV% 
    3751 #move to compatibility plugin in TWiki5 
     3751#move to compatibility plugin in Foswiki 2.0 
    37523752sub HTTP_HOST_deprecated { 
    37533753    return $_[0]->{request}->header('Host') || ''; 
     
    37553755 
    37563756#deprecated functionality, now implemented using %ENV% 
    3757 #move to compatibility plugin in TWiki5 
     3757#move to compatibility plugin in Foswiki 2.0 
    37583758sub REMOTE_ADDR_deprecated { 
    37593759    return $_[0]->{request}->remoteAddress() || ''; 
     
    37613761 
    37623762#deprecated functionality, now implemented using %ENV% 
    3763 #move to compatibility plugin in TWiki5 
     3763#move to compatibility plugin in Foswiki 2.0 
    37643764sub REMOTE_PORT_deprecated { 
    37653765 
    37663766    # CGI/1.1 (RFC 3875) doesn't specify REMOTE_PORT, 
    37673767    # but some webservers implement it. However, since 
    3768     # it's not RFC compliant, TWiki should not rely on 
     3768    # it's not RFC compliant, Foswiki should not rely on 
    37693769    # it. So we get more portability. 
    37703770    return ''; 
     
    37723772 
    37733773#deprecated functionality, now implemented using %ENV% 
    3774 #move to compatibility plugin in TWiki5 
     3774#move to compatibility plugin in Foswiki 
    37753775sub REMOTE_USER_deprecated { 
    37763776    return $_[0]->{request}->remoteUser() || ''; 
     
    41304130# Spacing of WikiWords is now done with %SPACEOUT% 
    41314131# (and the private routine _SPACEOUT). 
    4132 # Move to compatibility module in TWiki5 
     4132# Move to compatibility module in Foswiki 2.0 
    41334133sub SPACEDTOPIC_deprecated { 
    41344134    my ( $this, $params, $theTopic ) = @_; 
     
    43814381 
    43824382#deprecated functionality, now implemented using %USERINFO% 
    4383 #move to compatibility plugin in TWiki5 
     4383#move to compatibility plugin in Foswiki 2.0 
    43844384sub WIKINAME_deprecated { 
    43854385    my ( $this, $params ) = @_; 
     
    43924392 
    43934393#deprecated functionality, now implemented using %USERINFO% 
    4394 #move to compatibility plugin in TWiki5 
     4394#move to compatibility plugin in Foswiki 2.0 
    43954395sub USERNAME_deprecated { 
    43964396    my ( $this, $params ) = @_; 
     
    44034403 
    44044404#deprecated functionality, now implemented using %USERINFO% 
    4405 #move to compatibility plugin in TWiki5 
     4405#move to compatibility plugin in Foswiki 2.0 
    44064406sub WIKIUSERNAME_deprecated { 
    44074407    my ( $this, $params ) = @_; 
Note: See TracChangeset for help on using the changeset viewer.