Go to the documentation of this file.
40 global $wgMaxSquidPurgeTitles;
41 if ( $maxTitles ===
false ) {
42 $maxTitles = $wgMaxSquidPurgeTitles;
47 if ( count(
$urlArr ) > $maxTitles ) {
64 global $wgMaxSquidPurgeTitles;
67 # Get a list of URLs linking to this page
70 array(
'page_namespace',
'page_title' ),
72 'pl_namespace' =>
$title->getNamespace(),
73 'pl_title' =>
$title->getDBkey(),
76 $blurlArr =
$title->getSquidURLs();
77 if (
$res->numRows() <= $wgMaxSquidPurgeTitles ) {
80 $blurlArr[] = $tobj->getInternalURL();
97 global $wgMaxSquidPurgeTitles;
102 if ( $i++ > $wgMaxSquidPurgeTitles ) {
136 global $wgSquidServers, $wgHTCPRouting;
144 if ( $wgHTCPRouting ) {
153 $maxSocketsPerSquid = 8;
156 $urlsPerSocket = 400;
157 $socketsPerSquid = ceil( count(
$urlArr ) / $urlsPerSocket );
158 if ( $socketsPerSquid > $maxSocketsPerSquid ) {
159 $socketsPerSquid = $maxSocketsPerSquid;
163 $chunks = array_chunk(
$urlArr, ceil( count(
$urlArr ) / $socketsPerSquid ) );
164 foreach ( $wgSquidServers
as $server ) {
165 foreach ( $chunks
as $chunk ) {
167 foreach ( $chunk
as $url ) {
168 $client->queuePurge( $url );
170 $pool->addClient( $client );
185 global $wgHTCPRouting, $wgHTCPMulticastTTL;
192 if ( !defined(
"IPPROTO_IP" ) ) {
193 define(
"IPPROTO_IP", 0 );
194 define(
"IP_MULTICAST_LOOP", 34 );
195 define(
"IP_MULTICAST_TTL", 33 );
199 $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
201 $errstr = socket_strerror( socket_last_error() );
203 ": Error opening UDP socket: $errstr" );
210 socket_set_option( $conn, IPPROTO_IP, IP_MULTICAST_LOOP, 0 );
211 if ( $wgHTCPMulticastTTL != 1 ) {
213 socket_set_option( $conn, IPPROTO_IP, IP_MULTICAST_TTL,
214 $wgHTCPMulticastTTL );
225 if ( !is_string( $url ) ) {
233 "No HTCP rule configured for URL {$url} , skipping" );
237 if ( isset( $conf[
'host'] ) && isset( $conf[
'port'] ) ) {
239 $conf =
array( $conf );
241 foreach ( $conf
as $subconf ) {
242 if ( !isset( $subconf[
'host'] ) || !isset( $subconf[
'port'] ) ) {
244 throw new MWException(
"Invalid HTCP rule for URL $url\n" );
251 $htcpTransID = current( $ids );
254 $htcpSpecifier = pack(
'na4na*na8n',
255 4,
'HEAD', strlen( $url ), $url,
258 $htcpDataLen = 8 + 2 + strlen( $htcpSpecifier );
259 $htcpLen = 4 + $htcpDataLen + 2;
264 $htcpPacket = pack(
'nxxnCxNxxa*n',
265 $htcpLen, $htcpDataLen, $htcpOpCLR,
266 $htcpTransID, $htcpSpecifier, 2 );
269 "Purging URL $url via HTCP" );
270 foreach ( $conf
as $subconf ) {
271 socket_sendto( $conn, $htcpPacket, $htcpLen, 0,
272 $subconf[
'host'], $subconf[
'port'] );
292 public static function expand( $url ) {
303 foreach ( $rules
as $regex => $routing ) {
304 if ( $regex ===
'' || preg_match( $regex, $url ) ) {
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
__construct( $urlArr=array(), $maxTitles=false)
static getRuleForURL( $url, $rules)
Find the HTCP routing rule to use for a given URL.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
wfDebugLog( $logGroup, $text, $dest='all')
Send a line to a supplementary debug log file, if configured, or main debug log if not.
wfProfileIn( $functionname)
Begin profiling of a function.
static expand( $url)
Expand local URLs to fully-qualified URLs using the internal protocol and host defined in $wgInternal...
An HTTP 1.0 client built for the purposes of purging Squid and Varnish.
static newSimplePurge(Title $title)
static newFromTitles( $titles, $urlArr=array())
Create a SquidUpdate from an array of Title objects, or a TitleArray object.
static HTCPPurge( $urlArr)
Send Hyper Text Caching Protocol (HTCP) CLR requests.
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles
static purge( $urlArr)
Purges a list of Squids defined in $wgSquidServers.
wfProfileOut( $functionname='missing')
Stop profiling of a function.
static newFromLinksTo(Title $title)
Create a SquidUpdate from the given Title object.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
Handles purging appropriate Squid URLs given a title (or titles)
presenting them properly to the user as errors is done by the caller $title
array $urlArr
Collection of URLs to purge.
doUpdate()
Purges the list of URLs passed to the constructor.
Represents a title within MediaWiki.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static newSequentialPerNodeIDs( $bucket, $bits, $count, $flags=0)
Return IDs that are sequential only for this node and bucket.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.