*** empty log message ***
[lhc/web/wiklou.git] / includes / SquidUpdate.php
1 <?
2 # See deferred.doc
3
4 class SquidUpdate {
5
6 function SquidUpdate( $title, $urlArr = Array() )
7 {
8 $this->title = $title;
9 $this->urlArr = $urlArr;
10 }
11
12
13 function doUpdate()
14 {
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 ) )
22 {
23 $t = Title::newFromDBkey( $BL->l_from) ;
24 $this->urlArr[] = $wgInternalServer.wfLocalUrl( $t->getPrefixedURL() );
25 }
26 wfFreeResult ( $res ) ;
27
28 }
29
30 wfPurgeSquidServers($this->urlArr);
31 }
32 }
33
34 ?>