Created
October 6, 2017 21:35
-
-
Save jdlrobson/774bcb6869118b6f1034e1ae1814ce4d to your computer and use it in GitHub Desktop.
Make collections work locally. See also https://www.mediawiki.org/wiki/User:Polishdeveloper/BetaCluster_Restbase_access_on_localhost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/includes/BookRenderingMediator.php b/includes/BookRenderingMediator.php | |
index 9d30550..400aec7 100644 | |
--- a/includes/BookRenderingMediator.php | |
+++ b/includes/BookRenderingMediator.php | |
@@ -192,10 +192,7 @@ class BookRenderingMediator implements LoggerAwareInterface { | |
'electron' => ElectronVirtualRestService::class, | |
]; | |
foreach ( $modules as $module => $class ) { | |
- if ( !isset( $config['modules'][$module] ) ) { | |
- throw new Exception( "VirtualRESTService module $module is not configured propely" ); | |
- } | |
- $params = $config['modules'][$module]; | |
+ $params = []; | |
if ( isset( $config['global'] ) ) { | |
$params += $config['global']; | |
} | |
diff --git a/includes/DataProvider.php b/includes/DataProvider.php | |
index 7e5cd5c..7c54cc6 100644 | |
--- a/includes/DataProvider.php | |
+++ b/includes/DataProvider.php | |
@@ -59,10 +59,8 @@ class DataProvider implements LoggerAwareInterface { | |
$linkBatch->execute(); | |
$requests = array_map( function ( array $item, Title $title ) { | |
- $url = '/restbase/local/v1/page/html/' . wfUrlencode( $title->getPrefixedDBkey() ); | |
- if ( isset( $item['revision'] ) ) { | |
- $url .= '/' . $item['revision']; | |
- } | |
+ $url = 'http://localhost:8080/api/rest_v1/page/html/' . wfUrlencode( $title->getPrefixedDBkey() ); | |
+ | |
return [ | |
'method' => 'GET', | |
'url' => $url, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment