diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2007-01-11 19:06:07 +0000 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2007-01-11 19:06:07 +0000 |
commit | a58285fd06c8113c45377c655dd43cef6337e815 (patch) | |
tree | dfe31d3d12652352fe44890b4811eda0728faefb /maintenance/purgeList.php | |
parent | 20194986f6638233732ba1fc3e838f117d3cc9ea (diff) |
Aktualisierung auf MediaWiki 1.9.0
Diffstat (limited to 'maintenance/purgeList.php')
-rw-r--r-- | maintenance/purgeList.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/maintenance/purgeList.php b/maintenance/purgeList.php new file mode 100644 index 00000000..9bf7c1bf --- /dev/null +++ b/maintenance/purgeList.php @@ -0,0 +1,34 @@ +<?php + +/** + * Send purge requests for listed pages to squid + */ + +require_once( "commandLine.inc" ); + +$stdin = fopen( "php://stdin", "rt" ); +$urls = array(); + +while( !feof( $stdin ) ) { + $page = trim( fgets( $stdin ) ); + if ( substr( $page, 0, 7 ) == 'http://' ) { + $urls[] = $page; + } elseif( $page !== '' ) { + $title = Title::newFromText( $page ); + if( $title ) { + $url = $title->getFullUrl(); + echo "$url\n"; + $urls[] = $url; + } else { + echo "(Invalid title '$page')\n"; + } + } +} + +echo "Purging " . count( $urls ) . " urls...\n"; +$u = new SquidUpdate( $urls ); +$u->doUpdate(); + +echo "Done!\n"; + +?> |