Add rest.php (REST API endpoint) with feature flag
[lhc/web/wiklou.git] / includes / Rest / EntryPoint.php
index 40d0b4a..a14c1a1 100644 (file)
@@ -32,6 +32,12 @@ class EntryPoint {
                $services = MediaWikiServices::getInstance();
                $conf = $services->getMainConfig();
 
+               if ( !$conf->get( 'EnableRestAPI' ) ) {
+                       wfHttpError( 403, 'Access Denied',
+                               'Set $wgEnableRestAPI to true to enable the experimental REST API' );
+                       return;
+               }
+
                $request = new RequestFromGlobals( [
                        'cookiePrefix' => $conf->get( 'CookiePrefix' )
                ] );