*
* This maintains WikiPage functions for backwards compatibility.
*
- * @todo move and rewrite code to an Action class
+ * @todo Move and rewrite code to an Action class
*
* See design.txt for an overview.
* Note: edit user interface and cache support functions have been
$content = $this->fetchContentObject();
- $this->mContent = ContentHandler::getContentText( $content ); #@todo: get rid of mContent everywhere!
+ // @todo Get rid of mContent everywhere!
+ $this->mContent = ContentHandler::getContentText( $content );
ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent', array( &$this, &$this->mContent ) );
wfProfileOut( __METHOD__ );
* Show a diff page according to current request variables. For use within
* Article::view() only, other callers should use the DifferenceEngine class.
*
- * @todo: make protected
+ * @todo Make protected
*/
public function showDiffPage() {
$request = $this->getContext()->getRequest();
if ( $ipblock ) {
# Check if the block is an autoblock and would exceed the user block
# if renewed. If so, do nothing, otherwise prolong the block time...
- if ( $ipblock->mAuto && // @TODO: why not compare $ipblock->mExpiry?
+ if ( $ipblock->mAuto && // @todo Why not compare $ipblock->mExpiry?
$this->mExpiry > Block::getAutoblockExpiry( $ipblock->mTimestamp )
) {
# Reset block timestamp to now and its expiry to
* of texts are also rendered as wikitext, it only means that links, magic words, etc will have
* the effect on the database they would have on a wikitext page.
*
- * @todo: On the long run, it would be nice to put categories etc into a separate structure,
+ * @todo On the long run, it would be nice to put categories etc into a separate structure,
* or at least parse only the contents of comments in the scripts.
*
* @since 1.21
}
}
- //@todo: add EditForm plugin interface and use it here!
+ // @todo add EditForm plugin interface and use it here!
// search for textarea1 and textares2, and allow EditForm to override all uses.
$wgOut->addHTML( Html::openElement( 'form', array( 'id' => self::EDITFORM_ID, 'name' => self::EDITFORM_ID,
'method' => 'post', 'action' => $this->getActionURL( $this->getContextTitle() ),
$content_model = strval( $row->rev_content_model );
} else {
// probably using $wgContentHandlerUseDB = false;
- // @todo: test!
+ // @todo test!
$title = Title::makeTitle( $row->page_namespace, $row->page_title );
$content_model = ContentHandler::getDefaultModelFor( $title );
}
$content_format = strval( $row->rev_content_format );
} else {
// probably using $wgContentHandlerUseDB = false;
- // @todo: test!
+ // @todo test!
$content_handler = ContentHandler::getForModelID( $content_model );
$content_format = $content_handler->getDefaultFormat();
}
*/
class LinksUpdate extends SqlDataUpdate {
- // @todo: make members protected, but make sure extensions don't break
+ // @todo make members protected, but make sure extensions don't break
public $mId, //!< Page ID of the article linked from
$mTitle, //!< Title object of the article linked from
# if we have a content object, use it to set the model and type
if ( !empty( $row['content'] ) ) {
- //@todo: when is that set? test with external store setup! check out insertOn() [dk]
+ // @todo when is that set? test with external store setup! check out insertOn() [dk]
if ( !empty( $row['text_id'] ) ) {
throw new MWException( "Text already stored in external store (id {$row['text_id']}), " .
"can't serialize content object" );
* to the $audience parameter
*
* @deprecated in 1.21, use getContent() instead
- * @todo: replace usage in core
+ * @todo Replace usage in core
* @return String
*/
public function getText( $audience = self::FOR_PUBLIC, User $user = null ) {
protected $users = 0;
protected $images = 0;
- // @TODO: deprecate this constructor
+ // @todo deprecate this constructor
function __construct( $views, $edits, $good, $pages = 0, $users = 0 ) {
$this->views = $views;
$this->edits = $edits;
$this->mOptions = array( 'FOR UPDATE' );
}
- // @todo: get connection only when it's needed? make sure that doesn't break anything, especially transactions!
+ // @todo get connection only when it's needed? make sure that doesn't break anything, especially transactions!
$this->mDb = wfGetDB( DB_MASTER );
$this->mWithTransaction = $withTransaction;
*
* @note: this does not perform a full wikitext to HTML conversion, it merely applies
* a message transformation.
- * @todo: figure out whether that is actually The Right Thing.
+ * @todo figure out whether that is actually The Right Thing.
*/
public function getHTML( $shortContext = false, $longContext = false ) {
$text = $this->getWikiText( $shortContext, $longContext );
* @return Bool
*/
public function isConversionTable() {
- //@todo: ConversionTable should become a separate content model.
+ // @todo ConversionTable should become a separate content model.
return $this->getNamespace() == NS_MEDIAWIKI &&
strpos( $this->getText(), 'Conversiontable/' ) === 0;
* (and only when) $wgActions[$action] === true. This allows subclasses
* to override the default behavior.
*
- * @todo: move this UI stuff somewhere else
+ * @todo Move this UI stuff somewhere else
*
* @return Array
*/
* @return String|false The text of the current revision
* @deprecated as of 1.21, getContent() should be used instead.
*/
- public function getText( $audience = Revision::FOR_PUBLIC, User $user = null ) { // @todo: deprecated, replace usage!
+ public function getText( $audience = Revision::FOR_PUBLIC, User $user = null ) { // @todo deprecated, replace usage!
ContentHandler::deprecated( __METHOD__, '1.21' );
$this->loadLastEdit();
}
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
- // @todo: move this logic to MessageCache
+ // @todo move this logic to MessageCache
if ( $this->exists() ) {
// NOTE: use transclusion text for messages.
*
* @return boolean whether sections are supported.
*
- * @todo: the skin should check this and not offer section functionality if sections are not supported.
- * @todo: the EditPage should check this and not offer section functionality if sections are not supported.
+ * @todo The skin should check this and not offer section functionality if sections are not supported.
+ * @todo The EditPage should check this and not offer section functionality if sections are not supported.
*/
public function supportsSections() {
return $this->getContentHandler()->supportsSections();
$options = $this->getContentHandler()->makeParserOptions( $context );
if ( $this->getTitle()->isConversionTable() ) {
- //@todo: ConversionTable should become a separate content model, so we don't need special cases like this one.
+ // @todo ConversionTable should become a separate content model, so we don't need special cases like this one.
$options->disableContentConversion();
}
DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, 1, $good, $total ) );
DeferredUpdates::addUpdate( new SearchUpdate( $id, $title, $content->getTextForSearchIndex() ) );
- // @TODO: let the search engine decide what to do with the content object
+ // @todo let the search engine decide what to do with the content object
// If this is another user's talk page, update newtalk.
// Don't do this if $options['changed'] = false (null-edits) nor if
* performs permissions checks on $user, then calls commitRollback()
* to do the dirty work
*
- * @todo: separate the business/permission stuff out from backend code
+ * @todo Separate the business/permission stuff out from backend code
*
* @param string $fromP Name of the user whose edits to rollback.
* @param string $summary Custom summary. Set to default summary if empty.
* Purge caches on page update etc
*
* @param $title Title object
- * @todo: verify that $title is always a Title object (and never false or null), add Title hint to parameter $title
+ * @todo Verify that $title is always a Title object (and never false or null), add Title hint to parameter $title
*/
public static function onArticleEdit( $title ) {
// Invalidate caches of articles which include this page
function doWork() {
global $wgUseFileCache;
- // @todo: several of the methods called on $this->page are not declared in Page, but present
+ // @todo several of the methods called on $this->page are not declared in Page, but present
// in WikiPage and delegated by Article.
$isCurrent = $this->revid === $this->page->getLatest();
if ( $this->getNumRows() > 1 ) {
$id = $rev->getId();
$radio = array( 'type' => 'radio', 'value' => $id );
- /** @todo: move title texts to javascript */
+ /** @todo Move title texts to javascript */
if ( $firstInList ) {
$first = Xml::element( 'input',
array_merge( $radio, array(
}
}
- // @todo: Add support for appending/prepending to the Content interface
+ // @todo Add support for appending/prepending to the Content interface
if ( !( $content instanceof TextContent ) ) {
$mode = $contentHandler->getModelID();
/* lazy loaded */
protected $mCached;
- /* @TODO: configurable? */
+ /* @todo configurable? */
const MISS_FACTOR = 15; // log 1 every MISS_FACTOR cache misses
const MISS_TTL_SEC = 3600; // how many seconds ago is "recent"
// gzip output to buffer as needed and set headers...
if ( $this->useGzip() ) {
- // @TODO: ugly wfClientAcceptsGzip() function - use context!
+ // @todo Ugly wfClientAcceptsGzip() function - use context!
if ( wfClientAcceptsGzip() ) {
header( 'Content-Encoding: gzip' );
return $compressed;
class ResourceFileCache extends FileCacheBase {
protected $mCacheWorthy;
- /* @TODO: configurable? */
+ /* @todo configurable? */
const MISS_THRESHOLD = 360; // 6/min * 60 min
/**
* building a full text search index. If no useful representation exists,
* this method returns an empty string.
*
- * @todo: test that this actually works
- * @todo: make sure this also works with LuceneSearch / WikiSearch
+ * @todo Test that this actually works
+ * @todo Make sure this also works with LuceneSearch / WikiSearch
*/
public function getTextForSearchIndex();
* @return string|false The wikitext to include when another page includes this
* content, or false if the content is not includable in a wikitext page.
*
- * @todo allow native handling, bypassing wikitext representation, like
- * for includable special pages.
- * @todo allow transclusion into other content models than Wikitext!
- * @todo used in WikiPage and MessageCache to get message text. Not so
- * nice. What should we use instead?!
+ * @todo Allow native handling, bypassing wikitext representation, like
+ * for includable special pages.
+ * @todo Allow transclusion into other content models than Wikitext!
+ * @todo Used in WikiPage and MessageCache to get message text. Not so
+ * nice. What should we use instead?!
*/
public function getWikitextForTransclusion();
*/
public function preSaveTransform( Title $title, User $user, ParserOptions $popts ) {
global $wgParser;
- // @todo: make pre-save transformation optional for script pages
+ // @todo Make pre-save transformation optional for script pages
$text = $this->getNativeData();
$pst = $wgParser->preSaveTransform( $text, $title, $user, $popts );
*/
public function preSaveTransform( Title $title, User $user, ParserOptions $popts ) {
global $wgParser;
- // @todo: make pre-save transformation optional for script pages
+ // @todo Make pre-save transformation optional for script pages
// See bug #32858
$text = $this->getNativeData();
$this->checkModelID( $that->getModel() );
- # @todo: could implement this in DifferenceEngine and just delegate here?
+ // @todo could implement this in DifferenceEngine and just delegate here?
if ( !$lang ) {
$lang = $wgContLang;
}
/**
- * @todo: check if it should be true like parent class
+ * @todo Check if it should be true like parent class
*
* @return bool
*/
if ( $this->mNewPage->isCssJsSubpage() || $this->mNewPage->isCssOrJsPage() ) {
// Stolen from Article::view --AG 2007-10-11
// Give hooks a chance to customise the output
- // @TODO: standardize this crap into one function
+ // @todo standardize this crap into one function
if ( ContentHandler::runLegacyHooks( 'ShowRawCssJs', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
// NOTE: deprecated hook, B/C only
// use the content object's own rendering
final public function __construct( FileBackendStore $backend, array $params ) {
$this->backend = $backend;
list( $required, $optional ) = $this->allowedParams();
- // @TODO: normalizeAnyStoragePaths() calls are overzealous, use a parameter list
+ // @todo normalizeAnyStoragePaths() calls are overzealous, use a parameter list
foreach ( $required as $name ) {
if ( isset( $params[$name] ) ) {
// Normalize paths so the paths to the same file have the same string
);
$upload = new UploadFromStash( $user );
- // @TODO: initialize() causes a GET, ideally we could frontload the antivirus
+ // @todo initialize() causes a GET, ideally we could frontload the antivirus
// checks and anything else to the stash stage (which includes concatenation and
// the local file is thus already there). That way, instead of GET+PUT, there could
// just be a COPY operation from the stash to the public zone.
$metadata = array( 'version' => self::SVG_METADATA_VERSION );
try {
$metadata += SVGMetadataExtractor::getMetadata( $filename );
- } catch ( MWException $e ) { // @TODO: SVG specific exceptions
+ } catch ( MWException $e ) { // @todo SVG specific exceptions
// File not found, broken, etc.
$metadata['error'] = array(
'message' => $e->getMessage(),
* @return Array
*/
public function getTestModuleNames( $framework = 'all' ) {
- /// @TODO: api siteinfo prop testmodulenames modulenames
+ /// @todo api siteinfo prop testmodulenames modulenames
if ( $framework == 'all' ) {
return $this->testModuleNames;
} elseif ( isset( $this->testModuleNames[$framework] ) && is_array( $this->testModuleNames[$framework] ) ) {
if ( !$this->fulltextSearchSupported() ) {
return;
}
- // @todo: find a method to do it in a single request,
+ // @todo find a method to do it in a single request,
// couldn't do it so far due to typelessness of FTS3 tables.
$dbw = wfGetDB( DB_MASTER );
'converttitles' => true,
'format' => 'json',
'titles' => $pageName,
- //@todo: options for maxlag and maxage
+ // @todo options for maxlag and maxage
// Note that maxlag will lead to a long delay before a reply is made,
// but that maxage can avoid the extreme delay. On the other hand
// maxage could be nice to use anyhow as it stops unnecessary requests.
$url = wfAppendQuery( $this->getFileUrl( 'api.php' ), $args );
// Go on call the external site
- //@todo: we need a good way to specify a timeout here.
+ // @todo we need a good way to specify a timeout here.
$ret = Http::get( $url );
}
public function onSuccess() {
if ( $this->getUser()->isAllowed( 'passwordreset' ) && $this->email != null ) {
- // @todo: Logging
+ // @todo Logging
if ( $this->result->isGood() ) {
$this->getOutput()->addWikiMsg( 'passwordreset-emailsent-capture' );
return;
}
- // @TODO: use FormOptions!
+ // @todo use FormOptions!
$defaults = array(
/* float */ 'days' => floatval( $user->getOption( 'watchlistdays' ) ), /* 3.0 or 0.5, watch further below */
/* bool */ 'hideMinor' => (int)$user->getBoolOption( 'watchlisthideminor' ),
wfProfileIn( __METHOD__ );
$repo = RepoGroup::singleton()->getLocalRepo();
if ( $repo->isVirtualUrl( $srcPath ) ) {
- // @TODO: just make uploads work with storage paths
+ // @todo just make uploads work with storage paths
// UploadFromStash loads files via virtual URLs
$tmpFile = $repo->getLocalCopy( $srcPath );
$tmpFile->bind( $this ); // keep alive with $this
$txt = $revision->getContent( Revision::RAW )->getNativeData();
}
- //@todo: in the future, use a specialized content model, perhaps based on json!
+ // @todo in the future, use a specialized content model, perhaps based on json!
}
}
}
** returns the help screen - so currently a lot of the tests aren't actually doing much
** because something wasn't right in the query.
**
- ** @todo: Incomplete / unfinished; Runs too fast (suggests not much testing going on).
+ ** @todo Incomplete / unfinished; Runs too fast (suggests not much testing going on).
*/
class api extends pageTest {
}
/**
- * @todo: do this for reals
+ * @todo Do this for real
* @param $key
* @param $prefix
* @param $fix
'scripts' => 'resources/mediawiki.special/mediawiki.special.undelete.js',
),
'mediawiki.special.upload' => array(
- // @TODO: merge in remainder of mediawiki.legacy.upload
+ // @todo merge in remainder of mediawiki.legacy.upload
'scripts' => 'resources/mediawiki.special/mediawiki.special.upload.js',
'messages' => array(
'widthheight',
actionPaths = mw.config.get( 'wgActionPaths' );
- // @todo: Does MediaWiki give action path or query param
+ // @todo Does MediaWiki give action path or query param
// precedence ? If the former, move this to the bottom
action = mw.util.getParamValue( 'action', url );
if ( action !== null ) {
$this->called['setUp'] = 1;
/*
- //@todo: global variables to restore for *every* test
+ // @todo global variables to restore for *every* test
array(
'wgLang',
'wgContLang',
}
// give up
- // @todo: Inside a test, we could skip the test as incomplete.
+ // @todo Inside a test, we could skip the test as incomplete.
// But frequently, this is used in fixture setup.
throw new MWException( "No namespace defaults to wikitext!" );
}
) );
}
- #@todo: test recursive, too!
+ // @todo test recursive, too!
protected function assertLinksUpdate( Title $title, ParserOutput $parserOutput, $table, $fields, $condition, array $expectedRows ) {
$update = new LinksUpdate( $title, $parserOutput );
}
/**
- * @todo: Emulate these edits somehow and extract
+ * @todo Emulate these edits somehow and extract
* raw edit summary from RecentChange object
* --
*/
$page = $this->createPage( 'RevisionStorageTest_testIsCurrent', 'Lorem Ipsum', CONTENT_MODEL_WIKITEXT );
$rev1 = $page->getRevision();
- # @todo: find out if this should be true
+ # @todo find out if this should be true
# $this->assertTrue( $rev1->isCurrent() );
$rev1x = Revision::newFromId( $rev1->getId() );
$page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ), 'second rev' );
$rev2 = $page->getRevision();
- # @todo: find out if this should be true
+ # @todo find out if this should be true
# $this->assertTrue( $rev2->isCurrent() );
$rev1x = Revision::newFromId( $rev1->getId() );
*/
public function testGetContentFormat() {
try {
- //@todo: change this to test failure on using a non-standard (but supported) format
+ // @todo change this to test failure on using a non-standard (but supported) format
// for a content model supported in the given location. As of 1.21, there are
// no alternative formats for any of the standard content models that could be
// used for this though.
if ( $this->isWikitextNS( NS_MAIN ) ) {
//NOTE: some content models don't allow moving
- //@todo: find a Wikitext namespace for testing
+ // @todo find a Wikitext namespace for testing
$this->setTitle( NS_MAIN );
$this->setUser( 'anon' );
public static function provideGetParserOutput() {
return array(
array( CONTENT_MODEL_WIKITEXT, "hello ''world''\n", "<p>hello <i>world</i></p>" ),
- // @todo: more...?
+ // @todo more...?
);
}
$opt = new ParserOptions();
$po = $page->getParserOutput( $opt, $page->getLatest() + 1234 );
- //@todo: would be neat to also test deleted revision
+ // @todo would be neat to also test deleted revision
$this->assertFalse( $po, "getParserOutput() shall return false for non-existing revisions." );
}
}
/**
- * @todo: test needs database!
+ * @todo Test needs database!
*/
/*
public function getRedirectChain() {
*/
/**
- * @todo: test needs database!
+ * @todo Test needs database!
*/
/*
public function getUltimateRedirectTarget() {
}
/**
- * @todo: test needs database! Should be done by a test class in the Database group.
+ * @todo Test needs database! Should be done by a test class in the Database group.
*/
/*
public function getRedirectChain() {
*/
/**
- * @todo: test needs database! Should be done by a test class in the Database group.
+ * @todo Test needs database! Should be done by a test class in the Database group.
*/
/*
public function getUltimateRedirectTarget() {
}
/**
- * @todo: test needs database! Should be done by a test class in the Database group.
+ * @todo Test needs database! Should be done by a test class in the Database group.
*/
/*
public function getRedirectChain() {
*/
/**
- * @todo: test needs database! Should be done by a test class in the Database group.
+ * @todo Test needs database! Should be done by a test class in the Database group.
*/
/*
public function getUltimateRedirectTarget() {
CONTENT_MODEL_WIKITEXT, "hello [[world test 21344]]\n",
array( 'LinksDeletionUpdate' => array() )
),
- // @todo: more...?
+ // @todo more...?
);
}
}
/**
* Runs upgrades of older databases and compares results with current schema
- * @todo: currently only checks list of tables
+ * @todo Currently only checks list of tables
*/
public function testUpgrades() {
global $IP, $wgVersion, $wgProfileToDatabase;
}
}
- // @TODO: testSecure
+ // @todo testSecure
public function testDoOperations() {
$this->backend = $this->singleBackend;
$this->$q->setTestingPrefix( 'unittests-' . wfRandomString( 32 ) );
}
} catch ( MWException $e ) {
- }; // unsupported? (@TODO: what if it was another error?)
+ // unsupported?
+ // @todo What if it was another error?
+ };
}
}
if ( !$this->isWikitextNS( NS_MAIN ) ) {
// parser tests frequently assume that the main namespace contains wikitext.
- // @todo: When setting up pages, force the content model. Only skip if
+ // @todo When setting up pages, force the content model. Only skip if
// $wgtContentModelUseDB is false.
$this->markTestSkipped( "Main namespace does not support wikitext,"
. "skipping parser test: $desc" );
}
if ( !$this->isWikitextNS( NS_MAIN ) ) {
- //@todo: cover the case of non-wikitext content in the main namespace
+ // @todo cover the case of non-wikitext content in the main namespace
return;
}
// Page from non-default namespace
if ( $ns === NS_TALK ) {
- //@todo: work around this.
+ // @todo work around this.
throw new MWException( "The default wikitext namespace is the talk namespace. "
. " We can't currently deal with that." );
}
$this->talk_namespace = NS_TALK;
if ( $this->namespace === $this->talk_namespace ) {
- //@todo: work around this.
+ // @todo work around this.
throw new MWException( "The default wikitext namespace is the talk namespace. "
. " We can't currently deal with that." );
}
$img = new UnregisteredLocalFile( null, $repo,
# Temp files are hashed based on the name without the timestamp.
# The thumbnails will be hashed based on the entire name however.
- # @TODO: fix this convention to actually be reasonable.
+ # @todo fix this convention to actually be reasonable.
$repo->getZonePath( 'public' ) . '/' . $repo->getTempHashPath( $fileName ) . $fileName
);
} elseif ( $isOld ) {