diff options
author | Brion Vibber <brion@users.mediawiki.org> | 2004-06-13 01:15:16 +0000 |
---|---|---|
committer | Brion Vibber <brion@users.mediawiki.org> | 2004-06-13 01:15:16 +0000 |
commit | 1d6017272668b85e6944039381854a3851b6ae01 (patch) | |
tree | 04f07e820d7f8ee252fbe5c1b1f8f0b84a3ab95b /includes/LinkCache.php | |
parent | aeac600626ab9b92f8c09c919ba05f1e62d19cd8 (diff) | |
download | mediawikicore-1d6017272668b85e6944039381854a3851b6ae01.tar.gz mediawikicore-1d6017272668b85e6944039381854a3851b6ae01.zip |
Merge 1.3.0beta3 from HEAD
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/4051
Diffstat (limited to 'includes/LinkCache.php')
-rw-r--r-- | includes/LinkCache.php | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/includes/LinkCache.php b/includes/LinkCache.php index d2e188003cf2..4f7b03a227fa 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -302,34 +302,51 @@ class LinkCache { } /* private */ function saveToLinkscc( $pid ){ - global $wgCompressedPersistentLC; + global $wgCompressedPersistentLC, $wgIsMySQL; if( $wgCompressedPersistentLC and function_exists( "gzcompress" ) ) { $ser = wfStrencode( gzcompress( serialize( $this ), 3 )); } else { $ser = wfStrencode( serialize( $this ) ); } - wfQuery("REPLACE INTO linkscc(lcc_pageid,lcc_cacheobj) " . - "VALUES({$pid}, '{$ser}')", DB_WRITE); + if ($wgIsMySQL) { + wfQuery("REPLACE INTO linkscc(lcc_pageid,lcc_cacheobj) " . + "VALUES({$pid}, '{$ser}')", DB_WRITE); + } else { + wfQuery("DELETE FROM linkscc WHERE lcc_pageid={$pid}",DB_WRITE); + wfQuery("INSERT INTO linkscc(lcc_pageid,lcc_cacheobj) " . + "VALUES({$pid}, '{$ser}')", DB_WRITE); + } } # $pid is a page id /* static */ function linksccClearLinksTo( $pid ){ - global $wgEnablePersistentLC; + global $wgEnablePersistentLC, $wgIsMySQL; if ( $wgEnablePersistentLC ) { $pid = intval( $pid ); - wfQuery("DELETE linkscc FROM linkscc,links ". - "WHERE lcc_pageid=links.l_from AND l_to={$pid}", DB_WRITE); - wfQuery("DELETE FROM linkscc WHERE lcc_pageid='{$pid}'", DB_WRITE); + if ($wgIsMySQL) { + wfQuery("DELETE linkscc FROM linkscc,links ". + "WHERE lcc_pageid=links.l_from AND l_to={$pid}", DB_WRITE); + } else { + wfQuery("DELETE FROM linkscc WHERE lcc_pageid IN ". + "(SELECT l_from FROM links WHERE l_to={$pid}", DB_WRITE); + } + wfQuery("DELETE FROM linkscc WHERE lcc_pageid='{$pid}')", DB_WRITE); } } # $title is a prefixed db title, for example like Title->getPrefixedDBkey() returns. /* static */ function linksccClearBrokenLinksTo( $title ){ - global $wgEnablePersistentLC; + global $wgEnablePersistentLC,$wgIsMySQL; if ( $wgEnablePersistentLC ) { $title = wfStrencode( $title ); - wfQuery("DELETE linkscc FROM linkscc,brokenlinks ". - "WHERE lcc_pageid=bl_from AND bl_to='{$title}'", DB_WRITE); + if ($wgIsMySQL) { + wfQuery("DELETE linkscc FROM linkscc,brokenlinks ". + "WHERE lcc_pageid=bl_from AND bl_to='{$title}'", DB_WRITE); + } else { + wfQuery("DELETE FROM linkscc WHERE lcc_pageid IN ". + "(SELECT bl_from FROM brokenlinks ". + "WHERE bl_to='{$title}')",DB_WRITE); + } } } |