From 93623ad2d708c973676426fa4f15f0fccae97881 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Tue, 6 Jun 2006 12:28:44 +0000 Subject: [PATCH] AutoLoad RawPage, EditPage, ExternalEdit, PageHistory, move DIR_NEXT and DIR_PREV constants into PageHistory:: --- includes/ImagePage.php | 1 - includes/PageHistory.php | 20 ++++++++++---------- includes/Wiki.php | 4 ---- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 9b91c8785e..3c31e95390 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -674,7 +674,6 @@ END } function blockedIPpage() { - require_once( 'EditPage.php' ); $edit = new EditPage( $this ); return $edit->blockedIPpage(); } diff --git a/includes/PageHistory.php b/includes/PageHistory.php index f6cf419203..4cd9a3f7ba 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -6,9 +6,6 @@ * @package MediaWiki */ -define('DIR_PREV', 0); -define('DIR_NEXT', 1); - /** * This class handles printing the history page for an article. In order to * be efficient, it uses timestamps rather than offsets for paging, to avoid @@ -21,6 +18,9 @@ define('DIR_NEXT', 1); */ class PageHistory { + const DIR_PREV = 0; + const DIR_NEXT = 1; + var $mArticle, $mTitle, $mSkin; var $lastdate; var $linesonpage; @@ -146,7 +146,7 @@ class PageHistory { $this->linesonpage = count($revisions) - 1; /* Un-reverse revisions */ - if ($direction == DIR_PREV) + if ($direction == PageHistory::DIR_PREV) $revisions = array_reverse($revisions); /* @@ -432,9 +432,9 @@ class PageHistory { function getDirection() { global $wgRequest; if ($wgRequest->getText("dir") == "prev") - return DIR_PREV; + return PageHistory::DIR_PREV; else - return DIR_NEXT; + return PageHistory::DIR_NEXT; } /** @todo document */ @@ -443,9 +443,9 @@ class PageHistory { $dbr =& wfGetDB( DB_SLAVE ); - if ($direction == DIR_PREV) + if ($direction == PageHistory::DIR_PREV) list($dirs, $oper) = array("ASC", ">="); - else /* $direction == DIR_NEXT */ + else /* $direction == PageHistory::DIR_NEXT */ list($dirs, $oper) = array("DESC", "<="); if ($offset) @@ -510,7 +510,7 @@ class PageHistory { * When we're displaying previous revisions, we need to reverse * the array, because it's queried in reverse order. */ - if ($direction == DIR_PREV) + if ($direction == PageHistory::DIR_PREV) $revisions = array_reverse($revisions); /* @@ -591,7 +591,7 @@ class PageHistory { wfMsgForContent( 'history-feed-description' ), $this->mTitle->getFullUrl( 'action=history' ) ); - $items = $this->fetchRevisions(10, 0, DIR_NEXT); + $items = $this->fetchRevisions(10, 0, PageHistory::DIR_NEXT); $feed->outHeader(); if( $items ) { foreach( $items as $row ) { diff --git a/includes/Wiki.php b/includes/Wiki.php index 8014e3e55c..682b76ac65 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -371,11 +371,9 @@ class MediaWiki { $oldid = $request->getVal( 'oldid' ); if( !$this->getVal( 'UseExternalEditor' ) || $action=='submit' || $internal || $section || $oldid || ( !$user->getOption( 'externaleditor' ) && !$external ) ) { - require_once( 'includes/EditPage.php' ); $editor = new EditPage( $article ); $editor->submit(); } elseif( $this->getVal( 'UseExternalEditor' ) && ( $external || $user->getOption( 'externaleditor' ) ) ) { - require_once( 'includes/ExternalEdit.php' ); $mode = $request->getVal( 'mode' ); $extedit = new ExternalEdit( $article, $mode ); $extedit->edit(); @@ -385,12 +383,10 @@ class MediaWiki { if( $_SERVER['REQUEST_URI'] == $title->getInternalURL( 'action=history' ) ) { $output->setSquidMaxage( $this->getVal( 'SquidMaxage' ) ); } - require_once( 'includes/PageHistory.php' ); $history = new PageHistory( $article ); $history->history(); break; case 'raw': - require_once( 'includes/RawPage.php' ); $raw = new RawPage( $article ); $raw->view(); break; -- 2.20.1