*** empty log message ***
authorGabriel Wicke <gwicke@users.mediawiki.org>
Fri, 30 Jan 2004 16:06:22 +0000 (16:06 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Fri, 30 Jan 2004 16:06:22 +0000 (16:06 +0000)
includes/SquidUpdate.php [new file with mode: 0644]

diff --git a/includes/SquidUpdate.php b/includes/SquidUpdate.php
new file mode 100644 (file)
index 0000000..0c1e8b5
--- /dev/null
@@ -0,0 +1,34 @@
+<?
+# See deferred.doc
+
+class SquidUpdate {
+
+        function SquidUpdate( $title, $urlArr = Array() )
+        {
+                $this->title = $title;
+                $this->urlArr = $urlArr;
+        }
+
+
+        function doUpdate()
+        {
+                if (count( $this->urlArr ) == 0) { // newly created Article
+                        global $wgInternalServer;
+                        /* prepare the list of urls to purge */
+                        $id= $this->title->getArticleID();
+                        $sql = "SELECT l_from FROM links WHERE l_to={$id}" ;
+                        $res = wfQuery ( $sql, DB_READ ) ;
+                        while ( $BL = wfFetchObject ( $res ) )
+                        {
+                                $t = Title::newFromDBkey( $BL->l_from) ; 
+                                $this->urlArr[] = $wgInternalServer.wfLocalUrl( $t->getPrefixedURL() );
+                        }
+                        wfFreeResult ( $res ) ;
+
+        }
+
+        wfPurgeSquidServers($this->urlArr);
+}
+}
+
+?>