Index: trunk/phase3/includes/db/DatabaseError.php |
— | — | @@ -21,6 +21,10 @@ |
22 | 22 | parent::__construct( $error ); |
23 | 23 | } |
24 | 24 | |
| 25 | + /** |
| 26 | + * @param $html string |
| 27 | + * @return string |
| 28 | + */ |
25 | 29 | protected function getContentMessage( $html ) { |
26 | 30 | if ( $html ) { |
27 | 31 | return nl2br( htmlspecialchars( $this->getMessage() ) ); |
— | — | @@ -29,6 +33,9 @@ |
30 | 34 | } |
31 | 35 | } |
32 | 36 | |
| 37 | + /** |
| 38 | + * @return string |
| 39 | + */ |
33 | 40 | function getText() { |
34 | 41 | global $wgShowDBErrorBacktrace; |
35 | 42 | |
— | — | @@ -41,6 +48,9 @@ |
42 | 49 | return $s; |
43 | 50 | } |
44 | 51 | |
| 52 | + /** |
| 53 | + * @return string |
| 54 | + */ |
45 | 55 | function getHTML() { |
46 | 56 | global $wgShowDBErrorBacktrace; |
47 | 57 | |
— | — | @@ -95,11 +105,17 @@ |
96 | 106 | return false; |
97 | 107 | } |
98 | 108 | |
| 109 | + /** |
| 110 | + * @return string |
| 111 | + */ |
99 | 112 | function getPageTitle() { |
100 | 113 | global $wgSitename; |
101 | 114 | return htmlspecialchars( $this->msg( 'dberr-header', "$wgSitename has a problem" ) ); |
102 | 115 | } |
103 | 116 | |
| 117 | + /** |
| 118 | + * @return string |
| 119 | + */ |
104 | 120 | function getHTML() { |
105 | 121 | global $wgShowDBErrorBacktrace; |
106 | 122 | |
— | — | @@ -158,6 +174,9 @@ |
159 | 175 | return parent::reportHTML(); |
160 | 176 | } |
161 | 177 | |
| 178 | + /** |
| 179 | + * @return string |
| 180 | + */ |
162 | 181 | function searchForm() { |
163 | 182 | global $wgSitename, $wgServer; |
164 | 183 | |
— | — | @@ -192,6 +211,9 @@ |
193 | 212 | return $trygoogle; |
194 | 213 | } |
195 | 214 | |
| 215 | + /** |
| 216 | + * @return string |
| 217 | + */ |
196 | 218 | private function fileCachedPage() { |
197 | 219 | global $wgTitle, $wgOut; |
198 | 220 | |
— | — | @@ -237,6 +259,10 @@ |
238 | 260 | $this->fname = $fname; |
239 | 261 | } |
240 | 262 | |
| 263 | + /** |
| 264 | + * @param $html string |
| 265 | + * @return string |
| 266 | + */ |
241 | 267 | function getContentMessage( $html ) { |
242 | 268 | if ( $this->useMessageCache() ) { |
243 | 269 | $msg = $html ? 'dberrortext' : 'dberrortextcl'; |
— | — | @@ -251,6 +277,9 @@ |
252 | 278 | } |
253 | 279 | } |
254 | 280 | |
| 281 | + /** |
| 282 | + * @return String |
| 283 | + */ |
255 | 284 | function getSQL() { |
256 | 285 | global $wgShowSQLErrors; |
257 | 286 | |
— | — | @@ -266,6 +295,9 @@ |
267 | 296 | return false; |
268 | 297 | } |
269 | 298 | |
| 299 | + /** |
| 300 | + * @return String |
| 301 | + */ |
270 | 302 | function getPageTitle() { |
271 | 303 | return $this->msg( 'databaseerror', 'Database error' ); |
272 | 304 | } |
Index: trunk/phase3/includes/db/LBFactory_Multi.php |
— | — | @@ -179,6 +179,8 @@ |
180 | 180 | |
181 | 181 | /** |
182 | 182 | * Make a server array as expected by LoadBalancer::__construct, using a template and load array |
| 183 | + * |
| 184 | + * @return array |
183 | 185 | */ |
184 | 186 | function makeServerArray( $template, $loads, $groupLoads ) { |
185 | 187 | $servers = array(); |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | * Fetch the next row from the given result object, in associative array |
69 | 69 | * form. Fields are retrieved with $row['fieldname']. |
70 | 70 | * |
71 | | - * @param $res SQL result object as returned from DatabaseBase::query(), etc. |
| 71 | + * @param $res ResultWrapper result object as returned from DatabaseBase::query(), etc. |
72 | 72 | * @return Row object |
73 | 73 | * @throws DBUnexpectedError Thrown if the database returns an error |
74 | 74 | */ |
— | — | @@ -255,6 +255,8 @@ |
256 | 256 | /** |
257 | 257 | * Turns buffering of SQL result sets on (true) or off (false). |
258 | 258 | * Default is "on" and it should not be changed without good reasons. |
| 259 | + * |
| 260 | + * @return bool |
259 | 261 | */ |
260 | 262 | function bufferResults( $buffer = null ) { |
261 | 263 | if ( is_null( $buffer ) ) { |
— | — | @@ -309,6 +311,11 @@ |
310 | 312 | } |
311 | 313 | } |
312 | 314 | |
| 315 | + /** |
| 316 | + * @param $name |
| 317 | + * @param $value |
| 318 | + * @return void |
| 319 | + */ |
313 | 320 | function setLBInfo( $name, $value = null ) { |
314 | 321 | if ( is_null( $value ) ) { |
315 | 322 | $this->mLBInfo = $name; |
— | — | @@ -402,20 +409,28 @@ |
403 | 410 | * Return the last query that went through DatabaseBase::query() |
404 | 411 | * @return String |
405 | 412 | */ |
406 | | - function lastQuery() { return $this->mLastQuery; } |
| 413 | + function lastQuery() { |
| 414 | + return $this->mLastQuery; |
| 415 | + } |
407 | 416 | |
408 | 417 | |
409 | 418 | /** |
410 | 419 | * Returns true if the connection may have been used for write queries. |
411 | 420 | * Should return true if unsure. |
| 421 | + * |
| 422 | + * @return bool |
412 | 423 | */ |
413 | | - function doneWrites() { return $this->mDoneWrites; } |
| 424 | + function doneWrites() { |
| 425 | + return $this->mDoneWrites; |
| 426 | + } |
414 | 427 | |
415 | 428 | /** |
416 | 429 | * Is a connection to the database open? |
417 | 430 | * @return Boolean |
418 | 431 | */ |
419 | | - function isOpen() { return $this->mOpened; } |
| 432 | + function isOpen() { |
| 433 | + return $this->mOpened; |
| 434 | + } |
420 | 435 | |
421 | 436 | /** |
422 | 437 | * Set a flag for this connection |
— | — | @@ -459,6 +474,9 @@ |
460 | 475 | return $this->$name; |
461 | 476 | } |
462 | 477 | |
| 478 | + /** |
| 479 | + * @return string |
| 480 | + */ |
463 | 481 | function getWikiID() { |
464 | 482 | if ( $this->mTablePrefix ) { |
465 | 483 | return "{$this->mDBname}-{$this->mTablePrefix}"; |
— | — | @@ -469,6 +487,8 @@ |
470 | 488 | |
471 | 489 | /** |
472 | 490 | * Return a path to the DBMS-specific schema, otherwise default to tables.sql |
| 491 | + * |
| 492 | + * @return string |
473 | 493 | */ |
474 | 494 | public function getSchema() { |
475 | 495 | global $IP; |
— | — | @@ -522,6 +542,8 @@ |
523 | 543 | /** |
524 | 544 | * Same as new DatabaseMysql( ... ), kept for backward compatibility |
525 | 545 | * @deprecated since 1.17 |
| 546 | + * |
| 547 | + * @return DatabaseMysql |
526 | 548 | */ |
527 | 549 | static function newFromParams( $server, $user, $password, $dbName, $flags = 0 ) { |
528 | 550 | wfDeprecated( __METHOD__ ); |
— | — | @@ -620,6 +642,8 @@ |
621 | 643 | /** |
622 | 644 | * Determine whether a query writes to the DB. |
623 | 645 | * Should return true if unsure. |
| 646 | + * |
| 647 | + * @return bool |
624 | 648 | */ |
625 | 649 | function isWriteQuery( $sql ) { |
626 | 650 | return !preg_match( '/^(?:SELECT|BEGIN|COMMIT|SET|SHOW|\(SELECT)\b/i', $sql ); |
— | — | @@ -780,6 +804,8 @@ |
781 | 805 | * ! = raw SQL bit (a function for instance) |
782 | 806 | * & = filename; reads the file and inserts as a blob |
783 | 807 | * (we don't use this though...) |
| 808 | + * |
| 809 | + * @return array |
784 | 810 | */ |
785 | 811 | function prepare( $sql, $func = 'DatabaseBase::prepare' ) { |
786 | 812 | /* MySQL doesn't support prepared statements (yet), so just |
— | — | @@ -796,6 +822,8 @@ |
797 | 823 | * Execute a prepared query with the various arguments |
798 | 824 | * @param $prepared String: the prepared sql |
799 | 825 | * @param $args Mixed: Either an array here, or put scalars as varargs |
| 826 | + * |
| 827 | + * @return ResultWrapper |
800 | 828 | */ |
801 | 829 | function execute( $prepared, $args = null ) { |
802 | 830 | if ( !is_array( $args ) ) { |
— | — | @@ -814,6 +842,8 @@ |
815 | 843 | * in the appropriate places. |
816 | 844 | * @param $query String |
817 | 845 | * @param $args ... |
| 846 | + * |
| 847 | + * @return ResultWrapper |
818 | 848 | */ |
819 | 849 | function safeQuery( $query, $args = null ) { |
820 | 850 | $prepared = $this->prepare( $query, 'DatabaseBase::safeQuery' ); |
— | — | @@ -890,6 +920,8 @@ |
891 | 921 | * |
892 | 922 | * This function exists for historical reasons, DatabaseBase::update() has a more standard |
893 | 923 | * calling convention and feature set |
| 924 | + * |
| 925 | + * @return bool |
894 | 926 | */ |
895 | 927 | function set( $table, $var, $value, $cond, $fname = 'DatabaseBase::set' ) { |
896 | 928 | $table = $this->tableName( $table ); |
— | — | @@ -1211,6 +1243,8 @@ |
1212 | 1244 | * Determines whether an index exists |
1213 | 1245 | * Usually aborts on failure |
1214 | 1246 | * If errors are explicitly ignored, returns NULL on failure |
| 1247 | + * |
| 1248 | + * @return bool|null |
1215 | 1249 | */ |
1216 | 1250 | function indexExists( $table, $index, $fname = 'DatabaseBase::indexExists' ) { |
1217 | 1251 | $info = $this->indexInfo( $table, $index, $fname ); |
— | — | @@ -1223,6 +1257,10 @@ |
1224 | 1258 | |
1225 | 1259 | /** |
1226 | 1260 | * Query whether a given table exists |
| 1261 | + * |
| 1262 | + * @string table |
| 1263 | + * |
| 1264 | + * @return bool |
1227 | 1265 | */ |
1228 | 1266 | function tableExists( $table ) { |
1229 | 1267 | $table = $this->tableName( $table ); |
— | — | @@ -1246,6 +1284,11 @@ |
1247 | 1285 | |
1248 | 1286 | /** |
1249 | 1287 | * Determines if a given index is unique |
| 1288 | + * |
| 1289 | + * @param $table string |
| 1290 | + * @param $index string |
| 1291 | + * |
| 1292 | + * @return bool |
1250 | 1293 | */ |
1251 | 1294 | function indexUnique( $table, $index ) { |
1252 | 1295 | $indexInfo = $this->indexInfo( $table, $index ); |
— | — | @@ -1375,7 +1418,7 @@ |
1376 | 1419 | /** |
1377 | 1420 | * Makes an encoded list of strings from an array |
1378 | 1421 | * @param $a Array |
1379 | | - * @param $mode |
| 1422 | + * @param $mode int |
1380 | 1423 | * LIST_COMMA - comma separated, no field names |
1381 | 1424 | * LIST_AND - ANDed WHERE clause (without the WHERE) |
1382 | 1425 | * LIST_OR - ORed WHERE clause (without the WHERE) |
— | — | @@ -1488,14 +1531,28 @@ |
1489 | 1532 | * Bitwise operations |
1490 | 1533 | */ |
1491 | 1534 | |
| 1535 | + /** |
| 1536 | + * @param $field |
| 1537 | + * @return string |
| 1538 | + */ |
1492 | 1539 | function bitNot( $field ) { |
1493 | 1540 | return "(~$field)"; |
1494 | 1541 | } |
1495 | 1542 | |
| 1543 | + /** |
| 1544 | + * @param $fieldLeft |
| 1545 | + * @param $fieldRight |
| 1546 | + * @return string |
| 1547 | + */ |
1496 | 1548 | function bitAnd( $fieldLeft, $fieldRight ) { |
1497 | 1549 | return "($fieldLeft & $fieldRight)"; |
1498 | 1550 | } |
1499 | 1551 | |
| 1552 | + /** |
| 1553 | + * @param $fieldLeft |
| 1554 | + * @param $fieldRight |
| 1555 | + * @return string |
| 1556 | + */ |
1500 | 1557 | function bitOr( $fieldLeft, $fieldRight ) { |
1501 | 1558 | return "($fieldLeft | $fieldRight)"; |
1502 | 1559 | } |
— | — | @@ -1731,6 +1788,10 @@ |
1732 | 1789 | |
1733 | 1790 | /** |
1734 | 1791 | * Get the name of an index in a given table |
| 1792 | + * |
| 1793 | + * @param $index |
| 1794 | + * |
| 1795 | + * @return string |
1735 | 1796 | */ |
1736 | 1797 | function indexName( $index ) { |
1737 | 1798 | // Backwards-compatibility hack |
— | — | @@ -1750,6 +1811,10 @@ |
1751 | 1812 | /** |
1752 | 1813 | * If it's a string, adds quotes and backslashes |
1753 | 1814 | * Otherwise returns as-is |
| 1815 | + * |
| 1816 | + * @param $s string |
| 1817 | + * |
| 1818 | + * @return string |
1754 | 1819 | */ |
1755 | 1820 | function addQuotes( $s ) { |
1756 | 1821 | if ( $s === null ) { |
— | — | @@ -1768,6 +1833,8 @@ |
1769 | 1834 | * MySQL uses `backticks` while basically everything else uses double quotes. |
1770 | 1835 | * Since MySQL is the odd one out here the double quotes are our generic |
1771 | 1836 | * and we implement backticks in DatabaseMysql. |
| 1837 | + * |
| 1838 | + * @return string |
1772 | 1839 | */ |
1773 | 1840 | public function addIdentifierQuotes( $s ) { |
1774 | 1841 | return '"' . str_replace( '"', '""', $s ) . '"'; |
— | — | @@ -1776,6 +1843,9 @@ |
1777 | 1844 | /** |
1778 | 1845 | * Returns if the given identifier looks quoted or not according to |
1779 | 1846 | * the database convention for quoting identifiers . |
| 1847 | + * |
| 1848 | + * @param $name string |
| 1849 | + * |
1780 | 1850 | * @return boolean |
1781 | 1851 | */ |
1782 | 1852 | public function isQuotedIdentifier( $name ) { |
— | — | @@ -1787,6 +1857,8 @@ |
1788 | 1858 | * which used quote_ident which does not follow our naming conventions |
1789 | 1859 | * was renamed to addIdentifierQuotes. |
1790 | 1860 | * @deprecated since 1.18 use addIdentifierQuotes |
| 1861 | + * |
| 1862 | + * @return string |
1791 | 1863 | */ |
1792 | 1864 | function quote_ident( $s ) { |
1793 | 1865 | wfDeprecated( __METHOD__ ); |
— | — | @@ -1846,6 +1918,8 @@ |
1847 | 1919 | |
1848 | 1920 | /** |
1849 | 1921 | * Returns a token for buildLike() that denotes a '_' to be used in a LIKE query |
| 1922 | + * |
| 1923 | + * @return LikeMatch |
1850 | 1924 | */ |
1851 | 1925 | function anyChar() { |
1852 | 1926 | return new LikeMatch( '_' ); |
— | — | @@ -1853,6 +1927,8 @@ |
1854 | 1928 | |
1855 | 1929 | /** |
1856 | 1930 | * Returns a token for buildLike() that denotes a '%' to be used in a LIKE query |
| 1931 | + * |
| 1932 | + * @rerturn LikeMatch |
1857 | 1933 | */ |
1858 | 1934 | function anyString() { |
1859 | 1935 | return new LikeMatch( '%' ); |
— | — | @@ -2008,6 +2084,8 @@ |
2009 | 2085 | * Source items may be literals rather than field names, but strings should be quoted with DatabaseBase::addQuotes() |
2010 | 2086 | * $conds may be "*" to copy the whole table |
2011 | 2087 | * srcTable may be an array of tables. |
| 2088 | + * |
| 2089 | + * @return ResultWrapper |
2012 | 2090 | */ |
2013 | 2091 | function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = 'DatabaseBase::insertSelect', |
2014 | 2092 | $insertOptions = array(), $selectOptions = array() ) |
— | — | @@ -2060,6 +2138,8 @@ |
2061 | 2139 | * @param $sql String: SQL query we will append the limit too |
2062 | 2140 | * @param $limit Integer: the SQL limit |
2063 | 2141 | * @param $offset Integer the SQL offset (default false) |
| 2142 | + * |
| 2143 | + * @return string |
2064 | 2144 | */ |
2065 | 2145 | function limitResult( $sql, $limit, $offset = false ) { |
2066 | 2146 | if ( !is_numeric( $limit ) ) { |
— | — | @@ -2117,6 +2197,8 @@ |
2118 | 2198 | * @param $orig String: column to modify |
2119 | 2199 | * @param $old String: column to seek |
2120 | 2200 | * @param $new String: column to replace with |
| 2201 | + * |
| 2202 | + * @return string |
2121 | 2203 | */ |
2122 | 2204 | function strreplace( $orig, $old, $new ) { |
2123 | 2205 | return "REPLACE({$orig}, {$old}, {$new})"; |
— | — | @@ -2125,6 +2207,8 @@ |
2126 | 2208 | /** |
2127 | 2209 | * Determines if the last failure was due to a deadlock |
2128 | 2210 | * STUB |
| 2211 | + * |
| 2212 | + * @return bool |
2129 | 2213 | */ |
2130 | 2214 | function wasDeadlock() { |
2131 | 2215 | return false; |
— | — | @@ -2134,6 +2218,8 @@ |
2135 | 2219 | * Determines if the last query error was something that should be dealt |
2136 | 2220 | * with by pinging the connection and reissuing the query. |
2137 | 2221 | * STUB |
| 2222 | + * |
| 2223 | + * @return bool |
2138 | 2224 | */ |
2139 | 2225 | function wasErrorReissuable() { |
2140 | 2226 | return false; |
— | — | @@ -2142,6 +2228,8 @@ |
2143 | 2229 | /** |
2144 | 2230 | * Determines if the last failure was due to the database being read-only. |
2145 | 2231 | * STUB |
| 2232 | + * |
| 2233 | + * @return bool |
2146 | 2234 | */ |
2147 | 2235 | function wasReadOnlyError() { |
2148 | 2236 | return false; |
— | — | @@ -2257,6 +2345,8 @@ |
2258 | 2346 | |
2259 | 2347 | /** |
2260 | 2348 | * Get the position of the master from SHOW SLAVE STATUS |
| 2349 | + * |
| 2350 | + * @return MySQLMasterPos|false |
2261 | 2351 | */ |
2262 | 2352 | function getSlavePos() { |
2263 | 2353 | if ( !is_null( $this->mFakeSlaveLag ) ) { |
— | — | @@ -2278,6 +2368,8 @@ |
2279 | 2369 | |
2280 | 2370 | /** |
2281 | 2371 | * Get the position of the master from SHOW MASTER STATUS |
| 2372 | + * |
| 2373 | + * @return MySQLMasterPos|false |
2282 | 2374 | */ |
2283 | 2375 | function getMasterPos() { |
2284 | 2376 | if ( $this->mFakeMaster ) { |
— | — | @@ -2353,6 +2445,8 @@ |
2354 | 2446 | |
2355 | 2447 | /** |
2356 | 2448 | * Return MW-style timestamp used for MySQL schema |
| 2449 | + * |
| 2450 | + * @return string |
2357 | 2451 | */ |
2358 | 2452 | function timestamp( $ts = 0 ) { |
2359 | 2453 | return wfTimestamp( TS_MW, $ts ); |
— | — | @@ -2360,6 +2454,8 @@ |
2361 | 2455 | |
2362 | 2456 | /** |
2363 | 2457 | * Local database timestamp format or null |
| 2458 | + * |
| 2459 | + * @return string |
2364 | 2460 | */ |
2365 | 2461 | function timestampOrNull( $ts = null ) { |
2366 | 2462 | if ( is_null( $ts ) ) { |
— | — | @@ -2371,6 +2467,8 @@ |
2372 | 2468 | |
2373 | 2469 | /** |
2374 | 2470 | * @todo document |
| 2471 | + * |
| 2472 | + * @return ResultWrapper |
2375 | 2473 | */ |
2376 | 2474 | function resultObject( $result ) { |
2377 | 2475 | if ( empty( $result ) ) { |
— | — | @@ -2413,6 +2511,8 @@ |
2414 | 2512 | |
2415 | 2513 | /** |
2416 | 2514 | * Get status information from SHOW STATUS in an associative array |
| 2515 | + * |
| 2516 | + * @return array |
2417 | 2517 | */ |
2418 | 2518 | function getStatus( $which = "%" ) { |
2419 | 2519 | $res = $this->query( "SHOW STATUS LIKE '{$which}'" ); |
— | — | @@ -2427,6 +2527,8 @@ |
2428 | 2528 | |
2429 | 2529 | /** |
2430 | 2530 | * Return the maximum number of items allowed in a list, or 0 for unlimited. |
| 2531 | + * |
| 2532 | + * return int |
2431 | 2533 | */ |
2432 | 2534 | function maxListLen() { |
2433 | 2535 | return 0; |
Index: trunk/phase3/includes/db/CloneDatabase.php |
— | — | @@ -62,6 +62,7 @@ |
63 | 63 | * @param $tablesToClone Array An array of tables to clone, unprefixed |
64 | 64 | * @param $newTablePrefix String Prefix to assign to the tables |
65 | 65 | * @param $oldTablePrefix String Prefix on current tables, if not $wgDBprefix |
| 66 | + * @param $dropCurrentTables bool |
66 | 67 | */ |
67 | 68 | public function __construct( DatabaseBase $db, array $tablesToClone, |
68 | 69 | $newTablePrefix = 'parsertest', $oldTablePrefix = '', $dropCurrentTables = true ) |
Index: trunk/phase3/includes/db/LBFactory.php |
— | — | @@ -28,6 +28,8 @@ |
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Get an LBFactory instance |
| 32 | + * |
| 33 | + * @return LBFactory |
32 | 34 | */ |
33 | 35 | static function &singleton() { |
34 | 36 | if ( is_null( self::$instance ) ) { |
— | — | @@ -52,6 +54,8 @@ |
53 | 55 | |
54 | 56 | /** |
55 | 57 | * Set the instance to be the given object |
| 58 | + * |
| 59 | + * @param $instance LBFactory |
56 | 60 | */ |
57 | 61 | static function setInstance( $instance ) { |
58 | 62 | self::destroyInstance(); |
— | — | @@ -151,6 +155,10 @@ |
152 | 156 | $this->chronProt = new ChronologyProtector; |
153 | 157 | } |
154 | 158 | |
| 159 | + /** |
| 160 | + * @param $wiki |
| 161 | + * @return LoadBalancer |
| 162 | + */ |
155 | 163 | function newMainLB( $wiki = false ) { |
156 | 164 | global $wgDBservers, $wgMasterWaitTimeout; |
157 | 165 | if ( $wgDBservers ) { |
— | — | @@ -174,6 +182,10 @@ |
175 | 183 | )); |
176 | 184 | } |
177 | 185 | |
| 186 | + /** |
| 187 | + * @param $wiki |
| 188 | + * @return LoadBalancer |
| 189 | + */ |
178 | 190 | function getMainLB( $wiki = false ) { |
179 | 191 | if ( !isset( $this->mainLB ) ) { |
180 | 192 | $this->mainLB = $this->newMainLB( $wiki ); |
— | — | @@ -183,6 +195,12 @@ |
184 | 196 | return $this->mainLB; |
185 | 197 | } |
186 | 198 | |
| 199 | + /** |
| 200 | + * @throws MWException |
| 201 | + * @param $cluster |
| 202 | + * @param $wiki |
| 203 | + * @return LoadBalancer |
| 204 | + */ |
187 | 205 | function newExternalLB( $cluster, $wiki = false ) { |
188 | 206 | global $wgExternalServers; |
189 | 207 | if ( !isset( $wgExternalServers[$cluster] ) ) { |
— | — | @@ -193,6 +211,11 @@ |
194 | 212 | )); |
195 | 213 | } |
196 | 214 | |
| 215 | + /** |
| 216 | + * @param $cluster |
| 217 | + * @param $wiki |
| 218 | + * @return array |
| 219 | + */ |
197 | 220 | function &getExternalLB( $cluster, $wiki = false ) { |
198 | 221 | if ( !isset( $this->extLBs[$cluster] ) ) { |
199 | 222 | $this->extLBs[$cluster] = $this->newExternalLB( $cluster, $wiki ); |
Index: trunk/phase3/includes/db/DatabaseUtility.php |
— | — | @@ -191,6 +191,9 @@ |
192 | 192 | $this->result = $array; |
193 | 193 | } |
194 | 194 | |
| 195 | + /** |
| 196 | + * @return int |
| 197 | + */ |
195 | 198 | function numRows() { |
196 | 199 | return count( $this->result ); |
197 | 200 | } |