Go to the documentation of this file.
41 $purge = $wgRequest->getVal(
'action' ) ===
'purge';
42 if ( $purge &&
$wgUser->isAllowed(
'purge' ) ) {
58 $wgOut->addWikiMsg(
'feed-unavailable' );
62 if ( !isset( $wgFeedClasses[
$type] ) ) {
63 $wgOut->addWikiMsg(
'feed-invalid' );
80 if ( $row->rc_type ==
RC_LOG ) {
85 $row->rc_last_oldid, $row->rc_this_oldid,
88 ?
wfMessage(
'rev-deleted-comment' )->escaped()
110 $completeText =
'<p>' . implode(
' ',
120 $accErrors =
$title->getUserPermissionsErrors(
'read', $anon,
true );
124 if (
$title->getNamespace() < 0 || $accErrors || !$newid ) {
126 return $completeText;
132 #$diffText = $de->getDiff( wfMessage( 'revisionasof',
133 # $wgLang->timeanddate( $timestamp ),
134 # $wgLang->date( $timestamp ),
135 # $wgLang->time( $timestamp ) )->text(),
136 # wfMessage( 'currentrev' )->text() );
140 if ( $wgFeedDiffCutoff > 0 ) {
147 $context->setTitle(
$title );
149 $contentHandler =
$rev->getContentHandler();
150 $de = $contentHandler->createDifferenceEngine( $context, $oldid, $newid );
151 $diffText = $de->getDiff(
160 if ( $wgFeedDiffCutoff <= 0 || ( strlen( $diffText ) > $wgFeedDiffCutoff ) ) {
163 } elseif ( $diffText ===
false ) {
165 $diffText =
"<p>Can't load revision $newid</p>";
174 if ( $wgFeedDiffCutoff <= 0 || is_null(
$rev ) ) {
177 $newContent =
$rev->getContent();
182 $text = $newContent->getNativeData();
184 if ( $wgFeedDiffCutoff <= 0 || strlen( $text ) > $wgFeedDiffCutoff ) {
187 $html = nl2br( htmlspecialchars( $text ) );
197 if (
$html ===
null ) {
203 $diffText =
'<p><b>' .
wfMessage(
'newpage' )->text() .
'</b></p>' .
204 '<div>' .
$html .
'</div>';
207 $completeText .= $diffText;
210 return $completeText;
223 $queryParameters =
array(
'diff' => $newid );
224 if ( $oldid !=
null ) {
225 $queryParameters[
'oldid'] = $oldid;
227 $diffUrl =
$title->getFullURL( $queryParameters );
245 'diff' =>
'background-color: white; color:black;',
246 'diff-otitle' =>
'background-color: white; color:black; text-align: center;',
247 'diff-ntitle' =>
'background-color: white; color:black; text-align: center;',
248 'diff-addedline' =>
'color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;',
249 'diff-deletedline' =>
'color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;',
250 'diff-context' =>
'background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;',
251 'diffchange' =>
'font-weight: bold; text-decoration: none;',
254 foreach ( $styles
as $class => $style ) {
255 $text = preg_replace(
"/(<[^>]+)class=(['\"])$class\\2([^>]*>)/",
256 "\\1style=\"$style\"\\3", $text );
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
static cleanUp( $string)
The ultimate convenience function! Clean up invalid UTF-8 sequences, and convert to normal form C,...
static formatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiontext='')
Really format a diff for the newsfeed.
wfProfileIn( $functionname)
Begin profiling of a function.
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest to get request data $messageMemc
static getForTitle(Title $title)
Returns the appropriate ContentHandler singleton for the given title.
static formatComment( $comment, $title=null, $local=false)
This function is called by all recent changes variants, by the page history, and by the user contribu...
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
wfProfileOut( $functionname='missing')
Stop profiling of a function.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
static checkPurge( $timekey, $key)
Check whether feed's cache should be cleared; for changes feeds If the feed should be purged; $timeke...
when a variable name is used in a it is silently declared as a new masking the global
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
presenting them properly to the user as errors is done by the caller $title
Helper functions for feeds.
static getDiffLink(Title $title, $newid, $oldid=null)
Generates a diff link.
static getMain()
Static methods.
Content object implementation for representing flat text.
static formatDiff( $row)
Format a diff for the newsfeed.
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
Represents a title within MediaWiki.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
static applyDiffStyle( $text)
Hacky application of diff styles for the feeds.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static checkFeedOutput( $type)
Check whether feeds can be used and that $type is a valid feed type.