Index: trunk/phase3/includes/FileDeleteForm.php |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | try { |
152 | 152 | // delete the associated article first |
153 | 153 | $error = ''; |
154 | | - if ( $page->doDeleteArticleReal( $reason, $suppress, 0, false, $error, $user ) >= Page::DELETE_SUCCESS ) { |
| 154 | + if ( $page->doDeleteArticleReal( $reason, $suppress, 0, false, $error, $user ) >= WikiPage::DELETE_SUCCESS ) { |
155 | 155 | $status = $file->delete( $reason, $suppress ); |
156 | 156 | if( $status->isOK() ) { |
157 | 157 | $dbw->commit(); |
Index: trunk/phase3/includes/WikiPage.php |
— | — | @@ -2,9 +2,20 @@ |
3 | 3 | /** |
4 | 4 | * Abstract class for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage) |
5 | 5 | */ |
6 | | -abstract class Page { |
| 6 | +abstract class Page {} |
| 7 | + |
| 8 | +/** |
| 9 | + * Class representing a MediaWiki article and history. |
| 10 | + * |
| 11 | + * Some fields are public only for backwards-compatibility. Use accessors. |
| 12 | + * In the past, this class was part of Article.php and everything was public. |
| 13 | + * |
| 14 | + * @internal documentation reviewed 15 Mar 2010 |
| 15 | + */ |
| 16 | +class WikiPage extends Page { |
7 | 17 | // doDeleteArticleReal() return values. Values less than zero indicate fatal errors, |
8 | | - // values greater than zero indicate that there were non-fatal problems. |
| 18 | + // values greater than zero indicate that there were problems not resulting in page |
| 19 | + // not being deleted |
9 | 20 | |
10 | 21 | /** |
11 | 22 | * Delete operation aborted by hook |
— | — | @@ -25,17 +36,7 @@ |
26 | 37 | * No revisions found to delete |
27 | 38 | */ |
28 | 39 | const DELETE_NO_REVISIONS = 2; |
29 | | -} |
30 | 40 | |
31 | | -/** |
32 | | - * Class representing a MediaWiki article and history. |
33 | | - * |
34 | | - * Some fields are public only for backwards-compatibility. Use accessors. |
35 | | - * In the past, this class was part of Article.php and everything was public. |
36 | | - * |
37 | | - * @internal documentation reviewed 15 Mar 2010 |
38 | | - */ |
39 | | -class WikiPage extends Page { |
40 | 41 | /** |
41 | 42 | * @var Title |
42 | 43 | */ |
— | — | @@ -1931,7 +1932,7 @@ |
1932 | 1933 | $reason, $suppress = false, $id = 0, $commit = true, &$error = '', User $user = null |
1933 | 1934 | ) { |
1934 | 1935 | return $this->doDeleteArticleReal( $reason, $suppress, $id, $commit, $error, $user ) |
1935 | | - != Page::DELETE_SUCCESS; |
| 1936 | + != WikiPage::DELETE_SUCCESS; |
1936 | 1937 | } |
1937 | 1938 | |
1938 | 1939 | /** |
— | — | @@ -1948,7 +1949,7 @@ |
1949 | 1950 | * @param $commit boolean defaults to true, triggers transaction end |
1950 | 1951 | * @param &$error Array of errors to append to |
1951 | 1952 | * @param $user User The deleting user |
1952 | | - * @return int: One of Page::DELETE_* constants |
| 1953 | + * @return int: One of WikiPage::DELETE_* constants |
1953 | 1954 | */ |
1954 | 1955 | public function doDeleteArticleReal( |
1955 | 1956 | $reason, $suppress = false, $id = 0, $commit = true, &$error = '', User $user = null |
— | — | @@ -1959,14 +1960,14 @@ |
1960 | 1961 | wfDebug( __METHOD__ . "\n" ); |
1961 | 1962 | |
1962 | 1963 | if ( ! wfRunHooks( 'ArticleDelete', array( &$this, &$user, &$reason, &$error ) ) ) { |
1963 | | - return Page::DELETE_HOOK_ABORTED; |
| 1964 | + return WikiPage::DELETE_HOOK_ABORTED; |
1964 | 1965 | } |
1965 | 1966 | $dbw = wfGetDB( DB_MASTER ); |
1966 | 1967 | $t = $this->mTitle->getDBkey(); |
1967 | 1968 | $id = $id ? $id : $this->mTitle->getArticleID( Title::GAID_FOR_UPDATE ); |
1968 | 1969 | |
1969 | 1970 | if ( $t === '' || $id == 0 ) { |
1970 | | - return Page::DELETE_NO_PAGE; |
| 1971 | + return WikiPage::DELETE_NO_PAGE; |
1971 | 1972 | } |
1972 | 1973 | |
1973 | 1974 | // Bitfields to further suppress the content |
— | — | @@ -2022,7 +2023,7 @@ |
2023 | 2024 | |
2024 | 2025 | if ( !$ok ) { |
2025 | 2026 | $dbw->rollback(); |
2026 | | - return Page::DELETE_NO_REVISIONS; |
| 2027 | + return WikiPage::DELETE_NO_REVISIONS; |
2027 | 2028 | } |
2028 | 2029 | |
2029 | 2030 | $this->doDeleteUpdates( $id ); |
— | — | @@ -2042,7 +2043,7 @@ |
2043 | 2044 | } |
2044 | 2045 | |
2045 | 2046 | wfRunHooks( 'ArticleDeleteComplete', array( &$this, &$user, $reason, $id ) ); |
2046 | | - return Page::DELETE_SUCCESS; |
| 2047 | + return WikiPage::DELETE_SUCCESS; |
2047 | 2048 | } |
2048 | 2049 | |
2049 | 2050 | /** |