* {{PLURAL:}} now handles formatted numbers correctly
[lhc/web/wiklou.git] / maintenance / purgeList.php
1 <?php
2
3 /**
4 * Send purge requests for listed pages to squid
5 */
6
7 require_once( "commandLine.inc" );
8
9 $stdin = fopen( "php://stdin", "rt" );
10 $urls = array();
11
12 while( !feof( $stdin ) ) {
13 $page = trim( fgets( $stdin ) );
14 if ( substr( $page, 0, 7 ) == 'http://' ) {
15 $urls[] = $page;
16 } elseif( $page !== '' ) {
17 $title = Title::newFromText( $page );
18 if( $title ) {
19 $url = $title->getFullUrl();
20 echo "$url\n";
21 $urls[] = $url;
22 } else {
23 echo "(Invalid title '$page')\n";
24 }
25 }
26 }
27
28 echo "Purging " . count( $urls ) . " urls...\n";
29 $u = new SquidUpdate( $urls );
30 $u->doUpdate();
31
32 echo "Done!\n";
33
34 ?>