Removed remaining profile calls
[lhc/web/wiklou.git] / includes / skins / SkinTemplate.php
index 5514ae0..f60e4e8 100644 (file)
@@ -163,7 +163,7 @@ class SkinTemplate extends Skin {
                                        'lang' => $ilInterwikiCodeBCP47,
                                        'hreflang' => $ilInterwikiCodeBCP47,
                                );
-                               wfRunHooks(
+                               Hooks::run(
                                        'SkinTemplateGetLanguageLink',
                                        array( &$languageLink, $languageLinkTitle, $this->getTitle(), $this->getOutput() )
                                );
@@ -175,17 +175,13 @@ class SkinTemplate extends Skin {
        }
 
        protected function setupTemplateForOutput() {
-               wfProfileIn( __METHOD__ );
 
                $request = $this->getRequest();
                $user = $this->getUser();
                $title = $this->getTitle();
 
-               wfProfileIn( __METHOD__ . '-init' );
                $tpl = $this->setupTemplate( $this->template, 'skins' );
-               wfProfileOut( __METHOD__ . '-init' );
 
-               wfProfileIn( __METHOD__ . '-stuff' );
                $this->thispage = $title->getPrefixedDBkey();
                $this->titletxt = $title->getPrefixedText();
                $this->userpage = $user->getUserPage()->getPrefixedText();
@@ -208,9 +204,7 @@ class SkinTemplate extends Skin {
                        $this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage );
                }
 
-               wfProfileOut( __METHOD__ . '-stuff' );
 
-               wfProfileOut( __METHOD__ );
 
                return $tpl;
        }
