From 126bf9507936647a815b42d3c647b710569f5f24 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 28 Sep 2012 01:11:33 -0700 Subject: [PATCH] Add profiling. Change-Id: I965ae08f801dfd24cd7fd5cc69087da7949f8a51 --- UniversalLanguageSelector.hooks.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index 94007501..f1ad9e83 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -72,7 +72,9 @@ class UniversalLanguageSelectorHooks { } protected static function isSupportedLanguage( $language ) { + wfProfileIn( __METHOD__ ); $supported = Language::fetchLanguageNames( null, 'mwfile' ); + wfProfileOut( __METHOD__ ); return isset( $supported[$language] ); } @@ -81,11 +83,13 @@ class UniversalLanguageSelectorHooks { * @return string */ protected static function getDefaultLanguage( array $preferred ) { + wfProfileIn( __METHOD__ ); $supported = Language::fetchLanguageNames( null, 'mwfile' ); // look for a language that is acceptable to the client // and known to the wiki. foreach ( $preferred as $code => $weight ) { if ( isset( $supported[$code] ) ) { + wfProfileOut( __METHOD__ ); return $code; } } @@ -96,10 +100,12 @@ class UniversalLanguageSelectorHooks { $parts = explode( '-', $code, 2 ); $code = $parts[0]; if ( isset( $supported[$code] ) ) { + wfProfileOut( __METHOD__ ); return $code; } } + wfProfileOut( __METHOD__ ); return ""; }