3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 * An action that views article content
24 * This is a wrapper that will call Article::view().
28 class ViewAction
extends FormlessAction
{
30 public function getName() {
34 public function onView() {
38 public function show() {
39 $config = $this->context
->getConfig();
42 $config->get( 'DebugToolbar' ) == false && // don't let this get stuck on pages
43 $this->page
->checkTouched() // page exists and is not a redirect
45 // Include any redirect in the last-modified calculation
46 $redirFromTitle = $this->page
->getRedirectedFrom();
47 if ( !$redirFromTitle ) {
48 $touched = $this->page
->getTouched();
49 } elseif ( $config->get( 'MaxRedirects' ) <= 1 ) {
50 $touched = max( $this->page
->getTouched(), $redirFromTitle->getTouched() );
52 // Don't bother following the chain and getting the max mtime
56 // Send HTTP 304 if the IMS matches or otherwise set expiry/last-modified headers
57 if ( $touched && $this->getOutput()->checkLastModified( $touched ) ) {
58 wfDebug( __METHOD__
. ": done 304\n" );