{
global $wgUser, $wgOut, $wgLang;
global $oldid, $diff; # From query
- global $wgLinkCache;
+ global $wgLinkCache, $IP;
$fname = "Article::view";
wfProfileIn( $fname );
# diff page instead of the article.
if ( isset( $diff ) ) {
+ include_once( "$IP/DifferenceEngine.php" );
$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
$de = new DifferenceEngine( $oldid, $diff );
$de->showDiffPage();
{
global $wgUser, $wgLang, $wgDebugComments, $wgCookieExpiration;
global $wgInputEncoding, $wgOutputEncoding, $wgLanguageCode;
+
+ $fname = "OutputPage::output";
+ wfProfileIn( $fname );
+
$sk = $wgUser->getSkin();
$this->sendCacheControl();
/* private */ function replaceVariables( $text )
{
global $wgLang;
- $fname = "OutputPage:replaceVariables";
+ $fname = "OutputPage::replaceVariables";
wfProfileIn( $fname );
/* As with sigs, use server's local time --
$prof .= sprintf( $titleFormat, "Name", "Calls", "Total", "Each", "%" );
$this->mCollated = array();
$this->mCalls = array();
- $total = 0;
# Estimate profiling overhead
$profileCount = count( $this->mStack );
+ wfProfileIn( "-overhead-total" );
for ($i=0; $i<$profileCount ; $i++) {
- wfProfileIn( "--profiling overhead--" );
- wfProfileOut( "--profiling overhead--" );
+ wfProfileIn( "-overhead-internal" );
+ wfProfileOut( "-overhead-internal" );
}
+ wfProfileOut( "-overhead-total" );
# Collate
foreach ( $this->mStack as $entry ) {
$elapsed = $end - $start;
$this->mCollated[$fname] += $elapsed;
$this->mCalls[$fname] ++;
-
- if ( $fname != "--profiling overhead--" ) {
- $total += $elapsed;
- }
}
-
- $overhead = $this->mCollated["--profiling overhead--"] / $this->mCalls["--profiling overhead--"];
-
+
+ $total = $this->mCollated["-total"];
+ $overhead = $this->mCollated["-overhead-internal"] / $profileCount;
+ $this->mCalls["-overhead-total"] = $profileCount;
+
# Output
foreach ( $this->mCollated as $fname => $elapsed ) {
$calls = $this->mCalls[$fname];
# Adjust for overhead
- if ( $fname != "--profiling overhead--" ) {
+ if ( $fname[0] != "-" ) {
$elapsed -= $overhead * $calls;
}
}
$wgProfiler = new Profiler();
+$wgProfiler->profileIn( "-total" );
?>
#
global $IP;
+
+if( !isset( $wgProfiling ) )
+ $wgProfiling = false;
+
+if ( $wgProfiling ) {
+ include_once( "$IP/Profiling.php" );
+} else {
+ function wfProfileIn( $fn ) {}
+ function wfProfileOut( $fn = "" ) {}
+ function wfGetProfilingOutput( $s, $e ) {}
+ function wfProfileClose() {}
+}
+
+$fname = "Setup.php";
+wfProfileIn( $fname );
+wfProfileIn( "$fname-includes" );
+
+# Only files which are used on every invocation should be included here
+# Otherwise, include them conditionally [TS]
include_once( "$IP/GlobalFunctions.php" );
include_once( "$IP/Namespace.php" );
include_once( "$IP/Skin.php" );
include_once( "$IP/OutputPage.php" );
-include_once( "$IP/DifferenceEngine.php" );
-include_once( "$IP/SearchEngine.php" );
include_once( "$IP/User.php" );
include_once( "$IP/LinkCache.php" );
include_once( "$IP/Title.php" );
include_once( "$IP/MemCachedClient.inc.php" );
include_once( "$IP/Block.php" );
+wfProfileOut( "$fname-includes" );
+wfProfileIn( "$fname-memcached" );
global $wgUser, $wgLang, $wgOut, $wgTitle;
global $wgArticle, $wgDeferredUpdateList, $wgLinkCache;
global $wgMemc, $wgMagicWords, $wgMwRedir, $wgDebugLogFile;
$wgUseMemCached = false;
}
}
+wfProfileOut( "$fname-memcached" );
+wfProfileIn( "$fname-misc" );
include_once( "$IP/Language.php" );
}
$wgLang = new $wgLangClass();
-if( !isset( $wgProfiling ) )
- $wgProfiling = false;
-
-if ( $wgProfiling ) {
- include_once( "$IP/Profiling.php" );
-} else {
- function wfProfileIn( $fn ) {}
- function wfProfileOut( $fn = "" ) {}
- function wfGetProfilingOutput( $s, $e ) {}
- function wfProfileClose() {}
-}
$wgUser = User::loadFromSession();
$wgDeferredUpdateList = array();
$wgLinkCache = new LinkCache();
$wgMagicWords = array();
$wgMwRedir =& MagicWord::get( MAG_REDIRECT );
+
+wfProfileOut( "$fname-misc" );
+wfProfileOut( $fname );
+
?>
global $wgUser, $wgOut, $wgLang;
$fname = "Skin::doAfterContent";
wfProfileIn( $fname );
+ wfProfileIn( "$fname-1" );
$s = "\n</div><br clear=all>\n";
-
$s .= "\n<div id='footer'>";
$s .= "<table width='98%' border=0 cellspacing=0><tr>";
+
+ wfProfileOut( "$fname-1" );
+ wfProfileIn( "$fname-2" );
$qb = $this->qbSetting();
$shove = ($qb != 0);
if ( $shove && $left ) { # Left
$s .= $this->getQuickbarCompensator();
}
+ wfProfileOut( "$fname-2" );
+ wfProfileIn( "$fname-3" );
$l = $wgLang->isRTL() ? "right" : "left";
$s .= "<td class='bottom' align='$l' valign='top'>";
$s .= $this->getQuickbarCompensator();
}
$s .= "</tr></table>\n</div>\n</div>\n";
-
+
+ wfProfileOut( "$fname-3" );
+ wfProfileIn( "$fname-4" );
if ( 0 != $qb ) { $s .= $this->quickBar(); }
+ wfProfileOut( "$fname-4" );
wfProfileOut( $fname );
return $s;
}
# otherwise the cache won't get updated properly. See LINKCACHE.DOC.
#
function makeLink( $title, $text = "", $query = "", $trail = "" ) {
- return $this->makeLinkObj( Title::newFromText( $title ), $text, $query, $trail );
+ wfProfileIn( "Skin::makeLink" );
+ $result = $this->makeLinkObj( Title::newFromText( $title ), $text, $query, $trail );
+ wfProfileOut( "Skin::makeLink" );
+ return $result;
}
function makeKnownLink( $title, $text = "", $query = "", $trail = "" ) {
function makeLinkObj( &$nt, $text= "", $query = "", $trail = "" )
{
global $wgOut, $wgUser;
- $fname = "Skin::makeLinkObj";
- wfProfileIn( $fname );
if ( $nt->isExternal() ) {
$u = $nt->getFullURL();
if ( "" == $text ) { $text = $nt->getPrefixedText(); }
}
}
}
- wfProfileOut( $fname );
return $retVal;
}
<?
-
#--------------------------------------------------------------------------
# Constants
#--------------------------------------------------------------------------
"ab" => "Apsua byzwa",
"ar" => "‮العربية‬",
"as" => "Asami",
- "av" => "Avara"
+ "av" => "Avara",
"ay" => "Aymara",
"az" => "Azerbacan",
- "bm" => "Bambankan"
+ "bm" => "Bambankan",
"ba" => "Baskort",
"be" => "Беларуски",
"bg" => "Bülgarski ezik",
"lv" => "Latviešu",
"ln" => "Lingala",
"lt" => "Lietuvių",
- 'lg" => "Luganda",
+ "lg" => "Luganda",
"hu" => "Magyar",
"mk" => "Makedonski",
"mg" => "Malagasy",
"tw" => "Twi",
"uk" => "Українська",
"ur" => "Urdu",
- "ve" => Tshivenda",
+ "ve" => "Tshivenda",
"vi" => "Tiêng Viêt Nam",
"vo" => "Volapük",
"wo" => "Wolof",
--- /dev/null
+<?
+
+# Checks translation of all language files
+
+function wfLocalUrl() { return "";}
+function wfLocalUrle() { return "";}
+
+function check($arrayname, $lang, $text)
+{
+ $arraynameprinted = 0;
+
+ global $count, $total;
+
+ $msgarray = $arrayname . ucfirst( $lang );
+ $msgarrayen = $arrayname . "En";
+
+ eval( $text );
+ if ( !is_array( $$msgarrayen ) ) {
+ print "\nArray '$msgarrayen' not present\n";
+ return;
+ } elseif ( !is_array( $$msgarray ) ) {
+ print "\nArray '$msgarray' not present\n";
+ return;
+ }
+
+ foreach ( $$msgarrayen as $code => $msg ) {
+ ++$total;
+
+ if ( ! array_key_exists( $code, $$msgarray ) ) {
+ if (!$arraynameprinted) {
+ print("\nIn array '$msgarray':\n");
+ $arraynameprinted = 1;
+ }
+
+ if ( is_numeric( $code ) ) {
+ print "$code ($msg)\n";
+ } else {
+ print "{$code}\n";
+ }
+ ++$count;
+ }
+ }
+}
+
+function getLanguage( $lang )
+{
+ $fileName = "../languages/Language" . ucfirst( $lang ) . ".php";
+ $file = fopen( $fileName, "r" );
+ $text = fread( $file, filesize( $fileName ) );
+ $clipPos = strpos( $text, "class Language" );
+ $text = substr( $text, 0, $clipPos );
+ $text = preg_replace( "/^<\?(php|)/", "", $text );
+ $text = preg_replace( "/^include.*$/m", "", $text );
+
+ return $text;
+}
+
+function checkLanguage( $lang, $enText )
+{
+ $text = $enText . getLanguage( $lang );
+ check("wgLanguageNames", $lang, $text);
+ check("wgNamespaceNames", $lang, $text);
+ check("wgDefaultUserOptions", $lang, $text);
+ check("wgQuickbarSettings", $lang, $text);
+ check("wgSkinNames", $lang, $text);
+ check("wgMathNames", $lang, $text);
+ check("wgUserToggles", $lang, $text);
+ check("wgWeekdayNames", $lang, $text);
+ check("wgMonthNames", $lang, $text);
+ check("wgMonthAbbreviations", $lang, $text);
+ check("wgValidSpecialPages", $lang, $text);
+ check("wgSysopSpecialPages", $lang, $text);
+ check("wgDeveloperSpecialPages", $lang, $text);
+ check("wgAllMessages", $lang, $text);
+}
+
+if ( $argc > 1 ) {
+ array_shift( $argv );
+ $glob = implode( " ", $argv );
+} else {
+ $glob = "../languages/Language?*.php";
+}
+
+umask( 000 );
+set_time_limit( 0 );
+$count = $total = 0;
+$enText = getLanguage( "" );
+$filenames = glob( $glob );
+$width = 80;
+foreach ( $filenames as $filename ) {
+ if ( preg_match( "/languages\/Language(.*)\.php/", $filename, $m ) ) {
+ $lang = strtolower( $m[1] );
+ if ( $lang != "utf8" ) {
+ print "\n" . str_repeat( "-", $width );
+ print "\n$lang\n";
+ print str_repeat( "-", $width ) . "\n";
+ checkLanguage( $lang, $enText );
+ }
+ }
+}
+
+print "\n" . str_repeat( "-", $width ) . "\n";
+print "{$count} messages of {$total} not translated.\n";
+
if ( -1 == $wgTitle->getNamespace() ) {
wfSpecialPage();
} else if ( "" != $search ) {
+ include_once( "$IP/SearchEngine.php" );
if($go) {
wfGo ($search);