If you have mangled TWiki for you own purposes, or written a plugin or add-on that pokes into the core, then you need this crib sheet. In the shift from Cairo to Dakar, a large number of internal interfaces have changed. This
but if you short-circuited that interface, some functions you used may have changed or disappeared entirely. This crib sheet shows the mapping between functions in Cairo and their equivalents in Dakar, to assist in porting.
One important thing to understand is the effect of eliminating global variables, in order to support
. This has been done by creating objects with only one instance that represent the packages in TWiki - for example, instead of there being a "Prefs module" that holds preferences in global variables, there is now a "preferences object" that contains those preferences.
Global data in the TWiki module has also been formally split into "site" and "session" data. Site data comes from the
file, and is not expected to change, so it is still in the old global variables, but these
be treated as _constants. Session data is specific to a single query, and has been moved into the TWiki "session object", henceforth referred to as
. This session object also contains references to a number of other session-specific objects corresponding to the different TWiki modules; for example,
From a programmer perspective the main impact this has is to change the way you call core functions and refer to session global variables. Instead of calling functions using syntax like "TWiki::Prefs::getPreferencesVariable", you now have to indirect via the TWiki session object. e.g. $TWiki->{prefs}->getPreferencesValue(...)=. Per-session variables such as the old
.
Not all packages are affected, only those with data in global variables, and not all functions in the affected packages - some are purely static (do not refer to global data), and have been left that way. If you are unsure, look at the core code. If the method you want to use has a new first parameter
it has become an object method and must be called via the session object.
. You should probably be using the
module, or campaigning to get that module extended to support your extension! And a word of warning; if you module has any session-specific global variables it will probably not work under mod_perl.
There are also changes to the location and/or naming of many methods. The table below gives the approximate mapping. It has been generated during the changes and may be inaccurate in some ways, but you should be able to resolve any unknowns by reading the code. Note that any methods that now start with an underscore are now
, even by other core modules. No mapping has been given for methods that were private in Cairo; you are on your own if you've been crazy enough to call these.
| Cairo |
Use instead: |
$TWiki::Store::readTopicPermissionFailed |
$TWiki->{store}->accessFailed() |
TWiki::UI::Upload::_addLinkToEndOfTopic |
dead |
| |
$TWiki->{store}->attachmentExists |
TWiki::cleanupIncludedHTML |
private |
| |
$TWiki->{store}->cleanUpRevID |
TWiki::Meta::cleanValue |
dead |
TWiki::Store::convert2metaFormat |
dead |
TWiki::Store::RcsFile::delete |
dead |
TWiki::Render::emitList |
private |
TWiki::Render::emitTR |
private |
TWiki::Store::erase |
dead |
TWiki::Render::externalLink |
private |
TWiki::Attach::filenameToIcon |
$TWiki->{renderer}->filenameToIcon |
TWiki::Render::fixedFontText |
private |
TWiki::fixIncludeLink |
private |
TWiki::fixN |
private |
TWiki::fixURL |
private |
TWiki::Prefs::formatAsFlag |
private |
TWiki::Prefs::formatAsNumber |
dead |
| |
$TWiki->{store}->getAttachmentStream |
TWiki::getDataDir |
$TWiki->{dataDir} |
| |
$TWiki->{store}->getDebugText |
TWiki::getEmailNotifyList |
pending User module rewrite |
TWiki::getEmailOfUser |
pending User module rewrite |
TWiki::Store::getFileName |
|
TWiki::Form::getFormDefinition |
dead |
TWiki::Render::getFormField |
TWiki::_handleFORMFIELD |
TWiki::Form::getFormInfoFromMeta |
dead |
TWiki::Access::getGroupsUserIsIn |
$TWiki->{security}->getGroupsUserIsIn |
TWiki::Access::getListOfGroups |
private |
TWiki::Attach::getOldAttachAttr |
private |
TWiki::getPageMode |
$TWiki->{renderer}->{MODE} |
TWiki::Prefs::getPreferencesFlag |
TWiki::Func::getPreferencesFlag |
TWiki::Prefs::getPreferencesNumber |
TWiki::Func::getPreferencesNumber |
TWiki::Prefs::getPreferencesValue |
TWiki::Func::getPreferencesValue |
TWiki::Prefs::getPrefsFromTopic |
$TWiki->{prefs}->getPrefsFromTopic |
TWiki::getPubDir |
TWiki::Func::getPubDir |
TWiki::getPubUrlPath |
$TWiki->{pubUrlPath} |
TWiki::Render::getRenderedVersion |
TWiki::Func::renderText |
TWiki::Store::getRevisionInfoFromMeta |
TWiki::Meta::getRevisionInfo |
TWiki::Store::getRevisionNumberX |
$TWiki->{store}->getTopic |
TWiki::getSessionValue |
dead |
TWiki::Store::getSubWebs |
private |
TWiki::Store::getTopicNames |
TWiki::Func::getTopicList |
| |
$TWiki->{store}->getTopicParent |
TWiki::Prefs::getTopicPrefs |
dead |
TWiki::Access::getUsersOfGroup |
private |
TWiki::Access::prvGetUsersOfGroup |
private |
TWiki::Access::prvGetWebTopicName |
private |
TWiki::getWikiUserTopic |
dead |
TWiki::Plugins::handleActivatedPlugins |
private |
TWiki::handleEnvVariable |
private |
TWiki::handleIcon |
private |
TWiki::handleIncludeFile |
private |
TWiki::handleIncludeUrl |
private |
TWiki::handleInternalTags |
TWiki::Func::expandCommonVariables |
TWiki::handleIntUrlEncode |
private |
TWiki::handleNativeUrlEncode |
=TWiki::nativeUrlEncode |
= TWiki::handleUrlEncode= |
TWiki::_urlEncode =TWiki::entityEncode |
TWiki::handleMetaSearch |
private |
TWiki::handleMetaTags |
private |
TWiki::Plugins::handlePluginDescription |
private |
TWiki::Prefs::handlePreferencesTags |
TWiki::expandCommonVariables |
TWiki::handleRelativeTopicPath |
private |
TWiki::handleRevisionInfo |
private |
TWiki::handleSearchWeb |
private |
TWiki::handleTime |
private |
TWiki::handleSpacedTopic |
private |
TWiki::handleTmplP |
private |
TWiki::Store::handleTmplP |
private |
TWiki::handleToc |
private |
TWiki::handleUrlParam |
private |
TWiki::handleWebAndTopicList |
private |
TWiki::Plugins::initialisationError |
private |
TWiki::Access::initializeAccess |
dead use security object |
TWiki::Prefs::initializePrefs |
dead use prefs object |
TWiki::initializeRemoteUser |
$TWiki->{users}->initializeRemoteUser |
TWiki::Render::initialize |
dead use renderer object |
TWiki::Store::initialize |
dead use store object |
TWiki::Prefs::initializeUserPrefs |
$TWiki->{prefs}->initializeUser |
TWiki::Prefs::insertPrefsValue |
private |
TWiki::Render::internalCrosswebLink |
dead |
TWiki::invalidSiteCharset |
private |
TWiki::isAbbrev |
TWiki::isValidAbbrev |
TWiki::isGuest |
dead |
TWiki::isWebName |
TWiki::isValidWebName |
TWiki::isWikiName |
TWiki::isValidWikiWord TWiki::isValidTopicName |
TWiki::Render::linkToolTipInfo |
private |
TWiki::Store::lockTopicNew |
$TWiki->{store}->lockTopic |
TWiki::Render::mailtoLinkFull |
private |
TWiki::Render::mailtoLinkSimple |
private |
TWiki::Render::mailtoLink |
private |
TWiki::Render::makeAnchorHeading |
private |
TWiki::Render::makeAnchorName |
$TWiki->{renderer}->makeAnchorName |
TWiki::makeTopicSummary |
$TWiki->{renderer}->makeTopicSummary |
TWiki::Store::metaAddTopicData |
dead |
TWiki::Attach::migrateFormatForTopic |
dead |
TWiki::Store::normalizeWebTopicName |
TWiki::normalizeWebTopicName |
TWiki::Prefs::parseMeta |
$TWiki->{prefs}->Parser::parseMeta |
TWiki::Prefs::parseText |
$TWiki->{prefs}->Parser::parseText |
TWiki::Access::prvGetUserList |
private |
TWiki::Access::permissionsSet |
$TWiki->{security}->permissionsSet |
TWiki::processTags |
TWiki::_processTags |
TWiki::Prefs::prvGetWebVariable |
$TWiki->{prefs}->getPreferencesValue + formatting |
TWiki::putBackVerbatim |
$TWiki->{renderer}->putBackBlocks |
TWiki::Store::readAttachmentVersion |
$TWiki->{store}->readAttachmentVersion |
TWiki::Store::readFileHead |
$TWiki->{store}->readFile |
TWiki::Store::readFile |
$TWiki->{store}->readFile |
TWiki::Prefs::readPrefs |
$TWiki->{prefs}->TopicPrefs::readPrefs |
TWiki::Store::readTemplateTopic |
TWiki::UI::readTemplateTopic |
TWiki::Store::readTemplate |
TWiki::Templates::readTemplate |
TWiki::Store::readTopicRaw |
$TWiki->{store}->readTopicRaw |
TWiki::Store::readTopic |
$TWiki->{store}->readTopic |
TWiki::Store::readTopicVersion |
$TWiki->{store}->readTopic |
TWiki::Store::readTopMeta |
$TWiki->{store}->readTopic |
TWiki::Meta::read |
dead |
TWiki::Store::readWebTopic |
$TWiki->{store}->readTopicRaw |
TWiki::Plugins::registerHandler |
private |
TWiki::Plugins::registerPlugin |
private |
TWiki::UI::Manage::relockRcsFiles |
dead |
TWiki::Attach::removeFile |
dead |
TWiki::Render::renderFormData |
private |
TWiki::Render::renderMoved |
private |
TWiki::Render::renderParent |
private |
TWiki::Prefs::replacePreferencesTags |
TWiki::processTags |
TWiki::Prefs::resetCache |
$TWiki->{prefs}->PrefsCache::resetCache |
TWiki::revDate2EpSecs |
TWiki::Store::revDate2EpSecs |
TWiki::Store::saveNew |
$TWikT->{store}->saveTopic $TWiki->{store}->saveAttachment |
TWiki::Store::saveTopicNew |
=$TWiki->{store}->saveTopic |
TWiki::Store::save |
$TWiki->{store}->saveTopic $TWiki->{store}->saveAttachment |
TWiki::setPageMode |
$TWiki->{renderer}->setRenderMode |
TWiki::setSessionValue |
|
TWiki::Store::setTopicRevisionTag |
private |
TWiki::setupLocale |
private |
TWiki::setupRegexes |
private |
TWiki::showError |
private |
TWiki::Search::spacedTopic |
TWiki::searchableTopic |
TWiki::Render::specificLink |
private |
TWiki::takeOutVerbatim |
$TWiki->{renderer}->takeOutBlocks |
TWiki::Attach::updateAttachment |
TWiki::UI::Upload::updateAttachment |
TWiki::Attach::updateProperties |
dead |
TWiki::Store::updateReferingPages |
$TWiki->{store}->updateReferringPages |
TWiki::Prefs::updateSetFromForm |
TWiki::Meta::updateSets |
TWiki::Form::upgradeCategoryItem |
private |
TWiki::userToWikiListInit |
See TWiki::User |
TWiki::Store::RcsLite::validTo |
dead |
TWiki::writeDebugTimes |
dead |
TWiki::UI::writeDebugTimes |
dead |
TWiki::Store::writeDebug |
$TWiki->writeDebug |
TWiki::Meta::writeEnd |
private |
TWiki::Store::writeLog |
$TWiki->writeLog |
TWiki::Meta::write |
private |
TWiki::Meta::writeStart |
private |