/* private */ function insertNewArticle( $text, $summary, $isminor, $watchthis )
{
global $wgOut, $wgUser, $wgLinkCache, $wgMwRedir;
+ global $wgUseSquid, $wgDeferredUpdateList, $wgInternalServer;
$fname = "Article::insertNewArticle";
$sql = "UPDATE cur set cur_touched='$now' WHERE cur_namespace=$talkns AND cur_title='" . wfStrencode( $ttl ) . "'";
wfQuery( $sql, DB_WRITE );
+ # standard deferred updates
+ $this->editUpdates( $text );
+
+ # Squid purging
+ if ( $wgUseSquid ) {
+ $urlArr = Array(
+ $wgInternalServer.wfLocalUrl( $this->mTitle->getPrefixedURL())
+ );
+ wfPurgeSquidServers($urlArr);
+ /* this needs to be done after LinksUpdate */
+ $u = new SquidUpdate($this->mTitle);
+ array_push( $wgDeferredUpdateList, $u );
+ }
+
$this->showArticle( $text, wfMsg( "newarticle" ) );
}
{
global $wgOut, $wgUser, $wgLinkCache;
global $wgDBtransactions, $wgMwRedir;
+ global $wgUseSquid, $wgInternalServer;
$fname = "Article::updateArticle";
$this->loadLastEdit();
$this->unwatch();
}
}
+ # standard deferred updates
+ $this->editUpdates( $text );
+
+ # Squid updates
+
+ if ( $wgUseSquid ) {
+ $urlArr = Array(
+ $wgInternalServer.wfLocalUrl( $this->mTitle->getPrefixedURL())
+ );
+ wfPurgeSquidServers($urlArr);
+ }
$this->showArticle( $text, wfMsg( "updated" ) );
return true;
$wgOut = new OutputPage();
$wgOut->addWikiText( $text );
- $this->editUpdates( $text );
if( $wgMwRedir->matchStart( $text ) )
$r = "redirect=no";
else
function doDeleteArticle( $title )
{
- global $wgUser, $wgOut, $wgLang, $wpReason, $wgDeferredUpdateList;
+ global $wgUser, $wgOut, $wgLang, $wpReason;
+ global $wgUseSquid, $wgDeferredUpdateList, $wgInternalServer;
$fname = "Article::doDeleteArticle";
wfDebug( "$fname\n" );
$u = new SiteStatsUpdate( 0, 1, -$this->isCountable( $this->getContent( true ) ) );
array_push( $wgDeferredUpdateList, $u );
+
+ # Squid purging
+ if ( $wgUseSquid ) {
+ $urlArr = Array(
+ $wgInternalServer.wfLocalUrl( $this->mTitle->getPrefixedURL())
+ );
+ wfPurgeSquidServers($urlArr);
+
+ /* prepare the list of urls to purge */
+ $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) ;
+ $blurlArr[] = $wgInternalServer.wfLocalUrl( $t->getPrefixedURL() );
+ }
+ wfFreeResult ( $res ) ;
+ $u = new SquidUpdate( $this->mTitle, $blurlArr );
+ array_push( $wgDeferredUpdateList, $u );
+
+ }
+
+
# Move article and history to the "archive" table
$sql = "INSERT INTO archive (ar_namespace,ar_title,ar_text," .
global $wgOut, $wgUser, $wgLang;
global $wpNewTitle, $wpOldTitle, $wpMovetalk, $target;
global $wgDeferredUpdateList, $wgMessageCache;
+ global $wgUseSquid, $wgInternalServer;
$fname = "MovePageForm::doSubmit";
$this->ot = Title::newFromText( $wpOldTitle );
$u->doUpdate();
$u = new SearchUpdate( $this->newid, $this->ot->getPrefixedDBkey(), "" );
$u->doUpdate();
+
+ # Squid purging
+ if ( $wgUseSquid ) {
+ /* this needs to be done after LinksUpdate */
+ $urlArr = Array(
+ # purge new title
+ $wgInternalServer.wfLocalUrl( $this->nt->getPrefixedURL()),
+ # purge old title
+ $wgInternalServer.wfLocalUrl( $this->ot->getPrefixedURL())
+ );
+ wfPurgeSquidServers($urlArr);
+ # purge pages linking to new title
+ $u = new SquidUpdate($this->nt);
+ array_push( $wgDeferredUpdateList, $u );
+ # purge pages linking to old title
+ $u = new SquidUpdate($this->ot);
+ array_push( $wgDeferredUpdateList, $u );
+
+
+ }
# Move talk page if (1) the checkbox says to, (2) the source
# and target namespaces are identical, (3) the namespaces are not
$u->doUpdate();
$u = new SearchUpdate( $this->newid, $this->ot->getPrefixedDBkey(), "" );
$u->doUpdate();
+
+ # Squid purging
+ if ( $wgUseSquid ) {
+ /* this needs to be done after LinksUpdate */
+ $urlArr = Array(
+ # purge new title
+ $wgInternalServer.wfLocalUrl( $this->nt->getPrefixedURL()),
+ # purge old title
+ $wgInternalServer.wfLocalUrl( $this->ot->getPrefixedURL())
+ );
+ wfPurgeSquidServers($urlArr);
+ # purge pages linking to new title
+ $u = new SquidUpdate($this->nt);
+ array_push( $wgDeferredUpdateList, $u );
+ # purge pages linking to old title
+ $u = new SquidUpdate($this->ot);
+ array_push( $wgDeferredUpdateList, $u );
+
+
+ }
}
}
$success = wfLocalUrl( $wgLang->specialPage( "Movepage" ),
/* private */ function doUndeleteArticle( $namespace, $title )
{
global $wgUser, $wgOut, $wgLang, $target, $wgDeferredUpdateList;
+ global $wgUseSquid, $wgInternalServer;
$fname = "doUndeleteArticle";
Article::onArticleCreate( $to );
+ # Squid purging
+ if ( $wgUseSquid ) {
+ /* this needs to be done after LinksUpdate */
+ $u = new SquidUpdate($to);
+ array_push( $wgDeferredUpdateList, $u );
+ }
+
#TODO: SearchUpdate, etc.
}