X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdeferred%2FSquidUpdate.php;h=d4fc7a006ab7ce1f223ea06d746a88213530e4f8;hb=73a1b801e6627d5be2d01804674f8b21abb31806;hp=85592e87bd158ac49975a6f22ed82a2123ae97d4;hpb=807d510ad7353ae4adee736eb6f4b34890761114;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/deferred/SquidUpdate.php b/includes/deferred/SquidUpdate.php index 85592e87bd..d4fc7a006a 100644 --- a/includes/deferred/SquidUpdate.php +++ b/includes/deferred/SquidUpdate.php @@ -51,41 +51,6 @@ class SquidUpdate { $this->urlArr = $urlArr; } - /** - * Create a SquidUpdate from the given Title object. - * - * The resulting SquidUpdate will purge the given Title's URLs as well as - * the pages that link to it. Capped at $wgMaxSquidPurgeTitles total URLs. - * - * @param Title $title - * @return SquidUpdate - */ - public static function newFromLinksTo( Title $title ) { - global $wgMaxSquidPurgeTitles; - wfProfileIn( __METHOD__ ); - - # Get a list of URLs linking to this page - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( array( 'links', 'page' ), - array( 'page_namespace', 'page_title' ), - array( - 'pl_namespace' => $title->getNamespace(), - 'pl_title' => $title->getDBkey(), - 'pl_from=page_id' ), - __METHOD__ ); - $blurlArr = $title->getSquidURLs(); - if ( $res->numRows() <= $wgMaxSquidPurgeTitles ) { - foreach ( $res as $BL ) { - $tobj = Title::makeTitle( $BL->page_namespace, $BL->page_title ); - $blurlArr[] = $tobj->getInternalURL(); - } - } - - wfProfileOut( __METHOD__ ); - - return new SquidUpdate( $blurlArr ); - } - /** * Create a SquidUpdate from an array of Title objects, or a TitleArray object * @@ -139,7 +104,7 @@ class SquidUpdate { return; } - wfDebugLog( 'squid', __METHOD__ . ': ' . implode( ' ', $urlArr ) . "\n" ); + wfDebugLog( 'squid', __METHOD__ . ': ' . implode( ' ', $urlArr ) ); if ( $wgHTCPRouting ) { self::HTCPPurge( $urlArr ); @@ -200,7 +165,7 @@ class SquidUpdate { if ( !$conn ) { $errstr = socket_strerror( socket_last_error() ); wfDebugLog( 'squid', __METHOD__ . - ": Error opening UDP socket: $errstr\n" ); + ": Error opening UDP socket: $errstr" ); wfProfileOut( __METHOD__ ); return; @@ -230,7 +195,7 @@ class SquidUpdate { $conf = self::getRuleForURL( $url, $wgHTCPRouting ); if ( !$conf ) { wfDebugLog( 'squid', __METHOD__ . - "No HTCP rule configured for URL {$url} , skipping\n" ); + "No HTCP rule configured for URL {$url} , skipping" ); continue; } @@ -266,7 +231,7 @@ class SquidUpdate { $htcpTransID, $htcpSpecifier, 2 ); wfDebugLog( 'squid', __METHOD__ . - "Purging URL $url via HTCP\n" ); + "Purging URL $url via HTCP" ); foreach ( $conf as $subconf ) { socket_sendto( $conn, $htcpPacket, $htcpLen, 0, $subconf['host'], $subconf['port'] );