2004-02-18 02:15:00 +00:00
|
|
|
<?php
|
2004-01-30 16:06:22 +00:00
|
|
|
# See deferred.doc
|
|
|
|
|
|
|
|
|
|
class SquidUpdate {
|
|
|
|
|
|
2004-03-08 09:43:36 +00:00
|
|
|
function SquidUpdate( $title, $urlArr = Array() )
|
|
|
|
|
{
|
|
|
|
|
$this->title = $title;
|
|
|
|
|
$this->urlArr = $urlArr;
|
|
|
|
|
}
|
2004-01-30 16:06:22 +00:00
|
|
|
|
|
|
|
|
|
2004-03-08 09:43:36 +00:00
|
|
|
function doUpdate()
|
|
|
|
|
{
|
|
|
|
|
if (count( $this->urlArr ) == 0) { // newly created Article
|
|
|
|
|
/* prepare the list of urls to purge */
|
|
|
|
|
$id= $this->title->getArticleID();
|
|
|
|
|
$sql = "SELECT l_from FROM links WHERE l_to={$id}" ;
|
|
|
|
|
$res = wfQuery ( $sql, DB_READ ) ;
|
|
|
|
|
while ( $BL = wfFetchObject ( $res ) )
|
|
|
|
|
{
|
|
|
|
|
$t = Title::newFromDBkey( $BL->l_from) ;
|
2004-03-08 09:51:11 +00:00
|
|
|
$this->urlArr[] = $t->getInternalURL() ;
|
2004-03-08 09:43:36 +00:00
|
|
|
}
|
|
|
|
|
wfFreeResult ( $res ) ;
|
2004-01-30 16:06:22 +00:00
|
|
|
|
2004-03-08 09:43:36 +00:00
|
|
|
}
|
2004-01-30 16:06:22 +00:00
|
|
|
|
2004-03-08 09:43:36 +00:00
|
|
|
wfPurgeSquidServers($this->urlArr);
|
|
|
|
|
}
|
2004-01-30 16:06:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|