/**
* Abstract class for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
*/
-abstract class Page {
+abstract class Page {}
+
+/**
+ * Class representing a MediaWiki article and history.
+ *
+ * Some fields are public only for backwards-compatibility. Use accessors.
+ * In the past, this class was part of Article.php and everything was public.
+ *
+ * @internal documentation reviewed 15 Mar 2010
+ */
+class WikiPage extends Page {
// doDeleteArticleReal() return values. Values less than zero indicate fatal errors,
- // values greater than zero indicate that there were non-fatal problems.
+ // values greater than zero indicate that there were problems not resulting in page
+ // not being deleted
/**
* Delete operation aborted by hook
* No revisions found to delete
*/
const DELETE_NO_REVISIONS = 2;
-}
-/**
- * Class representing a MediaWiki article and history.
- *
- * Some fields are public only for backwards-compatibility. Use accessors.
- * In the past, this class was part of Article.php and everything was public.
- *
- * @internal documentation reviewed 15 Mar 2010
- */
-class WikiPage extends Page {
/**
* @var Title
*/
$reason, $suppress = false, $id = 0, $commit = true, &$error = '', User $user = null
) {
return $this->doDeleteArticleReal( $reason, $suppress, $id, $commit, $error, $user )
- != Page::DELETE_SUCCESS;
+ != WikiPage::DELETE_SUCCESS;
}
/**
* @param $commit boolean defaults to true, triggers transaction end
* @param &$error Array of errors to append to
* @param $user User The deleting user
- * @return int: One of Page::DELETE_* constants
+ * @return int: One of WikiPage::DELETE_* constants
*/
public function doDeleteArticleReal(
$reason, $suppress = false, $id = 0, $commit = true, &$error = '', User $user = null
wfDebug( __METHOD__ . "\n" );
if ( ! wfRunHooks( 'ArticleDelete', array( &$this, &$user, &$reason, &$error ) ) ) {
- return Page::DELETE_HOOK_ABORTED;
+ return WikiPage::DELETE_HOOK_ABORTED;
}
$dbw = wfGetDB( DB_MASTER );
$t = $this->mTitle->getDBkey();
$id = $id ? $id : $this->mTitle->getArticleID( Title::GAID_FOR_UPDATE );
if ( $t === '' || $id == 0 ) {
- return Page::DELETE_NO_PAGE;
+ return WikiPage::DELETE_NO_PAGE;
}
// Bitfields to further suppress the content
if ( !$ok ) {
$dbw->rollback();
- return Page::DELETE_NO_REVISIONS;
+ return WikiPage::DELETE_NO_REVISIONS;
}
$this->doDeleteUpdates( $id );
}
wfRunHooks( 'ArticleDeleteComplete', array( &$this, &$user, $reason, $id ) );
- return Page::DELETE_SUCCESS;
+ return WikiPage::DELETE_SUCCESS;
}
/**