r62354 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62353‎ | r62354 | r62355 >
Date:06:44, 12 February 2010
Author:mah
Status:resolved (Comments)
Tags:
Comment:
various eol whitespace now instead of when someone needs to do CR
Modified paths:
  • /trunk/phase3/api.php (modified) (history)
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiFormatBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiFormatJson.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQuery.php (modified) (history)
  • /trunk/phase3/includes/api/ApiResult.php (modified) (history)
  • /trunk/phase3/includes/filerepo/ArchivedFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/ArchivedFile.php
@@ -49,18 +49,18 @@
5050 $this->deleted = 0;
5151 $this->dataLoaded = false;
5252 $this->exists = false;
53 -
 53+
5454 if( is_object($title) ) {
5555 $this->title = $title;
5656 $this->name = $title->getDBkey();
5757 }
58 -
 58+
5959 if ($id)
6060 $this->id = $id;
61 -
 61+
6262 if ($key)
6363 $this->key = $key;
64 -
 64+
6565 if (!$id && !$key && !is_object($title))
6666 throw new MWException( "No specifications provided to ArchivedFile constructor." );
6767 }
@@ -74,19 +74,19 @@
7575 return true;
7676 }
7777 $conds = array();
78 -
 78+
7979 if( $this->id > 0 )
8080 $conds['fa_id'] = $this->id;
8181 if( $this->key ) {
82 - $conds['fa_storage_group'] = $this->group;
 82+ $conds['fa_storage_group'] = $this->group;
8383 $conds['fa_storage_key'] = $this->key;
8484 }
8585 if( $this->title )
8686 $conds['fa_name'] = $this->title->getDBkey();
87 -
 87+
8888 if( !count($conds))
8989 throw new MWException( "No specific information for retrieving archived file" );
90 -
 90+
9191 if( !$this->title || $this->title->getNamespace() == NS_FILE ) {
9292 $dbr = wfGetDB( DB_SLAVE );
9393 $res = $dbr->select( 'filearchive',
@@ -195,7 +195,7 @@
196196 $this->load();
197197 return $this->id;
198198 }
199 -
 199+
200200 public function exists() {
201201 $this->load();
202202 return $this->exists;
Index: trunk/phase3/includes/api/ApiResult.php
@@ -91,7 +91,7 @@
9292 public function getData() {
9393 return $this->mData;
9494 }
95 -
 95+
9696 /**
9797 * Get the 'real' size of a result item. This means the strlen() of the item,
9898 * or the sum of the strlen()s of the elements if the item is an array.
@@ -116,7 +116,7 @@
117117 public function getSize() {
118118 return $this->mSize;
119119 }
120 -
 120+
121121 /**
122122 * Disable size checking in addValue(). Don't use this unless you
123123 * REALLY know what you're doing. Values added while size checking
@@ -125,7 +125,7 @@
126126 public function disableSizeCheck() {
127127 $this->mCheckingSize = false;
128128 }
129 -
 129+
130130 /**
131131 * Re-enable size checking in addValue()
132132 */
Index: trunk/phase3/includes/api/ApiFormatBase.php
@@ -101,11 +101,11 @@
102102 public function getIsHtml() {
103103 return $this->mIsHtml;
104104 }
105 -
 105+
106106 /**
107107 * Whether this formatter can format the help message in a nice way.
108108 * By default, this returns the same as getIsHtml().
109 - * When action=help is set explicitly, the help will always be shown
 109+ * When action=help is set explicitly, the help will always be shown
110110 * @return bool
111111 */
112112 public function getWantsHelp() {
@@ -189,6 +189,7 @@
190190 * @param $text string
191191 */
192192 public function printText( $text ) {
 193+ error_log($text);
193194 if ( $this->mBufferResult ) {
194195 $this->mBuffer = $text;
195196 } elseif ( $this->getIsHtml() ) {
@@ -205,7 +206,7 @@
206207 echo $text;
207208 }
208209 }
209 -
 210+
210211 /**
211212 * Get the contents of the buffer.
212213 */
@@ -235,7 +236,7 @@
236237 */
237238 protected function formatHTML( $text ) {
238239 global $wgUrlProtocols;
239 -
 240+
240241 // Escape everything first for full coverage
241242 $text = htmlspecialchars( $text );
242243
Index: trunk/phase3/includes/api/ApiQuery.php
@@ -171,7 +171,7 @@
172172 function getModules() {
173173 return array_merge( $this->mQueryPropModules, $this->mQueryListModules, $this->mQueryMetaModules );
174174 }
175 -
 175+
176176 public function getCustomPrinter() {
177177 // If &exportnowrap is set, use the raw formatter
178178 if ( $this->getParameter( 'export' ) &&
Index: trunk/phase3/includes/api/ApiFormatJson.php
@@ -42,7 +42,7 @@
4343
4444 public function getMimeType() {
4545 $params = $this->extractRequestParams();
46 - // callback:
 46+ // callback:
4747 if ( $params['callback'] ) {
4848 return 'text/javascript';
4949 }
@@ -52,7 +52,7 @@
5353 public function getNeedsRawData() {
5454 return $this->mIsRaw;
5555 }
56 -
 56+
5757 public function getWantsHelp() {
5858 // Help is always ugly in JSON
5959 return false;
Index: trunk/phase3/includes/api/ApiBase.php
@@ -971,23 +971,23 @@
972972 */
973973 public function getPossibleErrors() {
974974 $ret = array();
975 -
 975+
976976 if ( $this->mustBePosted() ) {
977977 $ret[] = array ( 'mustbeposted', $this->getModuleName() );
978978 }
979 -
 979+
980980 if ( $this->isReadMode() ) {
981981 $ret[] = array ( 'readrequired' );
982982 }
983 -
 983+
984984 if ( $this->isWriteMode() ) {
985985 $ret[] = array ( 'writerequired' );
986986 $ret[] = array ( 'writedisabled' );
987987 }
988 -
 988+
989989 return $ret;
990990 }
991 -
 991+
992992 /**
993993 * Parses a list of errors into a standardised format
994994 * @param $errors array List of errors. Items can be in the for array( key, param1, param2, ... ) or array( 'code' => ..., 'info' => ... )
@@ -995,9 +995,9 @@
996996 */
997997 public function parseErrors( $errors ) {
998998 $ret = array();
999 -
 999+
10001000 foreach ( $errors as $row )
1001 - {
 1001+ {
10021002 if ( isset( $row['code'] ) && isset( $row['info'] ) ) {
10031003 $ret[] = $row;
10041004 }
Index: trunk/phase3/api.php
@@ -23,8 +23,8 @@
2424 * @file
2525 */
2626
27 -/**
28 - * This file is the entry point for all API queries. It begins by checking
 27+/**
 28+ * This file is the entry point for all API queries. It begins by checking
2929 * whether the API is enabled on this wiki; if not, it informs the user that
3030 * s/he should set $wgEnableAPI to true and exits. Otherwise, it constructs
3131 * a new ApiMain using the parameter passed to it as an argument in the URL

Follow-up revisions

RevisionCommit summaryAuthorDate
r62367Remove debug logging introduced in r62354siebrand14:09, 12 February 2010

Comments

#Comment by Catrope (talk | contribs)   13:15, 12 February 2010
+		error_log($text);

Oops? This seems to cause http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62353#c5742

#Comment by Siebrand (talk | contribs)   14:10, 12 February 2010

Fixed in r62367

Status & tagging log