Revert r35538:
[lhc/web/wiklou.git] / maintenance / purgeList.php
index 615d16b..ab8ff9f 100644 (file)
@@ -1,7 +1,9 @@
 <?php
-
 /**
  * Send purge requests for listed pages to squid
+ *
+ * @file
+ * @ingroup Maintenance
  */
 
 require_once( "commandLine.inc" );
@@ -11,12 +13,17 @@ $urls = array();
 
 while( !feof( $stdin ) ) {
        $page = trim( fgets( $stdin ) );
-       if( $page !== '' ) {
+       if ( substr( $page, 0, 7 ) == 'http://' ) {
+               $urls[] = $page;
+       } elseif( $page !== '' ) {
                $title = Title::newFromText( $page );
                if( $title ) {
                        $url = $title->getFullUrl();
                        echo "$url\n";
                        $urls[] = $url;
+                       if( isset( $options['purge'] ) ) {
+                               $title->invalidateCache();
+                       }
                } else {
                        echo "(Invalid title '$page')\n";
                }
@@ -29,4 +36,4 @@ $u->doUpdate();
 
 echo "Done!\n";
 
-?>
\ No newline at end of file
+