Catrope has uploaded a new change for review.
https://gerrit.wikimedia.org/r/200228
Change subject: Set RESTbase URL in SetupAfterCache hook
......................................................................
Set RESTbase URL in SetupAfterCache hook
We need $wgServerName, but that's not available yet when CommonSettings.php
is run, so defer setting the RESTbase URL until $wgServerName
is available.
Change-Id: Ia77763c9bc351c90fe585f3df714e8428ddeb664
---
M wmf-config/CommonSettings-labs.php
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config
refs/changes/28/200228/1
diff --git a/wmf-config/CommonSettings-labs.php
b/wmf-config/CommonSettings-labs.php
index a8dc38c..7cd1e44 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -85,7 +85,12 @@
// RESTbase connection configuration
if ( $wmgVisualEditorAccessRESTbaseDirectly ) {
- $wgVisualEditorRestbaseURL =
"https://restbase-beta.wmflabs.org/$wgServerName/v1/page/html/";
+ // HACK: $wgServerName is not available yet at this point, it's
set by Setup.php
+ // so use a hook
+ $wgHooks['SetupAfterCache'][] = function () {
+ global $wgServerName;
+ $wgVisualEditorRestbaseURL =
"https://restbase-beta.wmflabs.org/$wgServerName/v1/page/html/";
+ };
}
}
--
To view, visit https://gerrit.wikimedia.org/r/200228
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia77763c9bc351c90fe585f3df714e8428ddeb664
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits