Skip to content

Instantly share code, notes, and snippets.

@jdlrobson
Created October 6, 2017 21:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdlrobson/774bcb6869118b6f1034e1ae1814ce4d to your computer and use it in GitHub Desktop.
Save jdlrobson/774bcb6869118b6f1034e1ae1814ce4d to your computer and use it in GitHub Desktop.
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