* Remove linkscc table code, no longer used.
This commit is contained in:
parent
e0dd0777a4
commit
cb45389b9c
13 changed files with 12 additions and 155 deletions
|
|
@ -224,6 +224,7 @@ Various bugfixes, small features, and a few experimental things:
|
||||||
* (bug 2262) Hide math preferences when TeX is not enabled
|
* (bug 2262) Hide math preferences when TeX is not enabled
|
||||||
* (bug 2267) Don't generate thumbnail at the same size as the source image.
|
* (bug 2267) Don't generate thumbnail at the same size as the source image.
|
||||||
* Fix rebuildtextindex.inc for new schema
|
* Fix rebuildtextindex.inc for new schema
|
||||||
|
* Remove linkscc table code, no longer used.
|
||||||
|
|
||||||
|
|
||||||
=== Caveats ===
|
=== Caveats ===
|
||||||
|
|
|
||||||
|
|
@ -1099,7 +1099,7 @@ if ( \$wgCommandLineMode ) {
|
||||||
\$wgDBprefix = \"{$slconf['DBprefix']}\";
|
\$wgDBprefix = \"{$slconf['DBprefix']}\";
|
||||||
|
|
||||||
# If you're on MySQL 3.x, this next line must be FALSE:
|
# If you're on MySQL 3.x, this next line must be FALSE:
|
||||||
\$wgDBmysql4 = \$wgEnablePersistentLC = {$conf->DBmysql4};
|
\$wgDBmysql4 = {$conf->DBmysql4};
|
||||||
|
|
||||||
## Shared memory settings
|
## Shared memory settings
|
||||||
\$wgMainCacheType = $cacheType;
|
\$wgMainCacheType = $cacheType;
|
||||||
|
|
|
||||||
|
|
@ -2222,18 +2222,17 @@ class Article {
|
||||||
$u = new SquidUpdate( $urls );
|
$u = new SquidUpdate( $urls );
|
||||||
array_push( $wgPostCommitUpdateList, $u );
|
array_push( $wgPostCommitUpdateList, $u );
|
||||||
}
|
}
|
||||||
|
|
||||||
# Clear persistent link cache
|
|
||||||
LinkCache::linksccClearLinksTo( $title_obj );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onArticleDelete($title_obj) {
|
function onArticleDelete($title_obj) {
|
||||||
$title_obj->touchLinks();
|
$title_obj->touchLinks();
|
||||||
LinkCache::linksccClearLinksTo( $title_obj );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onArticleEdit($title_obj) {
|
function onArticleEdit($title_obj) {
|
||||||
LinkCache::linksccClearPage( $title_obj->getArticleID() );
|
// This would be an appropriate place to purge caches.
|
||||||
|
// Why's this not in here now?
|
||||||
}
|
}
|
||||||
|
|
||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -616,10 +616,6 @@ $wgUseCategoryMagic = true;
|
||||||
*/
|
*/
|
||||||
$wgUseCategoryBrowser = false;
|
$wgUseCategoryBrowser = false;
|
||||||
|
|
||||||
$wgEnablePersistentLC = false; # Obsolete, do not use
|
|
||||||
$wgCompressedPersistentLC = true; # use gzcompressed blobs
|
|
||||||
$wgUseOldExistenceCheck = false; # use old prefill link method, for debugging only
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keep parsed pages in a cache (objectcache table, turck, or memcached)
|
* Keep parsed pages in a cache (objectcache table, turck, or memcached)
|
||||||
* to speed up output of the same page viewed by another user with the
|
* to speed up output of the same page viewed by another user with the
|
||||||
|
|
|
||||||
|
|
@ -181,8 +181,6 @@ class LinkCache {
|
||||||
* @param Title $fromtitle
|
* @param Title $fromtitle
|
||||||
*/
|
*/
|
||||||
function preFill( &$fromtitle ) {
|
function preFill( &$fromtitle ) {
|
||||||
global $wgEnablePersistentLC;
|
|
||||||
|
|
||||||
$fname = 'LinkCache::preFill';
|
$fname = 'LinkCache::preFill';
|
||||||
wfProfileIn( $fname );
|
wfProfileIn( $fname );
|
||||||
|
|
||||||
|
|
@ -196,12 +194,6 @@ class LinkCache {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $wgEnablePersistentLC ) {
|
|
||||||
if( $this->fillFromLinkscc( $id ) ){
|
|
||||||
wfProfileOut( $fname );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( $this->mForUpdate ) {
|
if ( $this->mForUpdate ) {
|
||||||
$db =& wfGetDB( DB_MASTER );
|
$db =& wfGetDB( DB_MASTER );
|
||||||
$options = 'FOR UPDATE';
|
$options = 'FOR UPDATE';
|
||||||
|
|
@ -229,9 +221,6 @@ class LinkCache {
|
||||||
}
|
}
|
||||||
$this->mPreFilled = true;
|
$this->mPreFilled = true;
|
||||||
|
|
||||||
if ( $wgEnablePersistentLC ) {
|
|
||||||
$this->saveToLinkscc( $id );
|
|
||||||
}
|
|
||||||
wfProfileOut( $fname );
|
wfProfileOut( $fname );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -334,95 +323,6 @@ class LinkCache {
|
||||||
$this->mOldPageLinks = array();
|
$this->mOldPageLinks = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function fillFromLinkscc( $id ){
|
|
||||||
$fname = 'LinkCache::fillFromLinkscc';
|
|
||||||
|
|
||||||
$id = IntVal( $id );
|
|
||||||
if ( $this->mForUpdate ) {
|
|
||||||
$db =& wfGetDB( DB_MASTER );
|
|
||||||
$options = 'FOR UPDATE';
|
|
||||||
} else {
|
|
||||||
$db =& wfGetDB( DB_SLAVE );
|
|
||||||
$options = '';
|
|
||||||
}
|
|
||||||
$raw = $db->selectField( 'linkscc', 'lcc_cacheobj', array( 'lcc_pageid' => $id ), $fname, $options );
|
|
||||||
if ( $raw === false ) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$cacheobj = false;
|
|
||||||
if( function_exists( 'gzuncompress' ) )
|
|
||||||
$cacheobj = @gzuncompress( $raw );
|
|
||||||
|
|
||||||
if($cacheobj == FALSE){
|
|
||||||
$cacheobj = $raw;
|
|
||||||
}
|
|
||||||
$cc = @unserialize( $cacheobj );
|
|
||||||
if( isset( $cc->mClassVer ) and ($cc->mClassVer == $this->mClassVer ) ){
|
|
||||||
$this->mOldPageLinks = $this->mPageLinks = $cc->mPageLinks;
|
|
||||||
$this->mOldGoodLinks = $this->mGoodLinks = $cc->mGoodLinks;
|
|
||||||
$this->mOldBadLinks = $this->mBadLinks = $cc->mBadLinks;
|
|
||||||
$this->mPreFilled = true;
|
|
||||||
return TRUE;
|
|
||||||
} else {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function saveToLinkscc( $pid ){
|
|
||||||
global $wgCompressedPersistentLC;
|
|
||||||
if( $wgCompressedPersistentLC and function_exists( 'gzcompress' ) ) {
|
|
||||||
$ser = gzcompress( serialize( $this ), 3 );
|
|
||||||
} else {
|
|
||||||
$ser = serialize( $this );
|
|
||||||
}
|
|
||||||
$db =& wfGetDB( DB_MASTER );
|
|
||||||
$db->replace( 'linkscc', array( 'lcc_pageid' ), array( 'lcc_pageid' => $pid, 'lcc_cacheobj' => $ser ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete linkscc rows which link to here
|
|
||||||
* @param $title The page linked to
|
|
||||||
* @static
|
|
||||||
*/
|
|
||||||
function linksccClearLinksTo( $title ){
|
|
||||||
global $wgEnablePersistentLC;
|
|
||||||
if ( $wgEnablePersistentLC ) {
|
|
||||||
$fname = 'LinkCache::linksccClearLinksTo';
|
|
||||||
$pid = intval( $pid );
|
|
||||||
$dbw =& wfGetDB( DB_MASTER );
|
|
||||||
# Delete linkscc rows which link to here
|
|
||||||
$dbw->deleteJoin( 'linkscc', 'pagelinks', 'lcc_pageid', 'pl_from',
|
|
||||||
array(
|
|
||||||
'pl_namespace' => $title->getNamespace(),
|
|
||||||
'pl-title' => $title->getDbKey() ),
|
|
||||||
$fname );
|
|
||||||
# Delete linkscc row representing this page
|
|
||||||
$dbw->delete( 'linkscc', array( 'lcc_pageid' => $pid ), $fname);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $pid is a page id
|
|
||||||
* @static
|
|
||||||
*/
|
|
||||||
function linksccClearPage( $pid ){
|
|
||||||
global $wgEnablePersistentLC;
|
|
||||||
if ( $wgEnablePersistentLC ) {
|
|
||||||
$pid = intval( $pid );
|
|
||||||
$dbw =& wfGetDB( DB_MASTER );
|
|
||||||
$dbw->delete( 'linkscc', array( 'lcc_pageid' => $pid ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swaps old and current link registers
|
* Swaps old and current link registers
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class LinksUpdate {
|
||||||
|
|
||||||
function doUpdate() {
|
function doUpdate() {
|
||||||
global $wgUseDumbLinkUpdate, $wgLinkCache, $wgDBtransactions;
|
global $wgUseDumbLinkUpdate, $wgLinkCache, $wgDBtransactions;
|
||||||
global $wgEnablePersistentLC, $wgUseCategoryMagic;
|
global $wgUseCategoryMagic;
|
||||||
|
|
||||||
if ( $wgUseDumbLinkUpdate ) {
|
if ( $wgUseDumbLinkUpdate ) {
|
||||||
$this->doDumbUpdate();
|
$this->doDumbUpdate();
|
||||||
|
|
|
||||||
|
|
@ -97,11 +97,6 @@ if ( $wgCommandLineMode ) {
|
||||||
wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" );
|
wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
# Disable linkscc except if the old existence check method is enabled
|
|
||||||
if (!$wgUseOldExistenceCheck) {
|
|
||||||
$wgEnablePersistentLC = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $wgSkipSkin ) {
|
if ( $wgSkipSkin ) {
|
||||||
$wgSkipSkins[] = $wgSkipSkin;
|
$wgSkipSkins[] = $wgSkipSkin;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1652,10 +1652,6 @@ class Title {
|
||||||
'pl_title' => $this->getDbKey() ),
|
'pl_title' => $this->getDbKey() ),
|
||||||
$fname );
|
$fname );
|
||||||
|
|
||||||
# Clear linkscc
|
|
||||||
LinkCache::linksccClearLinksTo( $this );
|
|
||||||
LinkCache::linksccClearLinksTo( $nt );
|
|
||||||
|
|
||||||
# Purge squid
|
# Purge squid
|
||||||
if ( $wgUseSquid ) {
|
if ( $wgUseSquid ) {
|
||||||
$urls = array_merge( $nt->getSquidURLs(), $this->getSquidURLs() );
|
$urls = array_merge( $nt->getSquidURLs(), $this->getSquidURLs() );
|
||||||
|
|
@ -1722,7 +1718,7 @@ class Title {
|
||||||
$log = new LogPage( 'move' );
|
$log = new LogPage( 'move' );
|
||||||
$log->addEntry( 'move', $this, $reason, array( 1 => $nt->getPrefixedText()) );
|
$log->addEntry( 'move', $this, $reason, array( 1 => $nt->getPrefixedText()) );
|
||||||
|
|
||||||
# Purge squid and linkscc as per article creation
|
# Purge caches as per article creation
|
||||||
Article::onArticleCreate( $nt );
|
Article::onArticleCreate( $nt );
|
||||||
|
|
||||||
# Record the just-created redirect's linking to the page
|
# Record the just-created redirect's linking to the page
|
||||||
|
|
|
||||||
|
|
@ -130,13 +130,12 @@ class UtfUpdater {
|
||||||
*/
|
*/
|
||||||
function updateAll() {
|
function updateAll() {
|
||||||
$this->lockTables( array(
|
$this->lockTables( array(
|
||||||
'linkscc', 'objectcache', 'searchindex', 'querycache',
|
'objectcache', 'searchindex', 'querycache',
|
||||||
'ipblocks', 'user', 'page', 'revision', 'recentchanges',
|
'ipblocks', 'user', 'page', 'revision', 'recentchanges',
|
||||||
'brokenlinks', 'categorylinks', 'imagelinks', 'watchlist',
|
'brokenlinks', 'categorylinks', 'imagelinks', 'watchlist',
|
||||||
'image', 'oldimage', 'archive' ) );
|
'image', 'oldimage', 'archive' ) );
|
||||||
|
|
||||||
# These are safe to clear out:
|
# These are safe to clear out:
|
||||||
$this->clearTable( 'linkscc' );
|
|
||||||
$this->clearTable( 'objectcache' );
|
$this->clearTable( 'objectcache' );
|
||||||
|
|
||||||
# These need to be rebuild if used:
|
# These need to be rebuild if used:
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ $optionsWithArgs = array( 'regex' );
|
||||||
|
|
||||||
require_once( 'commandLine.inc' );
|
require_once( 'commandLine.inc' );
|
||||||
require_once( "$IP/includes/ObjectCache.php" );
|
require_once( "$IP/includes/ObjectCache.php" );
|
||||||
|
require_once( "$IP/includes/BagOStuff.php" );
|
||||||
require_once( "$IP/languages/LanguageUtf8.php" );
|
require_once( "$IP/languages/LanguageUtf8.php" );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -321,7 +322,7 @@ class ParserTest {
|
||||||
function listTables() {
|
function listTables() {
|
||||||
return array('user', 'page', 'revision', 'text',
|
return array('user', 'page', 'revision', 'text',
|
||||||
'pagelinks', 'imagelinks', 'categorylinks',
|
'pagelinks', 'imagelinks', 'categorylinks',
|
||||||
'linkscc', 'site_stats', 'hitcounter',
|
'site_stats', 'hitcounter',
|
||||||
'ipblocks', 'image', 'oldimage',
|
'ipblocks', 'image', 'oldimage',
|
||||||
'recentchanges',
|
'recentchanges',
|
||||||
'watchlist', 'math', 'searchindex',
|
'watchlist', 'math', 'searchindex',
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ define( "REPORTING_INTERVAL", 50 );
|
||||||
define( "PAUSE_INTERVAL", 50 );
|
define( "PAUSE_INTERVAL", 50 );
|
||||||
|
|
||||||
function refreshLinks( $start ) {
|
function refreshLinks( $start ) {
|
||||||
global $wgUser, $wgTitle, $wgArticle, $wgEnablePersistentLC, $wgLinkCache, $wgOut;
|
global $wgUser, $wgTitle, $wgArticle, $wgLinkCache, $wgOut;
|
||||||
|
|
||||||
$dbw =& wfGetDB( DB_MASTER );
|
$dbw =& wfGetDB( DB_MASTER );
|
||||||
|
|
||||||
|
|
@ -59,10 +59,6 @@ function refreshLinks( $start ) {
|
||||||
$wgOut->transformBuffer( RLH_FOR_UPDATE );
|
$wgOut->transformBuffer( RLH_FOR_UPDATE );
|
||||||
$wgOut->clearHTML();
|
$wgOut->clearHTML();
|
||||||
|
|
||||||
if ( $wgEnablePersistentLC ) {
|
|
||||||
$wgLinkCache->saveToLinkscc( $id, $dbw->strencode( $wgTitle->getPrefixedDBkey() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
$linksUpdate = new LinksUpdate( $id, $wgTitle->getPrefixedDBkey() );
|
$linksUpdate = new LinksUpdate( $id, $wgTitle->getPrefixedDBkey() );
|
||||||
$linksUpdate->doDumbUpdate();
|
$linksUpdate->doDumbUpdate();
|
||||||
$dbw->query("COMMIT");
|
$dbw->query("COMMIT");
|
||||||
|
|
|
||||||
|
|
@ -404,17 +404,6 @@ CREATE TABLE /*$wgDBprefix*/categorylinks (
|
||||||
|
|
||||||
) TYPE=InnoDB;
|
) TYPE=InnoDB;
|
||||||
|
|
||||||
--
|
|
||||||
-- Stores (possibly gzipped) serialized objects with
|
|
||||||
-- cache arrays to reduce database load slurping up
|
|
||||||
-- from links and brokenlinks.
|
|
||||||
--
|
|
||||||
CREATE TABLE /*$wgDBprefix*/linkscc (
|
|
||||||
lcc_pageid INT UNSIGNED NOT NULL UNIQUE KEY,
|
|
||||||
lcc_cacheobj MEDIUMBLOB NOT NULL
|
|
||||||
|
|
||||||
) TYPE=InnoDB;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Contains a single row with some aggregate info
|
-- Contains a single row with some aggregate info
|
||||||
-- on the state of the site.
|
-- on the state of the site.
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ $wgRenamedTables = array(
|
||||||
|
|
||||||
$wgNewTables = array(
|
$wgNewTables = array(
|
||||||
# table patch file (in maintenance/archives)
|
# table patch file (in maintenance/archives)
|
||||||
array( 'linkscc', 'patch-linkscc.sql' ),
|
|
||||||
array( 'hitcounter', 'patch-hitcounter.sql' ),
|
array( 'hitcounter', 'patch-hitcounter.sql' ),
|
||||||
array( 'querycache', 'patch-querycache.sql' ),
|
array( 'querycache', 'patch-querycache.sql' ),
|
||||||
array( 'objectcache', 'patch-objectcache.sql' ),
|
array( 'objectcache', 'patch-objectcache.sql' ),
|
||||||
|
|
@ -156,19 +155,6 @@ function do_index_update() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function do_linkscc_1_3_update() {
|
|
||||||
// Update linkscc table to 1.3 schema if necessary
|
|
||||||
global $wgDatabase, $wgVersion;
|
|
||||||
if( $wgDatabase->tableExists( "linkscc" )
|
|
||||||
&& $wgDatabase->fieldExists( "linkscc", "lcc_title" ) ) {
|
|
||||||
echo "Altering lcc_title field from linkscc table... ";
|
|
||||||
dbsource( "maintenance/archives/patch-linkscc-1.3.sql", $wgDatabase );
|
|
||||||
echo "ok\n";
|
|
||||||
} else {
|
|
||||||
echo "...linkscc is up to date, or does not exist. Good.\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_image_name_unique_update() {
|
function do_image_name_unique_update() {
|
||||||
global $wgDatabase;
|
global $wgDatabase;
|
||||||
if( $wgDatabase->indexExists( 'image', 'PRIMARY' ) ) {
|
if( $wgDatabase->indexExists( 'image', 'PRIMARY' ) ) {
|
||||||
|
|
@ -596,7 +582,6 @@ function do_all_updates() {
|
||||||
# Do schema updates which require special handling
|
# Do schema updates which require special handling
|
||||||
do_interwiki_update(); flush();
|
do_interwiki_update(); flush();
|
||||||
do_index_update(); flush();
|
do_index_update(); flush();
|
||||||
do_linkscc_1_3_update(); flush();
|
|
||||||
do_old_links_update(); flush();
|
do_old_links_update(); flush();
|
||||||
do_image_name_unique_update(); flush();
|
do_image_name_unique_update(); flush();
|
||||||
do_watchlist_update(); flush();
|
do_watchlist_update(); flush();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue