Index: trunk/phase3/includes/Title.php |
— | — | @@ -4,21 +4,22 @@ |
5 | 5 | * @file |
6 | 6 | */ |
7 | 7 | |
8 | | -/** */ |
9 | 8 | if ( !class_exists( 'UtfNormal' ) ) { |
10 | 9 | require_once( dirname(__FILE__) . '/normal/UtfNormal.php' ); |
11 | 10 | } |
12 | 11 | |
13 | 12 | define ( 'GAID_FOR_UPDATE', 1 ); |
14 | 13 | |
15 | | -# Title::newFromTitle maintains a cache to avoid |
16 | | -# expensive re-normalization of commonly used titles. |
17 | | -# On a batch operation this can become a memory leak |
18 | | -# if not bounded. After hitting this many titles, |
19 | | -# reset the cache. |
| 14 | +/** |
| 15 | + * Title::newFromText maintains a cache to avoid expensive re-normalization of |
| 16 | + * commonly used titles. On a batch operation this can become a memory leak |
| 17 | + * if not bounded. After hitting this many titles reset the cache. |
| 18 | + */ |
20 | 19 | define( 'MW_TITLECACHE_MAX', 1000 ); |
21 | 20 | |
22 | | -# Constants for pr_cascade bitfield |
| 21 | +/** |
| 22 | + * Constants for pr_cascade bitfield |
| 23 | + */ |
23 | 24 | define( 'CASCADE', 1 ); |
24 | 25 | |
25 | 26 | /** |
— | — | @@ -325,17 +326,14 @@ |
326 | 327 | * @param int $id the page_id of the article |
327 | 328 | * @return Title an object representing the article, or NULL |
328 | 329 | * if no such article was found |
329 | | - * @static |
330 | | - * @access public |
331 | 330 | */ |
332 | | - function nameOf( $id ) { |
333 | | - $fname = 'Title::nameOf'; |
| 331 | + public static function nameOf( $id ) { |
334 | 332 | $dbr = wfGetDB( DB_SLAVE ); |
335 | 333 | |
336 | | - $s = $dbr->selectRow( 'page', array( 'page_namespace','page_title' ), array( 'page_id' => $id ), $fname ); |
| 334 | + $s = $dbr->selectRow( 'page', array( 'page_namespace','page_title' ), array( 'page_id' => $id ), __METHOD__ ); |
337 | 335 | if ( $s === false ) { return NULL; } |
338 | 336 | |
339 | | - $n = Title::makeName( $s->page_namespace, $s->page_title ); |
| 337 | + $n = self::makeName( $s->page_namespace, $s->page_title ); |
340 | 338 | return $n; |
341 | 339 | } |
342 | 340 | |