r23766 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23765‎ | r23766 | r23767 >
Date:03:41, 6 July 2007
Author:robchurch
Status:old
Tags:
Comment:
* Introduce wfScript() wrapper around script path generation
* Honour script extension in ApiFormatBase
* Fix up some uses of short open tags, which are discouraged, in ApiFormatBase
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/api/ApiFormatBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2278,4 +2278,14 @@
22792279 }
22802280 }
22812281
2282 -
 2282+/**
 2283+ * Get the path to a specified script file, respecting file
 2284+ * extensions; this is a wrapper around $wgScriptExtension etc.
 2285+ *
 2286+ * @param string $script Script filename, sans extension
 2287+ * @return string
 2288+ */
 2289+function wfScript( $script = 'index' ) {
 2290+ global $wgScriptPath, $wgScriptExtension;
 2291+ return "{$wgScriptPath}/{$script}{$wgScriptExtension}";
 2292+}
\ No newline at end of file
Index: trunk/phase3/includes/api/ApiFormatBase.php
@@ -85,6 +85,7 @@
8686 function initPrinter($isError) {
8787 $isHtml = $this->getIsHtml();
8888 $mime = $isHtml ? 'text/html' : $this->getMimeType();
 89+ $script = wfScript( 'api' );
8990
9091 // Some printers (ex. Feed) do their own header settings,
9192 // in which case $mime will be set to null
@@ -104,14 +105,14 @@
105106 <?php
106107
107108
108 - if (!$isError) {
 109+ if( !$isError ) {
109110 ?>
110111 <br/>
111112 <small>
112 -You are looking at the HTML representation of the <?=$this->mFormat?> format.<br/>
 113+You are looking at the HTML representation of the <?php echo( $this->mFormat ); ?> format.<br/>
113114 HTML is good for debugging, but probably is not suitable for your application.<br/>
114115 See <a href='http://www.mediawiki.org/wiki/API'>complete documentation</a>, or
115 -<a href='api.php'>API help</a> for more information.
 116+<a href='<?php echo( $script ); ?>'>API help</a> for more information.
116117 </small>
117118 <?php
118119

Follow-up revisions

RevisionCommit summaryAuthorDate
r23912Merged revisions 23662-23909 via svnmerge from...david18:11, 9 July 2007

Status & tagging log