@@ -221,26 +215,22 @@ class SkinTemplate extends Skin {
         * @param OutputPage $out
         */
        function outputPage( OutputPage $out = null ) {
-               wfProfileIn( __METHOD__ );
                Profiler::instance()->setTemplated( true );
 
                $oldContext = null;
                if ( $out !== null ) {
-                       // @todo Add wfDeprecated in 1.20
+                       // Deprecated since 1.20, note added in 1.25
+                       wfDeprecated( __METHOD__, '1.25' );
                        $oldContext = $this->getContext();
                        $this->setContext( $out->getContext() );
                }
 
                $out = $this->getOutput();
 
-               wfProfileIn( __METHOD__ . '-init' );
                $this->initPage( $out );
-               wfProfileOut( __METHOD__ . '-init' );
                $tpl = $this->prepareQuickTemplate( $out );
                // execute template
-               wfProfileIn( __METHOD__ . '-execute' );
                $res = $tpl->execute();
-               wfProfileOut( __METHOD__ . '-execute' );
 
                // result may be an error
                $this->printOrError( $res );
@@ -249,7 +239,6 @@ class SkinTemplate extends Skin {
                        $this->setContext( $oldContext );
                }
 
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -264,14 +253,12 @@ class SkinTemplate extends Skin {
                        $wgShowCreditsIfMax, $wgArticlePath,
                        $wgScriptPath, $wgServer;
 
-               wfProfileIn( __METHOD__ );
 
                $title = $this->getTitle();
                $request = $this->getRequest();
                $out = $this->getOutput();
                $tpl = $this->setupTemplateForOutput();
 
-               wfProfileIn( __METHOD__ . '-stuff2' );
                $tpl->set( 'title', $out->getPageTitle() );
                $tpl->set( 'pagetitle', $out->getHTMLTitle() );
                $tpl->set( 'displaytitle', $out->mPageLinkTitle );
@@ -366,9 +353,7 @@ class SkinTemplate extends Skin {
                        $tpl->set( 'userlangattributes', $attrs );
                }
 
-               wfProfileOut( __METHOD__ . '-stuff2' );
 
-               wfProfileIn( __METHOD__ . '-stuff3' );
                $tpl->set( 'newtalk', $this->getNewtalks() );
                $tpl->set( 'logo', $this->logoText() );
 
@@ -389,9 +374,7 @@ class SkinTemplate extends Skin {
                        }
                        $tpl->set( 'copyright', $this->getCopyright() );
                }
-               wfProfileOut( __METHOD__ . '-stuff3' );
 
-               wfProfileIn( __METHOD__ . '-stuff4' );
                $tpl->set( 'copyrightico', $this->getCopyrightIcon() );
                $tpl->set( 'poweredbyico', $this->getPoweredBy() );
                $tpl->set( 'disclaimer', $this->disclaimerLink() );
@@ -462,9 +445,7 @@ class SkinTemplate extends Skin {
                } else {
                        $tpl->set( 'language_urls', false );
                }
-               wfProfileOut( __METHOD__ . '-stuff4' );
 
-               wfProfileIn( __METHOD__ . '-stuff5' );
                # Personal toolbar
                $tpl->set( 'personal_urls', $this->buildPersonalUrls() );
                $content_navigation = $this->buildContentNavigationUrls();
@@ -483,11 +464,11 @@ class SkinTemplate extends Skin {
                $tpl->set( 'reporttime', wfReportTime() );
 
                // original version by hansm
-               if ( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) {
+               if ( !Hooks::run( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) {
                        wfDebug( __METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n" );
                }
 
-               // Set the bodytext to another key so that skins can just output it on it's own
+               // Set the bodytext to another key so that skins can just output it on its own
                // and output printfooter and debughtml separately
                $tpl->set( 'bodycontent', $tpl->data['bodytext'] );
 
@@ -504,9 +485,7 @@ class SkinTemplate extends Skin {
                // allow extensions adding stuff after the page content.
                // See Skin::afterContentHook() for further documentation.
                $tpl->set( 'dataAfterContent', $this->afterContentHook() );
-               wfProfileOut( __METHOD__ . '-stuff5' );
 
-               wfProfileOut( __METHOD__ );
                return $tpl;
        }
 
@@ -570,7 +549,6 @@ class SkinTemplate extends Skin {
                $title = $this->getTitle();
                $request = $this->getRequest();
                $pageurl = $title->getLocalURL();
-               wfProfileIn( __METHOD__ );
 
                /* set up the default links for the personal toolbar */
                $personal_urls = array();
@@ -702,8 +680,7 @@ class SkinTemplate extends Skin {
                        $personal_urls['login'] = $login_url;
                }
 
-               wfRunHooks( 'PersonalUrls', array( &$personal_urls, &$title, $this ) );
-               wfProfileOut( __METHOD__ );
+               Hooks::run( 'PersonalUrls', array( &$personal_urls, &$title, $this ) );
                return $personal_urls;
        }
 
@@ -748,7 +725,7 @@ class SkinTemplate extends Skin {
                }
 
                $result = array();
-               if ( !wfRunHooks( 'SkinTemplateTabAction', array( &$this,
+               if ( !Hooks::run( 'SkinTemplateTabAction', array( &$this,
                                $title, $message, $selected, $checkEdit,
                                &$classes, &$query, &$text, &$result ) ) ) {
                        return $result;
@@ -821,7 +798,6 @@ class SkinTemplate extends Skin {
        protected function buildContentNavigationUrls() {
                global $wgDisableLangConversion;
 
-               wfProfileIn( __METHOD__ );
 
                // Display tabs for the relevant title rather than always the title itself
                $title = $this->getRelevantTitle();
@@ -844,7 +820,7 @@ class SkinTemplate extends Skin {
                $userCanRead = $title->quickUserCan( 'read', $user );
 
                $preventActiveTabs = false;
-               wfRunHooks( 'SkinTemplatePreventOtherActiveTabs', array( &$this, &$preventActiveTabs ) );
+               Hooks::run( 'SkinTemplatePreventOtherActiveTabs', array( &$this, &$preventActiveTabs ) );
 
                // Checks if page is some kind of content
                if ( $title->canExist() ) {
@@ -908,7 +884,6 @@ class SkinTemplate extends Skin {
                                        );
                                }
 
-                               wfProfileIn( __METHOD__ . '-edit' );
 
                                // Checks if user can edit the current page if it exists or create it otherwise
                                if ( $title->quickUserCan( 'edit', $user )
@@ -966,9 +941,7 @@ class SkinTemplate extends Skin {
                                                'primary' => true, // don't collapse this in vector
                                        );
                                }
-                               wfProfileOut( __METHOD__ . '-edit' );
 
-                               wfProfileIn( __METHOD__ . '-live' );
                                // Checks if the page exists
                                if ( $title->exists() ) {
                                        // Adds history view link
@@ -1003,7 +976,7 @@ class SkinTemplate extends Skin {
                                        if ( $user->isAllowed( 'deletedhistory' ) ) {
                                                $n = $title->isDeleted();
                                                if ( $n ) {
-                                                       $undelTitle = SpecialPage::getTitleFor( 'Undelete' );
+                                                       $undelTitle = SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedDBkey() );
                                                        // If the user can't undelete but can view deleted
                                                        // history show them a "View .. deleted" tab instead.
                                                        $msgKey = $user->isAllowed( 'undelete' ) ? 'undelete' : 'viewdeleted';
@@ -1011,7 +984,7 @@ class SkinTemplate extends Skin {
                                                                'class' => $this->getTitle()->isSpecial( 'Undelete' ) ? 'selected' : false,
                                                                'text' => wfMessageFallback( "$skname-action-$msgKey", "{$msgKey}_short" )
                                                                        ->setContext( $this->getContext() )->numParams( $n )->text(),
-                                                               'href' => $undelTitle->getLocalURL( array( 'target' => $title->getPrefixedDBkey() ) )
+                                                               'href' => $undelTitle->getLocalURL()
                                                        );
                                                }
                                        }
@@ -1029,7 +1002,6 @@ class SkinTemplate extends Skin {
                                        );
                                }
 
-                               wfProfileOut( __METHOD__ . '-live' );
 
                                // Checks if the user is logged in
                                if ( $this->loggedin && $user->isAllowedAll( 'viewmywatchlist', 'editmywatchlist' ) ) {
@@ -1053,7 +1025,7 @@ class SkinTemplate extends Skin {
                                }
                        }
 
-                       wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$content_navigation ) );
+                       Hooks::run( 'SkinTemplateNavigation', array( &$this, &$content_navigation ) );
 
                        if ( $userCanRead && !$wgDisableLangConversion ) {
                                $pageLang = $title->getPageLanguage();
@@ -1095,12 +1067,12 @@ class SkinTemplate extends Skin {
                                'context' => 'subject'
                        );
 
-                       wfRunHooks( 'SkinTemplateNavigation::SpecialPage',
+                       Hooks::run( 'SkinTemplateNavigation::SpecialPage',
                                array( &$this, &$content_navigation ) );
                }
 
                // Equiv to SkinTemplateContentActions
-               wfRunHooks( 'SkinTemplateNavigation::Universal', array( &$this, &$content_navigation ) );
+               Hooks::run( 'SkinTemplateNavigation::Universal', array( &$this, &$content_navigation ) );
 
                // Setup xml ids and tooltip info
                foreach ( $content_navigation as $section => &$links ) {
@@ -1137,7 +1109,6 @@ class SkinTemplate extends Skin {
                        }
                }
 
-               wfProfileOut( __METHOD__ );
 
                return $content_navigation;
        }
@@ -1149,7 +1120,6 @@ class SkinTemplate extends Skin {
         */
        private function buildContentActionUrls( $content_navigation ) {
 
-               wfProfileIn( __METHOD__ );
 
                // content_actions has been replaced with content_navigation for backwards
                // compatibility and also for skins that just want simple tabs content_actions
@@ -1182,7 +1152,6 @@ class SkinTemplate extends Skin {
                        }
                }
 
-               wfProfileOut( __METHOD__ );
 
                return $content_actions;
        }
@@ -1194,7 +1163,6 @@ class SkinTemplate extends Skin {
        protected function buildNavUrls() {
                global $wgUploadNavigationUrl;
 
-               wfProfileIn( __METHOD__ );
 
                $out = $this->getOutput();
                $request = $this->getRequest();
@@ -1242,7 +1210,7 @@ class SkinTemplate extends Skin {
                        }
 
                        // Use the copy of revision ID in case this undocumented, shady hook tries to mess with internals
-                       wfRunHooks( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink',
+                       Hooks::run( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink',
                                array( &$this, &$nav_urls, &$revid, &$revid ) );
                }
 
@@ -1300,7 +1268,6 @@ class SkinTemplate extends Skin {
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $nav_urls;
        }