Comment cleanup
authordaniel <daniel.kinzler@wikimedia.de>
Thu, 13 Sep 2012 14:21:54 +0000 (16:21 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Thu, 13 Sep 2012 14:21:54 +0000 (16:21 +0200)
Change-Id: Ie41f680782502f2b70c1bdbf18da3ee790d48fe7

includes/Article.php
includes/Content.php
includes/ContentHandler.php
includes/Title.php
includes/WikiPage.php
includes/api/ApiEditPage.php
includes/cache/MessageCache.php
includes/search/SearchEngine.php

index a1d119f..555849c 100644 (file)
@@ -424,7 +424,7 @@ class Article extends Page {
 
                # Pre-fill content with error message so that if something
                # fails we'll have something telling us what we intended.
-               // @todo: this isn't page content but a UI message. horrible.
+               //XXX: this isn't page content but a UI message. horrible.
                $this->mContentObject = new MessageContent( 'missing-revision', array( $oldid ), array() ) ;
 
                if ( $oldid ) {
index 3bce48e..da3b8ff 100644 (file)
@@ -458,24 +458,13 @@ interface Content {
         */
        public function matchMagicWord( MagicWord $word );
 
-       # TODO: handle ImagePage and CategoryPage
-       # TODO: make sure we cover lucene search / wikisearch.
-       # TODO: make sure ReplaceTemplates still works
-       # FUTURE: nice&sane integration of GeSHi syntax highlighting
+       # TODO: ImagePage and CategoryPage interfere with per-content action handlers
+       # TODO: make sure WikiSearch extension still works
+       # TODO: make sure ReplaceTemplates extension still works
+       # TODO: nice&sane integration of GeSHi syntax highlighting
        #   [11:59] <vvv> Hooks are ugly; make CodeHighlighter interface and a 
        #   config to set the class which handles syntax highlighting
        #   [12:00] <vvv> And default it to a DummyHighlighter
-
-       # TODO: make sure we cover the external editor interface (does anyone actually use that?!)
-
-       # TODO: tie into API to provide contentModel for Revisions
-       # TODO: tie into API to provide serialized version and contentFormat for Revisions
-       # TODO: tie into API edit interface
-       # FUTURE: make EditForm plugin for EditPage
-
-       # FUTURE: special type for redirects?!
-       # FUTURE: MultipartMultipart < WikipageContent (Main + Links + X)
-       # FUTURE: LinksContent < LanguageLinksContent, CategoriesContent
 }
 
 
index 584a6ad..bf1349a 100644 (file)
@@ -551,9 +551,7 @@ abstract class ContentHandler {
         *
         * This default implementation just returns $wgContLang (except for pages in the MediaWiki namespace)
         *
-        * Note that a page's language must be permanent and cacheable, that is, it must not depend
-        * on user preferences, request parameters or session state. The only exception is pages in the
-        * MediaWiki namespace.
+        * Note that the pages language is not cacheable, since it may in some cases depend on user settings.
         *
         * Also note that the page language may or may not depend on the actual content of the page,
         * that is, this method may load the content in order to determine the language.
@@ -563,7 +561,7 @@ abstract class ContentHandler {
         * @param Title        $title the page to determine the language for.
         * @param Content|null $content the page's content, if you have it handy, to avoid reloading it.
         *
-        * @return Language the page's language code
+        * @return Language the page's language
         */
        public function getPageLanguage( Title $title, Content $content = null ) {
                global $wgContLang;
@@ -595,7 +593,7 @@ abstract class ContentHandler {
         * @param Title        $title the page to determine the language for.
         * @param Content|null $content the page's content, if you have it handy, to avoid reloading it.
         *
-        * @return Language the page's language code for viewing
+        * @return Language the page's language for viewing
         */
        public function getPageViewLanguage( Title $title, Content $content = null ) {
                $pageLang = $this->getPageLanguage( $title, $content );
index 8caa557..e6e45a8 100644 (file)
@@ -4591,7 +4591,7 @@ class Title {
                        return $wgLang;
                }
 
-               //TODO: use the LinkCache to cache this!
+               //TODO: use the LinkCache to cache this! Note that this may depend on user settings, so the cache should be only per-request.
                //NOTE: ContentHandler::getPageLanguage() may need to load the content to determine the page language!
                $contentHandler = ContentHandler::getForTitle( $this );
                $pageLang = $contentHandler->getPageLanguage( $this );
@@ -4623,7 +4623,7 @@ class Title {
                        return $wgLang;
                }
 
-               //NOTE: can't be cached, depends on user settings
+               //NOTE: can't be cached persistently, depends on user settings
                //NOTE: ContentHandler::getPageViewLanguage() may need to load the content to determine the page language!
                $contentHandler = ContentHandler::getForTitle( $this );
                $pageLang = $contentHandler->getPageViewLanguage( $this );
index 6c7b335..38a1cbd 100644 (file)
@@ -1548,7 +1548,6 @@ class WikiPage extends Page implements IDBAccessObject {
         *  Compatibility note: this function previously returned a boolean value indicating success/failure
         *
         * @deprecated since 1.WD: use doEditContent() instead.
-        * @todo: use doEditContent() instead everywhere
         */
        public function doEdit( $text, $summary, $flags = 0, $baseRevId = false, $user = null ) {
                wfDeprecated( __METHOD__, '1.WD' );
@@ -1937,7 +1936,7 @@ class WikiPage extends Page implements IDBAccessObject {
        public function prepareContentForEdit( Content $content, $revid = null, User $user = null, $serialization_format = null ) {
                global $wgParser, $wgContLang, $wgUser;
                $user = is_null( $user ) ? $wgUser : $user;
-               // @TODO fixme: check $user->getId() here???
+               //XXX: check $user->getId() here???
 
                if ( $this->mPreparedEdit
                        && $this->mPreparedEdit->newContent
index dbcf29c..506a546 100644 (file)
@@ -128,10 +128,9 @@ class ApiEditPage extends ApiBase {
                {
                        $content = $pageObj->getContent();
 
+                       // @todo: Add support for appending/prepending to the Content interface
+
                        if ( !( $content instanceof TextContent ) ) {
-                               // @todo: ContentHandler should have an isFlat() method or some such
-                               // @todo: XXX: or perhaps there should be Content::append(), Content::prepend()
-                               // @todo: ...and Content::supportsConcatenation()
                                $mode = $contentHandler->getModelID();
                                $this->dieUsage( "Can't append to pages using content model $mode", 'appendnotsupported' );
                        }
@@ -301,7 +300,6 @@ class ApiEditPage extends ApiBase {
                $ep = new EditPage( $articleObject );
 
                // allow editing of non-textual content.
-               //@todo: let the ContentHandler decide whether direct editing is OK
                $ep->allowNonTextContent = true;
 
                $ep->setContextTitle( $titleObj );
index 41058d3..3ae26d0 100644 (file)
@@ -776,7 +776,7 @@ class MessageCache {
                                wfDebugLog( 'MessageCache', __METHOD__ . ": failed to load message page text for {$title} ($code)" );
                                $message = null; // no negative caching
                        } else {
-                               #XXX: is this the reight way to turn a Content object into a mesage?
+                               #XXX: Is this the right way to turn a Content object into a message?
                                $message = $content->getWikitextForTransclusion();
 
                                if ( $message === false || $message === null ) {
index c17f8c2..acff026 100644 (file)
@@ -805,7 +805,8 @@ class SearchResult {
        protected function initText() {
                if ( !isset( $this->mText ) ) {
                        if ( $this->mRevision != null ) {
-                               //TODO: don't use the text, but the content object!
+                               //TODO: if we could plug in some code that knows about special content models *and* about
+                               //      special features of the search engine, the search could benefit.
                                $content = $this->mRevision->getContent();
                                $this->mText = $content->getTextForSearchIndex();
                        } else { // TODO: can we fetch raw wikitext for commons images?