wiki.techinc.nl/includes/SquidUpdate.php

34 lines
642 B
PHP
Raw Normal View History

<?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) ;
$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
}
?>