1 # <a name="TWiki Source Code Packages"></a><a name=" TWiki Source Code Packages"></a> TWiki Source Code Packages
3 %X% This documentation is automatically generated from the `pod`, so it always matches the running code
7 <li><a href="#"> </a></li>
8 <li><a href="#"> </a></li>
9 <li><a href="#"> </a></li>
10 <li><a href="#"> </a></li>
11 <li><a href="#"> </a></li>
12 <li><a href="#"> </a></li>
13 <li><a href="#"> </a></li>
14 <li><a href="#"> </a></li>
15 <li><a href="#"> </a></li>
16 <li><a href="#"> </a></li>
17 <li><a href="#"> </a></li>
18 <li><a href="#"> </a></li>
19 <li><a href="#"> </a></li>
20 <li><a href="#"> </a></li>
21 <li><a href="#"> </a></li>
22 <li><a href="#"> </a></li>
23 <li><a href="#"> </a></li>
24 <li><a href="#"> </a></li>
25 <li><a href="#TWiki::_AccessControlException"> TWiki::AccessControlException </a></li>
26 <li><a href="#TWiki::Access"> TWiki::Access </a></li>
27 <li><a href="#TWiki::_AggregateIterator"> TWiki::AggregateIterator </a></li>
28 <li><a href="#TWiki::Attach"> TWiki::Attach </a></li>
29 <li><a href="#TWiki::Attrs"> TWiki::Attrs </a></li>
30 <li><a href="#TWiki::Compatibility"> TWiki::Compatibility </a></li>
31 <li><a href="#TWiki::Configure::Load"> TWiki::Configure::Load </a></li>
32 <li><a href="#Purpose"> Purpose</a></li>
33 <li><a href="#"> </a></li>
34 <li><a href="#TWiki"> TWiki </a></li>
35 <li><a href="#Public Data members"> Public Data members</a></li>
36 <li><a href="#TWiki::Form"> TWiki::Form </a></li>
37 <li><a href="#TWiki::Form::_FieldDefinition"> TWiki::Form::FieldDefinition </a></li>
38 <li><a href="#TWiki::Form::_ListFieldDefinitio"> TWiki::Form::ListFieldDefinition </a></li>
39 <li><a href="#"> </a></li>
40 <li><a href="#TWiki::Func"> TWiki::Func </a></li>
41 <li><a href="#TWiki::_I18N"> TWiki::I18N </a></li>
42 <li><a href="#TWiki::_I18N::Extract"> TWiki::I18N::Extract </a></li>
43 <li><a href="#TWiki::If::Node"> TWiki::If::Node </a></li>
44 <li><a href="#TWiki::If::Parser"> TWiki::If::Parser </a></li>
45 <li><a href="#TWiki::Infix::Error"> TWiki::Infix::Error </a></li>
46 <li><a href="#TWiki::Infix::Node"> TWiki::Infix::Node </a></li>
47 <li><a href="#TWiki::Infix::Parser"> TWiki::Infix::Parser </a></li>
48 <li><a href="#TWiki::_LineIterator"> TWiki::LineIterator </a></li>
49 <li><a href="#TWiki::_ListIterator"> TWiki::ListIterator </a></li>
50 <li><a href="#TWiki::_LoginManager::_ApacheLog"> TWiki::LoginManager::ApacheLogin </a></li>
51 <li><a href="#TWiki::_LoginManager"> TWiki::LoginManager </a></li>
52 <li><a href="#ObjectData =twiki="> ObjectData twiki</a></li>
53 <li><a href="#TWiki::_LoginManager::_TemplateL"> TWiki::LoginManager::TemplateLogin </a></li>
54 <li><a href="#TWiki::Merge"> TWiki::Merge </a></li>
55 <li><a href="#TWiki::Meta"> TWiki::Meta </a></li>
56 <li><a href="#TWiki::Net"> TWiki::Net </a></li>
57 <li><a href="#TWiki::Net::HTTPResponse"> TWiki::Net::HTTPResponse </a></li>
58 <li><a href="#TWiki::_OopsException"> TWiki::OopsException </a></li>
62 ## <> \[[CGISessionDotPm]\[]]
64 This package doesn't smell
66 ## <> \[[CGISessionDriverDBIDotPm]\[]]
68 This package doesn't smell
70 ## <> \[[CGISessionDriverDb\_fileDotPm]\[]]
72 This package doesn't smell
74 ## <> \[[CGISessionDriverDotPm]\[]]
76 This package doesn't smell
78 ## <> \[[CGISessionDriverFileDotPm]\[]]
80 This package doesn't smell
82 ## <> \[[CGISessionDriverMysqlDotPm]\[]]
84 This package doesn't smell
86 ## <> \[[CGISessionDriverPostgresqlDotPm]\[]]
88 This package doesn't smell
90 ## <> \[[CGISessionDriverSqliteDotPm]\[]]
92 This package doesn't smell
94 ## <> \[[CGISessionErrorHandlerDotPm]\[]]
96 This package doesn't smell
98 ## <> \[[CGISessionIDIncrDotPm]\[]]
100 This package doesn't smell
102 ## <> \[[CGISessionIDMd5DotPm]\[]]
104 This package doesn't smell
106 ## <> \[[CGISessionSerializeDefaultDotPm]\[]]
108 This package doesn't smell
110 ## <> \[[CGISessionSerializeFreezethawDotPm]\[]]
112 This package doesn't smell
114 ## <> \[[CGISessionSerializeJsonDotPm]\[]]
116 This package doesn't smell
118 ## <> \[[CGISessionSerializeStorableDotPm]\[]]
120 This package doesn't smell
122 ## <> \[[CGISessionSerializeYamlDotPm]\[]]
124 This package doesn't smell
126 ## <> \[[CGISessionTutorialDotPm]\[]]
128 This package doesn't smell
130 ## <> \[[MonitorDotPm]\[]]
132 This package doesn't smell
134 ## <a name="TWiki::_AccessControlException"></a> [[TWiki::AccessControlException|Main/TWikiAccessControlExceptionDotPm]]
136 Exception used raise an access control violation. This exception has the following fields:
138 - `web` - the web which was being accessed
139 - `topic` - the topic being accessed (if any)
140 - `user` - canonical username of the person doing the accessing. Use the methods of the TWiki::Users class to get more information about the user.
141 - `mode` - the access mode e.g. CHANGE, VIEW etc
142 - `reason` a text string giving the reason for the refusal.
144 The exception may be thrown by plugins. If a plugin throws the exception, it will normally be caught and the browser redirected to a login screen (if the user is not logged in) or reported (if they are and just don't have access).
146 This package doesn't smell
148 ## <a name="TWiki::Access"></a> [[TWiki::Access|Main/TWikiAccessDotPm]]
150 A singleton object of this class manages the access control database.
152 This package doesn't smell
154 ## <a name="TWiki::_AggregateIterator"></a> [[TWiki::AggregateIterator|Main/TWikiAggregateIteratorDotPm]]
156 combine multiple iterators
158 This package doesn't smell
160 ## <a name="TWiki::Attach"></a> [[TWiki::Attach|Main/TWikiAttachDotPm]]
162 A singleton object of this class is used to deal with attachments to topics.
164 This package doesn't smell
166 ## <a name="TWiki::Attrs"></a> [[TWiki::Attrs|Main/TWikiAttrsDotPm]]
168 Class of attribute sets, designed for parsing and storing attribute values from a TWiki tag e.g. `%TAG{"joe" fred="bad" joe="mad"}%`
170 An attribute set is a hash containing an entry for each parameter. The default parameter (unnamed quoted string) is named `_DEFAULT` in the hash.
172 Attributes declared later in the string will override those of the same name defined earlier. The one exception to this is the \_DEFAULT key, where the _first_ instance is always taken.
174 As well as the default TWiki syntax (parameter values double-quoted) this class also parses single-quoted values, unquoted spaceless values, spaces around the =, and commas as well as spaces separating values. The extended syntax has to be enabled by passing the `$friendly` parameter to `new`.
176 This package doesn't smell
178 ## <a name="TWiki::Compatibility"></a> [[TWiki::Compatibility|Main/TWikiCompatibilityDotPm]]
180 Support for compatibility with old TWiki versions. Packaged separately because 99.999999% of the time this won't be needed.
182 This package has smell factor of **2**
184 ## <a name="TWiki::Configure::Load"></a> [[TWiki::Configure::Load|Main/TWikiConfigureLoadDotPm]]
186 ## <a name="Purpose"></a> Purpose
188 This module consists of just a single subroutine `readConfig`. It allows to safely modify configuration variables _for one single run_ without affecting normal TWiki operation.
190 This package doesn't smell
192 ## <> \[[TWikiConfigureUIsEXTENDDotPm]\[]]
194 This package has smell factor of **1**
196 ## <a name="TWiki"></a> [[TWiki|Main/TWikiDotPm]]
198 TWiki operates by creating a singleton object (known as the Session object) that acts as a point of reference for all the different modules in the system. This package is the class for this singleton, and also contains the vast bulk of the basic constants and the per- site configuration mechanisms.
200 Global variables are avoided wherever possible to avoid problems with CGI accelerators such as mod\_perl.
202 ## <a name="Public Data members"></a> Public Data members
204 - `cgiQuery` Pointer to the CGI::
205 - `context` Hash of context ids
206 - moved: `loginManager` TWiki::LoginManager singleton (moved to TWiki::Users)
207 - `plugins` TWiki::Plugins singleton
208 - `prefs` TWiki::Prefs singleton
209 - `remoteUser` Login ID when using [[ApacheLogin]]. Maintained for compatibility only, do not use.
210 - `requestedWebName` Name of web found in URL path or `web` URL parameter
211 - `sandbox` TWiki::Sandbox singleton
212 - `scriptUrlPath` URL path to the current script. May be dynamically extracted from the URL path if \{GetScriptUrlFromCgi\}. Only required to support \{GetScriptUrlFromCgi\} and not consistently used. Avoid.
213 - `security` TWiki::Access singleton
214 - `SESSION_TAGS` Hash of TWiki variables whose value is specific to the current CGI request.
215 - `store` TWiki::Store singleton
216 - `topicName` Name of topic found in URL path or `topic` URL parameter
217 - `urlHost` Host part of the URL (including the protocol) determined during intialisation and defaulting to \{DefaultUrlHost\}
218 - `user` Unique user ID of logged-in user
219 - `users` TWiki::Users singleton
220 - `webName` Name of web found in URL path, or `web` URL parameter, or \{UsersWebName\}
222 This package has smell factor of **34**
224 ## <a name="TWiki::Form"></a> [[TWiki::Form|Main/TWikiFormDotPm]]
226 Object representing a single form definition.
228 Form definitions are mainly used to control rendering of a form for editing, though there is some application login there that handles transferring values between edits and saves.
230 A form definition consists of a TWiki::Form object, which has a list of field definitions. Each field definition is an object of a type derived from TWiki::Form::FieldDefinition. These objects are responsible for the actual syntax and semantics of the field type. Form definitions are parsed from TWiki tables, and the types are mapped by name to a class declared in TWiki::Form::\* - for example, the `text` type is mapped to `TWiki::Form::Text` and the `checkbox` type to `TWiki::Form::Checkbox`.
232 The `TWiki::Form::FieldDefinition` class declares default behaviours for types that accept a single value in their definitions. The `TWiki::Form::ListFieldDefinition` extends this for types that have lists of possible values.
234 This package has smell factor of **4**
236 ## <a name="TWiki::Form::_FieldDefinition"></a> [[TWiki::Form::FieldDefinition|Main/TWikiFormFieldDefinitionDotPm]]
238 Base class of all field definition classes.
240 Type-specific classes are derived from this class to define specific per-type behaviours. This class also provides default behaviours for when a specific type cannot be loaded.
242 This package doesn't smell
244 ## <a name="TWiki::Form::_ListFieldDefinitio"></a> [[TWiki::Form::ListFieldDefinition|Main/TWikiFormListFieldDefinitionDotPm]]
246 Form field definitions that accept lists of values in the field definition. This is different to being multi-valued, which means the field type can **store** multiple values.
248 This package has smell factor of **1**
250 ## <> \[[TWikiFormSelectDotPm]\[]]
252 This package doesn't smell
254 ## <a name="TWiki::Func"></a> [[TWiki::Func|Main/TWikiFuncDotPm]]
256 _Official list of stable TWiki functions for Plugin developers_
258 This module defines official functions that [[Plugins|SYSTEMWEB/TWikiPlugins]] can use to interact with the TWiki engine and content.
260 Refer to [[EmptyPlugin]] and lib/TWiki/Plugins/EmptyPlugin.pm for a template Plugin and documentation on how to write a Plugin.
262 Plugins should **only** use functions published in this module. If you use functions in other TWiki libraries you might create a security hole and you will probably need to change your Plugin when you upgrade TWiki.
264 Deprecated functions will still work in older code, though they should _not_ be called in new Plugins and should be replaced in older Plugins as soon as possible.
266 The version of the TWiki::Func module is defined by the VERSION number of the TWiki::Plugins module, currently 1.11. This can be shown by the `%PLUGINVERSION%` TWiki variable, and accessed in code using `$TWiki::Plugins::VERSION`. The 'Since' field in the function documentation refers to `$TWiki::Plugins::VERSION`.
268 Notes on use of `$TWiki::Plugins::VERSION` (from 1.2 forwards):
270 - If the **major** version (e.g. `1.`) is the same then any plugin coded to use any **earlier** revision of the `1.` API will still work. No function has been removed from the interface, nor has any API published in that version changed in such a way as to **require** plugins to be recoded.
271 - If the **minor** version (e.g. 1.1) is incremented there may be changes in the API that may help improve the coding of some plugins - for example, new interfaces giving access to previously hidden core functions. In addition, **deprecation** of functions in the interface trigger a minor version increment. Note that deprecated functions are not _removed_, they are merely frozen, and plugin authors are recommended to stop using them.
272 - Any additional digits in the version number relate to minor changes, such as the addition of parameters to the existing functions, or addition of utility functions that are unlikely to require significant changes to existing plugins.
273 - `TWiki::Plugins::VERSION` also applies to the plugin handlers. The handlers are documented in the EmptyPlugin, and that module indicates what version of `TWiki::Plugins::VERSION` it relates to.
275 A full history of the changes to this API can be found at the end of this topic.
277 This package has smell factor of **1**
279 ## <a name="TWiki::_I18N"></a> [[TWiki::I18N|Main/TWikiI18NDotPm]]
281 Support for strings translation and language detection.
283 This package has smell factor of **2**
285 ## <a name="TWiki::_I18N::Extract"></a> [[TWiki::I18N::Extract|Main/TWikiI18NExtractDotPm]]
287 Support translatable strings extraction from TWiki topics and templates. Depends on Locale::Maketext::Extract (part of CPAN::Locale::Maketext::Lexicon).
289 This package has smell factor of **1**
291 ## <a name="TWiki::If::Node"></a> [[TWiki::If::Node|Main/TWikiIfNodeDotPm]]
293 Node class for the result of an If statement parse
295 This package doesn't smell
297 ## <a name="TWiki::If::Parser"></a> [[TWiki::If::Parser|Main/TWikiIfParserDotPm]]
299 Support for the conditions in %IF\{\} statements.
301 This package doesn't smell
303 ## <a name="TWiki::Infix::Error"></a> [[TWiki::Infix::Error|Main/TWikiInfixErrorDotPm]]
305 Class of errors used with TWiki::Infix::Parser
307 This package doesn't smell
309 ## <a name="TWiki::Infix::Node"></a> [[TWiki::Infix::Node|Main/TWikiInfixNodeDotPm]]
311 Base class for node types generated by Infix::Parser. You don't **have** to use it, but it may be useful.
313 This package doesn't smell
315 ## <a name="TWiki::Infix::Parser"></a> [[TWiki::Infix::Parser|Main/TWikiInfixParserDotPm]]
317 A simple stack-based parser that parses infix expressions with nonary, unary and binary operators specified using an operator table.
319 Escapes are supported in strings, using backslash.
321 This package doesn't smell
323 ## <a name="TWiki::_LineIterator"></a> [[TWiki::LineIterator|Main/TWikiLineIteratorDotPm]]
325 Iterator over the lines in a file
327 This package doesn't smell
329 ## <a name="TWiki::_ListIterator"></a> [[TWiki::ListIterator|Main/TWikiListIteratorDotPm]]
333 This package doesn't smell
335 ## <a name="TWiki::_LoginManager::_ApacheLog"></a> [[TWiki::LoginManager::ApacheLogin|Main/TWikiLoginManagerApacheLoginDotPm]]
337 This is login manager that you can specify in the security setup section of [configure](http://www.dementia.org/twiki/configure). It instructs TWiki to cooperate with your web server (typically Apache) to require authentication information (username & password) from users. It requires that you configure your web server to demand authentication for scripts named "login" and anything ending in "auth". The latter should be symlinks to existing scripts; e.g., `viewauth -> view`, `editauth -> edit`, and so on.
339 See also [[TWikiUserAuthentication]].
341 Subclass of TWiki::LoginManager; see that class for documentation of the methods of this class.
343 This package has smell factor of **1**
345 ## <a name="TWiki::_LoginManager"></a> [[TWiki::LoginManager|Main/TWikiLoginManagerDotPm]]
347 The package is also a Factory for login managers and also the base class for all login managers.
349 On it's own, an object of this class is used when you specify 'none' in the security setup section of [configure](http://www.dementia.org/twiki/configure). When it is used, logins are not supported. If you want to authenticate users then you should consider [[TemplateLogin]] or [[ApacheLogin]], which are subclasses of this class.
351 If you are building a new login manager, then you should write a new subclass of this class, implementing the methods marked as **VIRTUAL**. There are already examples in the `lib/TWiki/LoginManager` directory.
353 The class has extensive tracing, which is enabled by $TWiki::cfg\{Trace\}\{LoginManager.pm\}. The tracing is done in such a way as to let the perl optimiser optimise out the trace function as a no-op if tracing is disabled.
355 Here's an overview of how it works:
357 Early in TWiki::new, the login manager is created. The creation of the login manager does two things:
359 1. If sessions are in use, it loads CGI::Session but doesn't initialise the session yet.
360 2. Creates the login manager object
362 Slightly later in TWiki::new, loginManager->loadSession is called.
364 1. Calls loginManager->getUser to get the username **before** the session is created
365 - TWiki::LoginManager::ApacheLogin looks at REMOTE\_USER (only for authenticated scripts)
366 - TWiki::LoginManager::TemplateLogin just returns undef
367 2. reads the TWIKISID cookie to get the SID (or the TWIKISID parameters in the CGI query if cookies aren't available, or [[IP2SID]] mapping if that's enabled).
368 3. Creates the CGI::Session object, and the session is thereby read.
369 4. If the username still isn't known, reads it from the cookie. Thus TWiki::LoginManager::ApacheLogin overrides the cookie using REMOTE\_USER, and TWiki::LoginManager::TemplateLogin **always** uses the session.
371 Later again in TWiki::new, plugins are given a chance to **override** the username found from the loginManager.
373 The last step in TWiki::new is to find the user, using whatever user mapping manager is in place.
375 ## <a name="ObjectData <code>twiki="></a> [[ObjectData]] =twiki
377 The TWiki object this login manager is attached to.
379 This package has smell factor of **7**
381 ## <a name="TWiki::_LoginManager::_TemplateL"></a> [[TWiki::LoginManager::TemplateLogin|Main/TWikiLoginManagerTemplateLoginDotPm]]
383 This is a login manager that you can specify in the security setup section of [configure](http://www.dementia.org/twiki/configure). It provides users with a template-based form to enter usernames and passwords, and works with the [[PasswordManager]] that you specify to verify those passwords.
385 Subclass of TWiki::LoginManager; see that class for documentation of the methods of this class.
387 This package has smell factor of **2**
389 ## <a name="TWiki::Merge"></a> [[TWiki::Merge|Main/TWikiMergeDotPm]]
391 Support for merging strings
393 This package has smell factor of **1**
395 ## <a name="TWiki::Meta"></a> [[TWiki::Meta|Main/TWikiMetaDotPm]]
397 All TWiki topics have **data** (text) and **meta-data** (information about the topic). Meta-data includes information such as file attachments, form fields, topic parentage etc. When TWiki loads a topic from the store, it represents the meta-data in the topic using an object of this class.
399 A meta-data object is a hash of different types of meta-data (keyed on the type, such as 'FIELD' and 'TOPICINFO').
401 Each entry in the hash is an array, where each entry in the array contains another hash of the key=value pairs, corresponding to a single meta-datum.
403 If there may be multiple entries of the same top-level type (i.e. for FIELD and FILEATTACHMENT) then the array has multiple entries. These types are referred to as "keyed" types. The array entries are keyed with the attribute 'name' which must be in each entry in the array.
405 For unkeyed types, the array has only one entry.
414 - [0] -> \{ name => '...' ... \}
415 - [1] -> \{ name => '...' ... \}
417 - [0] -> \{ name => '...' ... \}
418 - [1] -> \{ name => '...' ... \}
420 As well as the meta-data, the object also stores the web name, topic name and remaining text after meta-data extraction.
422 This package has smell factor of **2**
424 ## <a name="TWiki::Net"></a> [[TWiki::Net|Main/TWikiNetDotPm]]
426 Object that brokers access to network resources.
428 This package has smell factor of **3**
430 ## <a name="TWiki::Net::HTTPResponse"></a> [[TWiki::Net::HTTPResponse|Main/TWikiNetHTTPResponseDotPm]]
432 Fakeup of HTTP::Response for use when LWP is not available. Only implements a small subset of the HTTP::Response methods:
434 <table border="1" cellpadding="0" cellspacing="0">
436 <td><code>code()</code></td>
439 <td><code>message()</code></td>
442 <td><code>header($field)</code></td>
445 <td><code>content()</code></td>
448 <td><code>is_error()</code></td>
451 <td><code>is_redirect()</code></td>
455 See the documentation of HTTP::Response for information about the methods.
457 This package doesn't smell
459 ## <a name="TWiki::_OopsException"></a> [[TWiki::OopsException|Main/TWikiOopsExceptionDotPm]]
461 Exception used to raise a request to redirect to an Oops URL.
463 An [[OopsException]] thrown anywhere in the code will redirect the browser to a url based on the `oops` script. `oops` requires the name of an oops template file from the `templates` directory. This file will be expanded and the parameter values passed to the exception instantiated. The result will be shown in the browser.
465 Plugins may throw TWiki::OopsException. For example:
471 throw TWiki::OopsException( 'bathplugin',
475 params => [ 'bigtoe', 'hot tap' ] );
477 This package doesn't smell
479 ---++ [[TWikiPluginDotPm][]]
481 This package has smell factor of *2*
483 ---++ [[TWikiPluginsDotPm][TWiki::Plugins]]
485 This module defines the singleton object that handles Plugins
486 loading, initialization and execution.
488 This class uses Chain of Responsibility (GOF) pattern to dispatch
489 handler calls to registered plugins.
491 This package doesn't smell
493 ---++ [[TWikiPluralsDotPm][TWiki::Plurals]]
495 Handle conversion of plural topic names to singular form.
497 This package doesn't smell
499 ---++ [[TWikiPrefsDotPm][TWiki::Prefs]]
501 The Prefs class is a singleton that implements management of preferences.
502 It uses a stack of TWiki::Prefs::PrefsCache objects to store the
503 preferences for global, web, user and topic contexts, and provides
504 the means to look up preferences in these.
506 Preferences from different places stack on top of each other, so there
507 are global preferences, then site, then web (and subweb and subsubweb),
508 then topic, included topic and so on. Each level of the stack is tagged with
511 The module also maintains a separate of the preferences found in every topic
512 and web it reads. This supports the lookup of preferences for webs and topics
513 that are not on the stack, and must not be chained in (you can't allow
514 a user to override protections from their home topic!)
516 This package doesn't smell
518 ---++ [[TWikiPrefsParserDotPm][TWiki::Prefs::Parser]]
520 This Prefs-internal class is used to parse * Set and * Local statements
521 from arbitrary text, and extract settings from meta objects. It is used
522 by TopicPrefs to parse preference settings from topics.
524 This class does no validation or duplicate-checking on the settings; it
525 simply returns the recognized settings in the order it sees them in.
527 This package has smell factor of *1*
529 ---++ [[TWikiPrefsPrefsCacheDotPm][TWiki::Prefs::PrefsCache]]
531 The PrefsCache package holds a cache of topics that have been read in, using
532 the TopicPrefs class. These functions manage that cache.
534 We maintain 2 hashes of values:
535 * {locals} Contains all locals at this level. Locals are values that
536 only apply when the current topic is the topic where the local is
537 defined. The variable names are decorated with the locality where
539 * {values} contains all sets, locals, and all values inherited from
542 As each cache level is built, the values are copied down from the parent
543 cache level. This sounds monstrously inefficient, but in fact perl does
544 this a lot better than doing a multi-level lookup when a value is referenced.
545 This is especially important when many prefs lookups may be done in a
546 session, for example when searching.
548 This package doesn't smell
550 ---++ [[TWikiQueryHoistREsDotPm][TWiki::Query::HoistREs]]
552 Static functions to extract regular expressions from queries. The REs can
553 be used in caching stores that use the TWiki standard inline meta-data
554 representation to pre-filter topic lists for more efficient query matching.
556 See =Store/RcsFile.pm= for an example of usage.
558 This package doesn't smell
560 ---++ [[TWikiQueryNodeDotPm][TWiki::Query]]
562 A Query object is a representation of a query over the TWiki database.
564 Fields are given by name, and values by strings or numbers. Strings should always be surrounded by 'single-quotes'. Numbers can be signed integers or decimals. Single quotes in values may be escaped using backslash (\).
566 See TWiki.QuerySearch for details of the query language. At the time of writing
567 only a subset of the entire query language is supported, for use in searching.
569 A query object implements the =evaluate= method as its general
570 contract with the rest of the world. This method does a "hard work" evaluation
571 of the parser tree. Of course, smarter Store implementations should be
572 able to do it better....
574 This package has smell factor of *2*
576 ---++ [[TWikiQueryParserDotPm][TWiki::Query::Parser]]
580 This package doesn't smell
582 ---++ [[TWikiRenderDotPm][TWiki::Render]]
584 This module provides most of the actual HTML rendering code in TWiki.
586 This package has smell factor of *20*
588 ---++ [[TWikiSandboxDotPm][TWiki::Sandbox]]
590 This object provides an interface to the outside world. All calls to
591 system functions, or handling of file names, should be brokered by
594 NOTE: TWiki creates a singleton sandbox that is *shared* by all TWiki
595 runs under a single mod_perl instance. If any TWiki run modifies the
596 sandbox, that modification will carry over in to subsequent runs.
597 Be very, very careful!
599 This package has smell factor of *4*
601 ---++ [[TWikiSearchDotPm][TWiki::Search]]
603 This module implements all the search functionality.
605 This package has smell factor of *14*
607 ---++ [[TWikiStoreDotPm][TWiki::Store]]
609 This module hosts the generic storage backend. This module provides
610 the interface layer between the "real" store provider - which is hidden
611 behind a handler - and the rest of the system. it is responsible for
612 checking for topic existance, access permissions, and all the other
613 general admin tasks that are common to all store implementations.
615 This module knows nothing about how the data is actually _stored_ -
616 that knowledge is entirely encapsulated in the handlers.
618 The general contract for methods in the class requires that errors
619 are signalled using exceptions. TWiki::AccessControlException is
620 used for access control exceptions, and Error::Simple for all other
623 This package has smell factor of *14*
625 ---++ [[TWikiStoreQueryAlgorithmsBruteForceDotPm][TWiki::Store::QueryAlgorithms::BruteForce]]
627 Default brute-force query algorithm
629 Has some basic optimisation: it hoists regular expressions out of the
630 query to use with grep, so we can narrow down the set of topics that we
631 have to evaluate the query on.
633 Not sure exactly where the breakpoint is between the
634 costs of hoisting and the advantages of hoisting. Benchmarks suggest
635 that it's around 6 topics, though this may vary depending on disk
636 speed and memory size. It also depends on the complexity of the query.
638 This package doesn't smell
640 ---++ [[TWikiStoreRcsFileDotPm][TWiki::Store::RcsFile]]
642 This class is PACKAGE PRIVATE to Store, and should never be
643 used from anywhere else. It is the base class of implementations of stores
644 that manipulate RCS format files.
646 The general contract of the methods on this class and its subclasses
647 calls for errors to be signalled by Error::Simple exceptions.
649 Refer to Store.pm for models of usage.
651 This package has smell factor of *11*
653 ---++ [[TWikiStoreRcsLiteDotPm][TWiki::Store::RcsLite]]
655 This package does not publish any methods. It implements the virtual
656 methods of the [[TWikiStoreRcsFileDotPm][TWiki::Store::RcsFile]] superclass.
658 Simple replacement for RCS. Doesn't support:
661 Neither of which are used (or needed) by TWiki.
663 This module doesn't know anything about the content of the topic
665 There is one of these object for each file stored under RCSLite.
667 This object is PACKAGE PRIVATE to Store, and should NEVER be
668 used from anywhere else.
671 * need to tidy up dealing with \n for differences
672 * still have difficulty on line ending at end of sequences, consequence of doing a line based diff
677 rcstext ::= admin {delta}* desc {deltatext}*
678 admin ::= head {num};
681 symbols {sym : num}*;
682 locks {id : num}*; {strict ;}
683 { comment {string}; }
699 digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
700 id ::= {num} idchar {idchar | num }*
701 sym ::= {digit}* idchar {idchar | digit }*
702 idchar ::= any visible graphic character except special
703 special ::= $ | , | . | : | ; | @
704 string ::= @{any character, with @ doubled}*@
705 newphrase ::= id word* ;
706 word ::= id | num | string | :
708 Identifiers are case sensitive. Keywords are in lower case only. The
709 sets of keywords and identifiers can overlap. In most environments RCS
710 uses the ISO 8859/1 encoding: visible graphic characters are codes
711 041-176 and 240-377, and white space characters are codes 010-015 and 040.
713 Dates, which appear after the date keyword, are of the form Y.mm.dd.hh.mm.ss,
714 where Y is the year, mm the month (01-12), dd the day (01-31), hh the hour
715 (00-23), mm the minute (00-59), and ss the second (00-60). Y contains just
716 the last two digits of the year for years from 1900 through 1999, and all
717 the digits of years thereafter. Dates use the Gregorian calendar; times
720 The newphrase productions in the grammar are reserved for future extensions
721 to the format of RCS files. No newphrase will begin with any keyword already
724 Revisions consist of a sequence of 'a' and 'd' edits that need to be
725 applied to rev N+1 to get rev N. Each edit has an offset (number of lines
726 from start) and length (number of lines). For 'a', the edit is followed by
727 length lines (the lines to be inserted in the text). For example:
729 d1 3 means "delete three lines starting with line 1
730 a4 2 means "insert two lines at line 4'
731 xxxxxx is the new line 4
732 yyyyyy is the new line 5
734 This package has smell factor of *2*
736 ---++ [[TWikiStoreRcsWrapDotPm][TWiki::Store::RcsWrap]]
738 This package does not publish any methods. It implements the
739 virtual methods of the [[TWikiStoreRcsFileDotPm][TWiki::Store::RcsFile]] superclass.
741 Wrapper around the RCS commands required by TWiki.
742 There is one of these object for each file stored under RCS.
744 This package has smell factor of *3*
746 ---++ [[TWikiStoreSearchAlgorithmsForkingDotPm][TWiki::Store::SearchAlgorithms::Forking]]
748 Forking implementation of the RCS cache search.
750 ---++ search($searchString, $topics, $options, $sDir) -> \%seen
751 Search .txt files in $dir for $searchString. See RcsFile::searchInWebContent
754 This package has smell factor of *3*
756 ---++ [[TWikiStoreSearchAlgorithmsPurePerlDotPm][TWiki::Store::SearchAlgorithms::PurePerl]]
758 Pure perl implementation of the RCS cache search.
760 ---++ search($searchString, $topics, $options, $sDir) -> \%seen
761 Search .txt files in $dir for $string. See RcsFile::searchInWebContent
764 This package doesn't smell
766 ---++ [[TWikiTemplatesDotPm][TWiki::Templates]]
768 Support for the TWiki template language.
770 This package has smell factor of *2*
772 ---++ [[TWikiTimeDotPm][TWiki::Time]]
774 Time handling functions.
776 This package has smell factor of *7*
778 ---++ [[TWikiUIChangeFormDotPm][TWiki::UI::ChangeForm]]
780 Service functions used by the UI packages
782 This package doesn't smell
784 ---++ [[TWikiUIDotPm][TWiki::UI]]
786 Service functions used by the UI packages
788 This package doesn't smell
790 ---++ [[TWikiUIEditDotPm][TWiki::UI::Edit]]
794 This package has smell factor of *1*
796 ---++ [[TWikiUIManageDotPm][TWiki::UI::Manage]]
798 UI functions for web, topic and user management
800 This package has smell factor of *4*
802 ---++ [[TWikiUIOopsDotPm][TWiki::UI::Oops]]
804 UI delegate for oops function
806 This package doesn't smell
808 ---++ [[TWikiUIRDiffDotPm][TWiki::UI::RDiff]]
810 UI functions for diffing.
812 This package has smell factor of *12*
814 ---++ [[TWikiUIRegisterDotPm][TWiki::UI::Register]]
816 User registration handling.
818 This package has smell factor of *5*
820 ---++ [[TWikiUISaveDotPm][TWiki::UI::Save]]
822 UI delegate for save function
824 This package has smell factor of *1*
826 ---++ [[TWikiUISearchDotPm][TWiki::UI::Search]]
828 UI functions for searching.
830 This package has smell factor of *2*
832 ---++ [[TWikiUIStatisticsDotPm][TWiki::UI::Statistics]]
834 Statistics extraction and presentation
836 This package has smell factor of *4*
838 ---++ [[TWikiUIUploadDotPm][TWiki::UI::Upload]]
840 UI delegate for attachment management functions
842 This package has smell factor of *3*
844 ---++ [[TWikiUIViewDotPm][TWiki::UI::View]]
846 UI delegate for view function
848 This package has smell factor of *2*
850 ---++ [[TWikiUserMappingDotPm][TWiki::UserMapping]]
852 This is a virtual base class (a.k.a an interface) for all user mappers. It is
853 *not* useable as a mapping in TWiki - use the BaseUserMapping for default
856 User mapping is the process by which TWiki maps from a username (a login name)
857 to a display name and back. It is also where groups are maintained.
859 See TWiki::Users::BaseUserMapping and TWiki::Users::TWikiUserMapping for
860 the default implementations of this interface.
862 If you want to write a user mapper, you will need to implement the methods
863 described in this class.
865 User mappings work by mapping both login names and display names to a
866 _canonical user id_. This user id is composed from a prefix that defines
867 the mapper in use (something like 'BaseUserMapping_' or 'LdapUserMapping_')
868 and a unique user id that the mapper uses to identify the user.
870 The null prefix is reserver for the TWikiUserMapping for compatibility
871 with old TWiki releases.
873 __Note:__ in all the following documentation, =$cUID= refers to a
876 This package has smell factor of *1*
878 ---++ [[TWikiUsersApacheHtpasswdUserDotPm][TWiki::Users::ApacheHtpasswdUser]]
880 Password manager that uses Apache::HtPasswd to manage users and passwords.
882 Subclass of [[TWikiUsersPasswordDotPm][ =TWiki::Users::Password= ]].
883 See documentation of that class for descriptions of the methods of this class.
885 Duplicates functionality of
886 [[TWikiUsersHtPasswdUserDotPm][ =TWiki::Users::HtPasswdUser=]];
887 provided mainly as an example of how to write a new password manager.
889 This package has smell factor of *1*
891 ---++ [[TWikiUsersBaseUserMappingDotPm][TWiki::Users::BaseUserMapping]]
893 User mapping is the process by which TWiki maps from a username (a login name)
894 to a display name and back. It is also where groups are maintained.
896 The BaseMapper provides support for a small number of predefined users.
897 No registration - this is a read only usermapper. It uses the mapper
898 prefix 'BaseUserMapping_'.
901 * TWikiAdmin - uses the password that was set in Configure (IF its not null)
904 * TWikiContributor - 1 Jan 2005
905 * TWikiRegistrationAgent - 1 Jan 2005
908 * $TWiki::cfg{SuperAdminGroup}
911 This package has smell factor of *2*
913 ---++ [[TWikiUsersDotPm][TWiki::Users]]
914 This package provides services for the lookup and manipulation of login and
915 wiki names of users, and their authentication.
917 It is a Facade that presents a common interface to the User Mapping
918 and Password modules. The rest of the core should *only* use the methods
919 of this package, and should *never* call the mapping or password managers
922 TWiki uses the concept of a _login name_ which is used to authenticate a
923 user. A login name maps to a _wiki name_ that is used to identify the user
924 for display. Each login name is unique to a single user, though several
925 login names may map to the same wiki name.
927 Using this module (and the associated plug-in user mapper) TWiki supports
928 the concept of _groups_. Groups are sets of login names that are treated
929 equally for the purposes of access control. Group names do not have to be
930 wiki names, though it is helpful for display if they are.
932 Internally in the code TWiki uses something referred to as a _canonical user
933 id_ or just _user id_. The user id is also used externally to uniquely identify
934 the user when (for example) recording topic histories. The user id is *usually*
935 just the login name, but it doesn't need to be. It just has to be a unique
936 7-bit alphanumeric and underscore string that can be mapped to/from login
937 and wiki names by the user mapper.
939 The canonical user id should *never* be seen by a user. On the other hand,
940 core code should never use anything *but* a canonical user id to refer
944 * A *login name* is the name used to log in to TWiki. Each login name is
945 assumed to be unique to a human. The Password module is responsible for
946 authenticating and manipulating login names.
947 * A *canonical user id* is an internal TWiki representation of a user. Each
948 canonical user id maps 1:1 to a login name.
949 * A *wikiname* is how a user is displayed. Many user ids may map to a
950 single wikiname. The user mapping module is responsible for mapping
951 the user id to a wikiname.
952 * A *group id* represents a group of users and other groups.
953 The user mapping module is responsible for mapping from a group id to
954 a list of canonical user ids for the users in that group.
955 * An *email* is an email address asscoiated with a *login name*. A single
956 login name may have many emails.
959 * wherever the code references $cUID, its a canonical_id
960 * wherever the code references $group, its a group_name
961 * $name may be a group or a cUID
963 This package has smell factor of *5*
965 ---++ [[TWikiUsersHtPasswdUserDotPm][TWiki::Users::HtPasswdUser]]
967 Support for htpasswd and htdigest format password files.
969 Subclass of [[TWikiUsersPasswordDotPm][ =TWiki::Users::Password= ]].
970 See documentation of that class for descriptions of the methods of this class.
972 This package has smell factor of *3*
974 ---++ [[TWikiUsersPasswordDotPm][TWiki::Users::Password]]
976 Base class of all password handlers. Default behaviour is no passwords,
977 so anyone can be anyone they like.
979 The methods of this class should be overridded by subclasses that want
980 to implement other password handling methods.
982 This package doesn't smell
984 There were a total of *193* smells