http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82902
Revision: 82902
Author: demon
Date: 2011-02-27 17:36:01 +0000 (Sun, 27 Feb 2011)
Log Message:
-----------
Bunch of $fName -> __METHOD__
Modified Paths:
--------------
trunk/extensions/MWSearch/MWSearch_body.php
trunk/extensions/MWSearch/luceneUpdate.php
Modified: trunk/extensions/MWSearch/MWSearch_body.php
===================================================================
--- trunk/extensions/MWSearch/MWSearch_body.php 2011-02-27 17:22:06 UTC (rev
82901)
+++ trunk/extensions/MWSearch/MWSearch_body.php 2011-02-27 17:36:01 UTC (rev
82902)
@@ -62,12 +62,11 @@
*/
function replacePrefixes( $query ) {
global $wgContLang, $wgLuceneUseRelated;
- $fname = 'LuceneSearch::replacePrefixes';
- wfProfileIn($fname);
+ wfProfileIn( __METHOD__ );
// quick check, most of the time we don't need any rewriting
if(strpos($query,':')===false){
- wfProfileOut($fname);
+ wfProfileOut( __METHOD__ );
return $query;
}
@@ -79,7 +78,7 @@
if($wgLuceneUseRelated && strncmp($query, $relatedkey,
strlen($relatedkey)) == 0){
$this->related = true;
list($dummy,$ret) = explode(":",$query,2);
- wfProfileOut($fname);
+ wfProfileOut( __METHOD__ );
return trim($ret);
}
@@ -115,7 +114,7 @@
$rewritten .= str_replace($allkeyword.':',
'all:', $r);
}
}
- wfProfileOut($fname);
+ wfProfileOut( __METHOD__ );
return $rewritten;
}
@@ -429,7 +428,7 @@
$limit = 20, $offset = 0, $searchAll = False ) {
$fname = 'LuceneSearchSet::newFromQuery';
- wfProfileIn( $fname );
+ wfProfileIn( __METHOD__ );
global $wgLuceneHost, $wgLucenePort, $wgDBname, $wgMemc;
global $wgLuceneSearchVersion, $wgLuceneSearchCacheExpiry;
@@ -465,8 +464,8 @@
$key = "$wgDBname:lucene:" . md5( $searchUrl );
$resultSet = $wgMemc->get( $key );
if( is_object( $resultSet ) ) {
- wfDebug( "$fname: got cached lucene results for
key $key\n" );
- wfProfileOut( $fname );
+ wfDebug( __METHOD__ . ": got cached lucene
results for key $key\n" );
+ wfProfileOut( __METHOD__ );
return $resultSet;
}
}
@@ -477,13 +476,14 @@
wfDebug( "Fetching search data from $searchUrl\n" );
wfSuppressWarnings();
- wfProfileIn( $fname.'-contact-'.$host );
+ $httpProfile = __METHOD__ . '-contact-' . $host;
+ wfProfileIn( $httpProfile );
$data = Http::get( $searchUrl, $wgLuceneSearchTimeout,
$httpOpts);
- wfProfileOut( $fname.'-contact-'.$host );
+ wfProfileOut( $httpProfile );
wfRestoreWarnings();
if( $data === false ) {
// Network error or server error
- wfProfileOut( $fname );
+ wfProfileOut( __METHOD__ );
return null;
} else {
$inputLines = explode( "\n", trim( $data ) );
@@ -535,11 +535,11 @@
$suggestion, $info, $interwiki );
if($wgLuceneSearchCacheExpiry > 0){
- wfDebug( "$fname: caching lucene results for key
$key\n" );
+ wfDebug( __METHOD__ . ": caching lucene results for key
$key\n" );
$wgMemc->add( $key, $resultSet,
$wgLuceneSearchCacheExpiry );
}
- wfProfileOut( $fname );
+ wfProfileOut( __METHOD__ );
return $resultSet;
}
Modified: trunk/extensions/MWSearch/luceneUpdate.php
===================================================================
--- trunk/extensions/MWSearch/luceneUpdate.php 2011-02-27 17:22:06 UTC (rev
82901)
+++ trunk/extensions/MWSearch/luceneUpdate.php 2011-02-27 17:36:01 UTC (rev
82902)
@@ -245,12 +245,11 @@
}
function rebuildAll() {
- $fname = 'LuceneBuilder::rebuildAll';
global $wgDBname;
$lastError = true;
- $maxId = $this->db->selectField( 'page', 'MAX(page_id)', '',
$fname );
+ $maxId = $this->db->selectField( 'page', 'MAX(page_id)', '',
__METHOD__ );
$maxId -= $this->offset; // hack for percentages
$this->init( $maxId );
if( $maxId < 1 ) {
@@ -266,7 +265,7 @@
$result = $this->dbstream->select( array( 'page' ),
array( 'page_namespace', 'page_title', 'page_latest' ),
'',
- $fname,
+ __METHOD__,
$limit );
$errorCount = 0;
@@ -306,7 +305,6 @@
*/
function rebuildDeleted( $since = null ) {
global $wgDBname;
- $fname = 'LuceneBuilder::rebuildDeleted';
if( is_null( $since ) ) {
$since = '20010115000000';
@@ -325,7 +323,7 @@
ON log_namespace=page_namespace AND
log_title=page_title
WHERE log_type='delete'
AND log_timestamp > $cutoff
- AND page_namespace IS NULL", $fname );
+ AND page_namespace IS NULL", __METHOD__ );
$max = $this->dbstream->numRows( $result );
if( $max == 0 ) {
@@ -359,8 +357,7 @@
*/
function rebuildRecent( $since = null ) {
global $wgDBname;
- $fname = 'LuceneBuilder::rebuildDeleted';
-
+
if( is_null( $since ) ) {
$since = '20010115000000';
}
@@ -379,7 +376,7 @@
AND rc_title=page_title
AND rc_this_oldid=page_latest
AND page_latest=rev_id
- AND rc_timestamp > $cutoff", $fname );
+ AND rc_timestamp > $cutoff", __METHOD__ );
#$max = $this->dbstream->numRows( $result );
$max = 10000; // wacky estimate
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs