Oops, left debug output in
[mediawiki.git] / includes / SquidUpdate.php
blob669342d5f75c7754f6af9847f594f09bc3f4fcce
1 <?php
2 # See deferred.doc
4 class SquidUpdate {
6 function SquidUpdate( $title, $urlArr = Array() )
8 $this->title = $title;
9 $this->urlArr = $urlArr;
13 function doUpdate()
15 if (count( $this->urlArr ) == 0) { // newly created Article
16 global $wgInternalServer;
17 /* prepare the list of urls to purge */
18 $id= $this->title->getArticleID();
19 $sql = "SELECT l_from FROM links WHERE l_to={$id}" ;
20 $res = wfQuery ( $sql, DB_READ ) ;
21 while ( $BL = wfFetchObject ( $res ) )
23 $t = Title::newFromDBkey( $BL->l_from) ;
24 $this->urlArr[] = $wgInternalServer.$t->getURL() ;
26 wfFreeResult ( $res ) ;
30 wfPurgeSquidServers($this->urlArr);