Initial import; Bengali (incomplete) from meta
[mediawiki.git] / includes / SquidUpdate.php
blobdeaa55b7915505d52b3338057a0e1aaf84442625
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.wfLocalUrl( $t->getPrefixedURL() );
26 wfFreeResult ( $res ) ;
30 wfPurgeSquidServers($this->urlArr);