}
static function newFromLinksTo( &$title ) {
- $fname = 'SquidUpdate::newFromLinksTo';
- wfProfileIn( $fname );
+ wfProfileIn( __METHOD__ );
# Get a list of URLs linking to this page
$dbr = wfGetDB( DB_SLAVE );
'pl_namespace' => $title->getNamespace(),
'pl_title' => $title->getDBkey(),
'pl_from=page_id' ),
- $fname );
+ __METHOD__ );
$blurlArr = $title->getSquidURLs();
if ( $dbr->numRows( $res ) <= $this->mMaxTitles ) {
while ( $BL = $dbr->fetchObject ( $res ) )
}
$dbr->freeResult ( $res ) ;
- wfProfileOut( $fname );
+ wfProfileOut( __METHOD__ );
return new SquidUpdate( $blurlArr );
}
return SquidUpdate::HTCPPurge( $urlArr );
}
- $fname = 'SquidUpdate::purge';
- wfProfileIn( $fname );
+ wfProfileIn( __METHOD__ );
$maxsocketspersquid = 8; // socket cap per Squid
$urlspersocket = 400; // 400 seems to be a good tradeoff, opening a socket takes a while
@fclose($socket);
}
#$this->debug("\n");
- wfProfileOut( $fname );
+ wfProfileOut( __METHOD__ );
}
static function HTCPPurge( $urlArr ) {
global $wgHTCPMulticastAddress, $wgHTCPMulticastTTL, $wgHTCPPort;
- $fname = 'SquidUpdate::HTCPPurge';
- wfProfileIn( $fname );
+ wfProfileIn( __METHOD__ );
$htcpOpCLR = 4; // HTCP CLR
}
// pfsockopen doesn't work because we need set_sock_opt
- $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
+ $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
if ( $conn ) {
// Set socket options
socket_set_option( $conn, IPPROTO_IP, IP_MULTICAST_LOOP, 0 );
}
} else {
$errstr = socket_strerror( socket_last_error() );
- wfDebug( "SquidUpdate::HTCPPurge(): Error opening UDP socket: $errstr\n" );
+ wfDebug( __METHOD__ . "(): Error opening UDP socket: $errstr\n" );
}
- wfProfileOut( $fname );
+ wfProfileOut( __METHOD__ );
}
function debug( $text ) {