Index: trunk/phase3/includes/filerepo/ArchivedFile.php |
— | — | @@ -49,18 +49,18 @@ |
50 | 50 | $this->deleted = 0; |
51 | 51 | $this->dataLoaded = false; |
52 | 52 | $this->exists = false; |
53 | | - |
| 53 | + |
54 | 54 | if( is_object($title) ) { |
55 | 55 | $this->title = $title; |
56 | 56 | $this->name = $title->getDBkey(); |
57 | 57 | } |
58 | | - |
| 58 | + |
59 | 59 | if ($id) |
60 | 60 | $this->id = $id; |
61 | | - |
| 61 | + |
62 | 62 | if ($key) |
63 | 63 | $this->key = $key; |
64 | | - |
| 64 | + |
65 | 65 | if (!$id && !$key && !is_object($title)) |
66 | 66 | throw new MWException( "No specifications provided to ArchivedFile constructor." ); |
67 | 67 | } |
— | — | @@ -74,19 +74,19 @@ |
75 | 75 | return true; |
76 | 76 | } |
77 | 77 | $conds = array(); |
78 | | - |
| 78 | + |
79 | 79 | if( $this->id > 0 ) |
80 | 80 | $conds['fa_id'] = $this->id; |
81 | 81 | if( $this->key ) { |
82 | | - $conds['fa_storage_group'] = $this->group; |
| 82 | + $conds['fa_storage_group'] = $this->group; |
83 | 83 | $conds['fa_storage_key'] = $this->key; |
84 | 84 | } |
85 | 85 | if( $this->title ) |
86 | 86 | $conds['fa_name'] = $this->title->getDBkey(); |
87 | | - |
| 87 | + |
88 | 88 | if( !count($conds)) |
89 | 89 | throw new MWException( "No specific information for retrieving archived file" ); |
90 | | - |
| 90 | + |
91 | 91 | if( !$this->title || $this->title->getNamespace() == NS_FILE ) { |
92 | 92 | $dbr = wfGetDB( DB_SLAVE ); |
93 | 93 | $res = $dbr->select( 'filearchive', |
— | — | @@ -195,7 +195,7 @@ |
196 | 196 | $this->load(); |
197 | 197 | return $this->id; |
198 | 198 | } |
199 | | - |
| 199 | + |
200 | 200 | public function exists() { |
201 | 201 | $this->load(); |
202 | 202 | return $this->exists; |
Index: trunk/phase3/includes/api/ApiResult.php |
— | — | @@ -91,7 +91,7 @@ |
92 | 92 | public function getData() { |
93 | 93 | return $this->mData; |
94 | 94 | } |
95 | | - |
| 95 | + |
96 | 96 | /** |
97 | 97 | * Get the 'real' size of a result item. This means the strlen() of the item, |
98 | 98 | * or the sum of the strlen()s of the elements if the item is an array. |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | public function getSize() { |
118 | 118 | return $this->mSize; |
119 | 119 | } |
120 | | - |
| 120 | + |
121 | 121 | /** |
122 | 122 | * Disable size checking in addValue(). Don't use this unless you |
123 | 123 | * REALLY know what you're doing. Values added while size checking |
— | — | @@ -125,7 +125,7 @@ |
126 | 126 | public function disableSizeCheck() { |
127 | 127 | $this->mCheckingSize = false; |
128 | 128 | } |
129 | | - |
| 129 | + |
130 | 130 | /** |
131 | 131 | * Re-enable size checking in addValue() |
132 | 132 | */ |
Index: trunk/phase3/includes/api/ApiFormatBase.php |
— | — | @@ -101,11 +101,11 @@ |
102 | 102 | public function getIsHtml() { |
103 | 103 | return $this->mIsHtml; |
104 | 104 | } |
105 | | - |
| 105 | + |
106 | 106 | /** |
107 | 107 | * Whether this formatter can format the help message in a nice way. |
108 | 108 | * 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 |
110 | 110 | * @return bool |
111 | 111 | */ |
112 | 112 | public function getWantsHelp() { |
— | — | @@ -189,6 +189,7 @@ |
190 | 190 | * @param $text string |
191 | 191 | */ |
192 | 192 | public function printText( $text ) { |
| 193 | + error_log($text); |
193 | 194 | if ( $this->mBufferResult ) { |
194 | 195 | $this->mBuffer = $text; |
195 | 196 | } elseif ( $this->getIsHtml() ) { |
— | — | @@ -205,7 +206,7 @@ |
206 | 207 | echo $text; |
207 | 208 | } |
208 | 209 | } |
209 | | - |
| 210 | + |
210 | 211 | /** |
211 | 212 | * Get the contents of the buffer. |
212 | 213 | */ |
— | — | @@ -235,7 +236,7 @@ |
236 | 237 | */ |
237 | 238 | protected function formatHTML( $text ) { |
238 | 239 | global $wgUrlProtocols; |
239 | | - |
| 240 | + |
240 | 241 | // Escape everything first for full coverage |
241 | 242 | $text = htmlspecialchars( $text ); |
242 | 243 | |
Index: trunk/phase3/includes/api/ApiQuery.php |
— | — | @@ -171,7 +171,7 @@ |
172 | 172 | function getModules() { |
173 | 173 | return array_merge( $this->mQueryPropModules, $this->mQueryListModules, $this->mQueryMetaModules ); |
174 | 174 | } |
175 | | - |
| 175 | + |
176 | 176 | public function getCustomPrinter() { |
177 | 177 | // If &exportnowrap is set, use the raw formatter |
178 | 178 | if ( $this->getParameter( 'export' ) && |
Index: trunk/phase3/includes/api/ApiFormatJson.php |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | |
44 | 44 | public function getMimeType() { |
45 | 45 | $params = $this->extractRequestParams(); |
46 | | - // callback: |
| 46 | + // callback: |
47 | 47 | if ( $params['callback'] ) { |
48 | 48 | return 'text/javascript'; |
49 | 49 | } |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | public function getNeedsRawData() { |
54 | 54 | return $this->mIsRaw; |
55 | 55 | } |
56 | | - |
| 56 | + |
57 | 57 | public function getWantsHelp() { |
58 | 58 | // Help is always ugly in JSON |
59 | 59 | return false; |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -971,23 +971,23 @@ |
972 | 972 | */ |
973 | 973 | public function getPossibleErrors() { |
974 | 974 | $ret = array(); |
975 | | - |
| 975 | + |
976 | 976 | if ( $this->mustBePosted() ) { |
977 | 977 | $ret[] = array ( 'mustbeposted', $this->getModuleName() ); |
978 | 978 | } |
979 | | - |
| 979 | + |
980 | 980 | if ( $this->isReadMode() ) { |
981 | 981 | $ret[] = array ( 'readrequired' ); |
982 | 982 | } |
983 | | - |
| 983 | + |
984 | 984 | if ( $this->isWriteMode() ) { |
985 | 985 | $ret[] = array ( 'writerequired' ); |
986 | 986 | $ret[] = array ( 'writedisabled' ); |
987 | 987 | } |
988 | | - |
| 988 | + |
989 | 989 | return $ret; |
990 | 990 | } |
991 | | - |
| 991 | + |
992 | 992 | /** |
993 | 993 | * Parses a list of errors into a standardised format |
994 | 994 | * @param $errors array List of errors. Items can be in the for array( key, param1, param2, ... ) or array( 'code' => ..., 'info' => ... ) |
— | — | @@ -995,9 +995,9 @@ |
996 | 996 | */ |
997 | 997 | public function parseErrors( $errors ) { |
998 | 998 | $ret = array(); |
999 | | - |
| 999 | + |
1000 | 1000 | foreach ( $errors as $row ) |
1001 | | - { |
| 1001 | + { |
1002 | 1002 | if ( isset( $row['code'] ) && isset( $row['info'] ) ) { |
1003 | 1003 | $ret[] = $row; |
1004 | 1004 | } |
Index: trunk/phase3/api.php |
— | — | @@ -23,8 +23,8 @@ |
24 | 24 | * @file |
25 | 25 | */ |
26 | 26 | |
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 |
29 | 29 | * whether the API is enabled on this wiki; if not, it informs the user that |
30 | 30 | * s/he should set $wgEnableAPI to true and exits. Otherwise, it constructs |
31 | 31 | * a new ApiMain using the parameter passed to it as an argument in the URL |