function name in debug output for OutputPage::checkLastModified
authorAntoine Musso <hashar@users.mediawiki.org>
Fri, 12 May 2006 22:38:58 +0000 (22:38 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Fri, 12 May 2006 22:38:58 +0000 (22:38 +0000)
includes/OutputPage.php

index 4b3710d..e9c2e9f 100644 (file)
@@ -92,16 +92,18 @@ class OutputPage {
         */
        function checkLastModified ( $timestamp ) {
                global $wgCachePages, $wgCacheEpoch, $wgUser;
+               $fname = 'OutputPage::checkLastModified';
+
                if ( !$timestamp || $timestamp == '19700101000000' ) {
-                       wfDebug( "CACHE DISABLED, NO TIMESTAMP\n" );
+                       wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP\n" );
                        return;
                }
                if( !$wgCachePages ) {
-                       wfDebug( "CACHE DISABLED\n", false );
+                       wfDebug( "$fname: CACHE DISABLED\n", false );
                        return;
                }
                if( $wgUser->getOption( 'nocache' ) ) {
-                       wfDebug( "USER DISABLED CACHE\n", false );
+                       wfDebug( "$fname: USER DISABLED CACHE\n", false );
                        return;
                }
 
@@ -115,23 +117,23 @@ class OutputPage {
                        $modsince = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] );
                        $modsinceTime = strtotime( $modsince );
                        $ismodsince = wfTimestamp( TS_MW, $modsinceTime ? $modsinceTime : 1 );
-                       wfDebug( "-- client send If-Modified-Since: " . $modsince . "\n", false );
-                       wfDebug( "--  we might send Last-Modified : $lastmod\n", false );
+                       wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", false );
+                       wfDebug( "$fname: --  we might send Last-Modified : $lastmod\n", false );
                        if( ($ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) && $ismodsince >= $wgCacheEpoch ) {
                                # Make sure you're in a place you can leave when you call us!
                                header( "HTTP/1.0 304 Not Modified" );
                                $this->mLastModified = $lastmod;
                                $this->sendCacheControl();
-                               wfDebug( "CACHED client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
+                               wfDebug( "$fname: CACHED client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
                                $this->disable();
                                @ob_end_clean(); // Don't output compressed blob
                                return true;
                        } else {
-                               wfDebug( "READY  client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
+                               wfDebug( "$fname: READY  client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
                                $this->mLastModified = $lastmod;
                        }
                } else {
-                       wfDebug( "client did not send If-Modified-Since header\n", false );
+                       wfDebug( "$fname: client did not send If-Modified-Since header\n", false );
                        $this->mLastModified = $lastmod;
                }
        }