Consolidate with Title::getInternalURL() a bit
[lhc/web/wiklou.git] / includes / SquidUpdate.php
1 <?php
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 /* prepare the list of urls to purge */
17 $id= $this->title->getArticleID();
18 $sql = "SELECT l_from FROM links WHERE l_to={$id}" ;
19 $res = wfQuery ( $sql, DB_READ ) ;
20 while ( $BL = wfFetchObject ( $res ) )
21 {
22 $t = Title::newFromDBkey( $BL->l_from) ;
23 $this->urlArr[] = $t->getInternalURL() ;
24 }
25 wfFreeResult ( $res ) ;
26
27 }
28
29 wfPurgeSquidServers($this->urlArr);
30 }
31 }
32
33 ?>