Some changes to the link tables. They now all use a key on cur_id for the *_from...
[lhc/web/wiklou.git] / includes / SquidUpdate.php
1 <?php
2 # See deferred.doc
3
4 class SquidUpdate {
5 var $title, $urlArr;
6
7 function SquidUpdate( $title, $urlArr = Array() ) {
8 $this->title = $title;
9 $this->urlArr = $urlArr;
10 }
11
12
13 function doUpdate() {
14 if( count( $this->urlArr ) == 0) {
15 # newly created Article
16 # prepare the list of urls to purge
17 $id= $this->title->getArticleID();
18 $sql = "SELECT cur_namespace,cur_title FROM links,cur WHERE l_to={$id} AND l_from=cur_id" ;
19 $res = wfQuery( $sql, DB_READ );
20 while( $row = wfFetchObject ( $res ) ) {
21 $t = Title::MakeTitle( $row->cur_namespace, $row->cur_title );
22 $this->urlArr[] = $t->getInternalURL();
23 }
24 wfFreeResult( $res );
25 }
26
27 wfPurgeSquidServers( $this->urlArr );
28 }
29 }
30
31 ?>