Aude has uploaded a new change for review.
https://gerrit.wikimedia.org/r/92863
Change subject: Split memcached for Wikibase diff view body content by lang
......................................................................
Split memcached for Wikibase diff view body content by lang
Bug: 55667
Change-Id: I3af6be0813ad1e4f1febb1fb16ec16f0bf76c050
---
M repo/includes/EntityContentDiffView.php
1 file changed, 15 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/63/92863/1
diff --git a/repo/includes/EntityContentDiffView.php
b/repo/includes/EntityContentDiffView.php
index 7968141..f419715 100644
--- a/repo/includes/EntityContentDiffView.php
+++ b/repo/includes/EntityContentDiffView.php
@@ -40,7 +40,7 @@
//TODO: proper injection
$options = new FormatterOptions( array(
//TODO: fallback chain
- ValueFormatter::OPT_LANG =>
$this->getContext()->getLanguage()->getCode()
+ ValueFormatter::OPT_LANG =>
$this->getLanguage()->getCode()
) );
$this->propertyNameFormatter = new EntityIdLabelFormatter(
$options, WikibaseRepo::getDefaultInstance()->getEntityLookup() );
@@ -68,12 +68,12 @@
*
* @param $rev \Revision
* @param $complete String: 'complete' to get the header wrapped
depending
- * the visibility of the revision and a link to edit the page.
+ * the visibility of the revision and a link to edit the
page.
* @return String HTML fragment
*/
protected function getRevisionHeader( \Revision $rev, $complete = '' ) {
//NOTE: This must be kept in sync with the parent
implementation.
- // Perhaps some parts could be factored out to reduce code
duplication.
+ // Perhaps some parts could be factored out to reduce
code duplication.
$lang = $this->getLanguage();
$user = $this->getUser();
@@ -127,7 +127,7 @@
/**
* @var EntityContent $old
* @var EntityContent $new
- */
+ ~*/
$diff = $old->getEntity()->getDiff( $new->getEntity() );
// TODO: derp inject the EntityDiffVisualizer
@@ -155,4 +155,15 @@
return $parserOutput;
}
+ /**
+ * Returns the cache key for diff body text or content.
+ *
+ * @return string
+ */
+ protected function getDiffBodyCacheKey() {
+ return wfMemcKey( 'diff', 'version', MW_DIFF_VERSION,
+ 'oldid', $this->getOldid(), 'newid', $this->getNewid(),
+ 'lang', $this->getLanguage()->getCode() );
+ }
+
}
--
To view, visit https://gerrit.wikimedia.org/r/92863
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3af6be0813ad1e4f1febb1fb16ec16f0bf76c050
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits