r53855 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53854‎ | r53855 | r53856 >
Date:03:41, 28 July 2009
Author:brion
Status:ok (Comments)
Tags:
Comment:
Commit mysterious live hacks, apparently courtesy of Domas?
Modified paths:
  • /branches/wmf-deployment/StartProfiler.php (added) (history)
  • /branches/wmf-deployment/includes/specials/SpecialSearch.php (modified) (history)
  • /branches/wmf-deployment/maintenance/addwiki.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/maintenance/addwiki.php
@@ -63,7 +63,7 @@
6464 $stores = array();
6565 }
6666 if ( count( $stores ) ) {
67 - require_once( 'ExternalStoreDB.php' );
 67+ #require_once( 'ExternalStoreDB.php' );
6868 global $wgDBuser, $wgDBpassword, $wgExternalServers;
6969 foreach ( $stores as $storeURL ) {
7070 $m = array();
Index: branches/wmf-deployment/includes/specials/SpecialSearch.php
@@ -884,7 +884,7 @@
885885 if ( $resultsShown > 0 ) {
886886 if ( $totalNum > 0 ){
887887 $top = wfMsgExt('showingresultsheader', array( 'parseinline' ),
888 - $this->offset+1, $this->offset+$resultsShown, $totalNum, $term, $resultsShown );
 888+ $this->offset+1, $this->offset+$resultsShown, $totalNum, wfEscapeWikiText($term), $resultsShown );
889889 } elseif ( $resultsShown >= $this->limit ) {
890890 $top = wfShowingResults( $this->offset, $this->limit );
891891 } else {
Index: branches/wmf-deployment/StartProfiler.php
@@ -0,0 +1,51 @@
 2+<?php
 3+# WARNING: This file is publically viewable on the web. Do not put private data here.
 4+#
 5+$rand = mt_rand(0, 0x7fffffff);
 6+$host = @$_SERVER['HTTP_HOST'];
 7+
 8+/*if ( ( !($rand % 50) && $host == 'en.wikipedia.org' ) ||
 9+ ( !($rand % 50) && $host == 'commons.wikimedia.org') ||
 10+ ( !($rand % 50) && $host == 'de.wikipedia.org') ||
 11+ ( !($rand % 50) && $host == 'es.wikipedia.org') ||
 12+ ( !($rand % 1) && $host == 'test.wikipedia.org' ) ||
 13+ ( $host == 'zh.wikipedia.org' ) ||
 14+ ( !($rand % 10) && $host == 'ja.wikipedia.org' )
 15+) {*/
 16+if ( @$_SERVER['REQUEST_URI'] == '/w/index.php?title=United_States&action=submit' ) {
 17+ require_once( dirname(__FILE__).'/includes/ProfilerSimpleUDP.php' );
 18+ $wgProfiler = new ProfilerSimpleUDP;
 19+ $wgProfiler->setProfileID( 'bigpage' );
 20+} elseif (@defined($_REQUEST['forceprofile'])) {
 21+ require_once( dirname(__FILE__).'/includes/ProfilerSimpleText.php' );
 22+ $wgProfiler = new ProfilerSimpleText;
 23+ $wgProfiler->setProfileID( 'forced' );
 24+} elseif (@defined($_REQUEST['forcetrace'])) {
 25+ require_once( dirname(__FILE__).'/includes/ProfilerSimpleTrace.php' );
 26+ $wgProfiler = new ProfilerSimpleTrace;
 27+} elseif ( strpos( @$_SERVER['REQUEST_URI'], '/w/thumb.php' ) !== false ) {
 28+ require_once( dirname(__FILE__).'/includes/ProfilerSimpleUDP.php' );
 29+ $wgProfiler = new ProfilerSimpleUDP;
 30+ $wgProfiler->setProfileID( 'thumb' );
 31+} elseif ( !( $rand % 50 ) ) {
 32+ require_once( dirname(__FILE__).'/includes/ProfilerSimpleUDP.php' );
 33+ $wgProfiler = new ProfilerSimpleUDP;
 34+ if ( $host == 'en.wikipedia.org' ) {
 35+ $wgProfiler->setProfileID( 'enwiki' );
 36+ } elseif ( $host == 'de.wikipedia.org' ) {
 37+ $wgProfiler->setProfileID( 'dewiki' );
 38+ } else {
 39+ $wgProfiler->setProfileID( 'others' );
 40+ }
 41+ #$wgProfiler->setProfileID( 'all' );
 42+ #$wgProfiler->setMinimum(5 /* seconds */);
 43+}
 44+elseif ( defined( 'MW_FORCE_PROFILE' ) ) {
 45+ require_once( dirname(__FILE__).'/includes/Profiler.php' );
 46+ $wgProfiler = new Profiler;
 47+} else {
 48+ require_once( dirname(__FILE__).'/includes/ProfilerStub.php' );
 49+}
 50+
 51+
 52+
Property changes on: branches/wmf-deployment/StartProfiler.php
___________________________________________________________________
Added: svn:eol-style
153 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r56375Merge some changes & custom scripts back from old wmf-deployment branch:...brion17:46, 15 September 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   20:57, 14 September 2009

SpecialSearch.php and addwiki.php bits are already merged; just need the profiler.

Status & tagging log