Index: trunk/phase3/includes/WikiPage.php |
— | — | @@ -13,21 +13,24 @@ |
14 | 14 | * @internal documentation reviewed 15 Mar 2010 |
15 | 15 | */ |
16 | 16 | class WikiPage extends Page { |
| 17 | + /** |
| 18 | + * @var Title |
| 19 | + * @protected |
| 20 | + */ |
| 21 | + public $mTitle = null; |
| 22 | + |
17 | 23 | /**@{{ |
18 | 24 | * @protected |
19 | | - * Fields are public for backwards-compatibility. Use accessors. |
20 | | - * In the past, this class was part of Article.php and everything was public. |
21 | 25 | */ |
22 | | - public $mTitle = null; // !< Title object |
23 | | - public $mCounter = -1; // !< Not loaded |
24 | | - public $mDataLoaded = false; // !< |
25 | | - public $mIsRedirect = false; // !< |
26 | | - public $mLatest = false; // !< |
27 | | - public $mPreparedEdit = false; // !< |
| 26 | + public $mCounter = -1; // !< Integer (-1 means "not loaded") |
| 27 | + public $mDataLoaded = false; // !< Boolean |
| 28 | + public $mIsRedirect = false; // !< Boolean |
| 29 | + public $mLatest = false; // !< Boolean |
| 30 | + public $mPreparedEdit = false; // !< Array |
28 | 31 | public $mRedirectTarget = null; // !< Title object |
29 | 32 | public $mLastRevision = null; // !< Revision object |
30 | | - public $mTimestamp = ''; // !< |
31 | | - public $mTouched = '19700101000000'; // !< |
| 33 | + public $mTimestamp = ''; // !< String |
| 34 | + public $mTouched = '19700101000000'; // !< String |
32 | 35 | /**@}}*/ |
33 | 36 | |
34 | 37 | /** |
— | — | @@ -78,7 +81,7 @@ |
79 | 82 | $dbr = wfGetDB( DB_SLAVE ); |
80 | 83 | $row = $dbr->selectRow( 'redirect', |
81 | 84 | array( 'rd_namespace', 'rd_title', 'rd_fragment', 'rd_interwiki' ), |
82 | | - array( 'rd_from' => $this->getID() ), |
| 85 | + array( 'rd_from' => $this->getId() ), |
83 | 86 | __METHOD__ |
84 | 87 | ); |
85 | 88 | |
— | — | @@ -118,7 +121,7 @@ |
119 | 122 | $dbw = wfGetDB( DB_MASTER ); |
120 | 123 | $dbw->replace( 'redirect', array( 'rd_from' ), |
121 | 124 | array( |
122 | | - 'rd_from' => $this->getID(), |
| 125 | + 'rd_from' => $this->getId(), |
123 | 126 | 'rd_namespace' => $rt->getNamespace(), |
124 | 127 | 'rd_title' => $rt->getDBkey(), |
125 | 128 | 'rd_fragment' => $rt->getFragment(), |
— | — | @@ -331,7 +334,7 @@ |
332 | 335 | /** |
333 | 336 | * @return int Page ID |
334 | 337 | */ |
335 | | - public function getID() { |
| 338 | + public function getId() { |
336 | 339 | return $this->mTitle->getArticleID(); |
337 | 340 | } |
338 | 341 | |
— | — | @@ -359,7 +362,7 @@ |
360 | 363 | */ |
361 | 364 | public function getCount() { |
362 | 365 | if ( -1 == $this->mCounter ) { |
363 | | - $id = $this->getID(); |
| 366 | + $id = $this->getId(); |
364 | 367 | |
365 | 368 | if ( $id == 0 ) { |
366 | 369 | $this->mCounter = 0; |
— | — | @@ -447,7 +450,7 @@ |
448 | 451 | } |
449 | 452 | |
450 | 453 | # New or non-existent articles have no user information |
451 | | - $id = $this->getID(); |
| 454 | + $id = $this->getId(); |
452 | 455 | if ( 0 == $id ) { |
453 | 456 | return; |
454 | 457 | } |
— | — | @@ -683,7 +686,7 @@ |
684 | 687 | } |
685 | 688 | |
686 | 689 | if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { |
687 | | - if ( $this->getID() == 0 ) { |
| 690 | + if ( $this->getId() == 0 ) { |
688 | 691 | $text = false; |
689 | 692 | } else { |
690 | 693 | $text = $this->getRawText(); |
— | — | @@ -1850,8 +1853,8 @@ |
1851 | 1854 | } |
1852 | 1855 | |
1853 | 1856 | # Don't update page view counters on views from bot users (bug 14044) |
1854 | | - if ( !$wgDisableCounters && !$user->isAllowed( 'bot' ) && $this->getID() ) { |
1855 | | - $wgDeferredUpdateList[] = new ViewCountUpdate( $this->getID() ); |
| 1857 | + if ( !$wgDisableCounters && !$user->isAllowed( 'bot' ) && $this->getId() ) { |
| 1858 | + $wgDeferredUpdateList[] = new ViewCountUpdate( $this->getId() ); |
1856 | 1859 | $wgDeferredUpdateList[] = new SiteStatsUpdate( 1, 0, 0 ); |
1857 | 1860 | } |
1858 | 1861 | |
— | — | @@ -1954,7 +1957,7 @@ |
1955 | 1958 | } |
1956 | 1959 | } |
1957 | 1960 | |
1958 | | - $id = $this->getID(); |
| 1961 | + $id = $this->getId(); |
1959 | 1962 | $title = $this->mTitle->getPrefixedDBkey(); |
1960 | 1963 | $shortTitle = $this->mTitle->getDBkey(); |
1961 | 1964 | |
— | — | @@ -1980,11 +1983,12 @@ |
1981 | 1984 | $wgDeferredUpdateList[] = new SiteStatsUpdate( 0, 1, $good, $total ); |
1982 | 1985 | $wgDeferredUpdateList[] = new SearchUpdate( $id, $title, $text ); |
1983 | 1986 | |
1984 | | - # If this is another user's talk page, update newtalk |
1985 | | - # Don't do this if $changed = false otherwise some idiot can null-edit a |
1986 | | - # load of user talk pages and piss people off, nor if it's a minor edit |
1987 | | - # by a properly-flagged bot. |
1988 | | - if ( $this->mTitle->getNamespace() == NS_USER_TALK && $shortTitle != $user->getTitleKey() && $changed |
| 1987 | + # If this is another user's talk page, update newtalk. |
| 1988 | + # Don't do this if $options['changed'] = false (null-edits) nor if |
| 1989 | + # it's a minor edit and the user doesn't want notifications for those. |
| 1990 | + if ( $options['changed'] |
| 1991 | + && $this->mTitle->getNamespace() == NS_USER_TALK |
| 1992 | + && $shortTitle != $user->getTitleKey() |
1989 | 1993 | && !( $revision->isMinor() && $user->isAllowed( 'nominornewtalk' ) ) |
1990 | 1994 | ) { |
1991 | 1995 | if ( wfRunHooks( 'ArticleEditUpdateNewTalk', array( &$this ) ) ) { |
Index: trunk/phase3/includes/WikiCategoryPage.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | * In use defined as: either the actual page exists |
21 | 21 | * or the category currently has members. |
22 | 22 | */ |
23 | | - function hasViewableContent() { |
| 23 | + public function hasViewableContent() { |
24 | 24 | if ( parent::hasViewableContent() ) { |
25 | 25 | return true; |
26 | 26 | } else { |