After I made the modification of ModuleConfigForm.php, I get the following message :
Invalid MediaWiki API. The URL must resolve to a MediaWiki API endpoint and the MediaWiki version must be 1.30.0 or greater.
And this is not the case, because the version of our Mediawiki server is V1.31.1, as you can see in the rest of my message.
I tried to take a closer look and trace what was going on.
The problem seems to occur in the request function in Scripto/src/Mediawiki/apiClient.php,
public function request(array $params = [])
{
$params[âformatâ] = âjsonâ;
$params[âformatversionâ] = â2â;
$request = new Request;
$request->setUri($this->apiUrl);
$request->setMethod(Request::METHOD_POST);
$request->getPost()->fromArray($params);
$response = $this->httpClient->send($request);
if ($response->isSuccess()) {
return json_decode($response->getBody(), true);
}
throw new Exception\RequestException($response->renderStatusLine());
}
The contents of $request is :
POST http://vdomekas18.intra.inist.fr:40001/api.php HTTP/1.1
The contents of $responses is :
HTTP/1.0 404 Not Found
Date: Fri, 18 Dec 2020 08:43:03 GMT
Server: Apache/2.4.29 (Ubuntu)
Content-Length: 287
Content-Type: text/html; charset=iso-8859-1
X-Cache: MISS from proxyout.inist.fr
X-Cache-Lookup: MISS from proxyout.inist.fr:8080
Connection: close
404 Not Found
The requested URL was not found on this server.
Apache/2.4.29 (Ubuntu) Server at vdomekas18.intra.inist.fr Port 80
Or
Array ( [action] => query [meta] => siteinfo [format] => json [formatversion] => 2 ) Zend\Http\Response Object ( [recommendedReasonPhrases:protected] => Array ( [100] => Continue [101] => Switching Protocols [102] => Processing [200] => OK [201] => Created [202] => Accepted [203] => Non-Authoritative Information [204] => No Content [205] => Reset Content [206] => Partial Content [207] => Multi-status [208] => Already Reported [226] => IM Used [300] => Multiple Choices [301] => Moved Permanently [302] => Found [303] => See Other [304] => Not Modified [305] => Use Proxy [306] => Switch Proxy [307] => Temporary Redirect [308] => Permanent Redirect [400] => Bad Request [401] => Unauthorized [402] => Payment Required [403] => Forbidden [404] => Not Found [405] => Method Not Allowed [406] => Not Acceptable [407] => Proxy Authentication Required [408] => Request Time-out [409] => Conflict [410] => Gone [411] => Length Required [412] => Precondition Failed [413] => Request Entity Too Large [414] => Request-URI Too Long [415] => Unsupported Media Type [416] => Requested range not satisfiable [417] => Expectation Failed [418] => Iâm a teapot [422] => Unprocessable Entity [423] => Locked [424] => Failed Dependency [425] => Too Early [426] => Upgrade Required [428] => Precondition Required [429] => Too Many Requests [431] => Request Header Fields Too Large [444] => Connection Closed Without Response [451] => Unavailable For Legal Reasons [499] => Client Closed Request [500] => Internal Server Error [501] => Not Implemented [502] => Bad Gateway [503] => Service Unavailable [504] => Gateway Time-out [505] => HTTP Version not supported [506] => Variant Also Negotiates [507] => Insufficient Storage [508] => Loop Detected [510] => Not Extended [511] => Network Authentication Required [599] => Network Connect Timeout Error ) [statusCode:protected] => 404 [reasonPhrase:protected] => Not Found [version:protected] => 1.0 [headers:protected] => Zend\Http\Headers Object ( [pluginClassLoader:protected] => [headersKeys:protected] => Array ( [0] => date [1] => server [2] => content-length [3] => content-type [4] => x-cache [5] => x-cache-lookup [6] => connection ) [headers:protected] => Array ( [0] => Array ( [name] => Date [line] => Date: Fri, 18 Dec 2020 08:47:00 GMT ) [1] => Array ( [name] => Server [line] => Server: Apache/2.4.29 (Ubuntu) ) [2] => Array ( [name] => Content-Length [line] => Content-Length: 287 ) [3] => Array ( [name] => Content-Type [line] => Content-Type: text/html; charset=iso-8859-1 ) [4] => Array ( [name] => X-Cache [line] => X-Cache: MISS from proxyout.inist.fr ) [5] => Array ( [name] => X-Cache-Lookup [line] => X-Cache-Lookup: MISS from proxyout.inist.fr:8080 ) [6] => Array ( [name] => Connection [line] => Connection: close ) ) ) [metadata:protected] => Array ( ) [content:protected] =>
With the Curl Adapter, you get the following answer :
HTTP/1.1 200 OK
Date: Fri, 18 Dec 2020 09:38:26 GMT
Server: Apache
X-Powered-By: PHP/7.2.24-0ubuntu0.18.04.7
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
Content-Disposition: inline; filename=api-result.json
Set-Cookie: UseDC=master; Max-Age=10; Expires=Fri, 18-Dec-2020 09:38:36 GMT; Path=/; HttpOnly
Set-Cookie: UseCDNCache=false; Max-Age=10; Expires=Fri, 18-Dec-2020 09:38:36 GMT; Path=/; HttpOnly
Vary: Accept-Encoding,Treat-as-Untrusted,Cookie
Cache-Control: max-age=0, must-revalidate, private
Content-Length: 1952
Connection: close
Content-Type: application/json; charset=utf-8
{âbatchcompleteâ:true,âqueryâ:{âgeneralâ:{âmainpageâ:âAccueilâ,âbaseâ:âhttp://vdomekas18.intra.inist.fr:4000
1/index.php/Accueilâ,âsitenameâ:âwikiâ,âlogoâ:âhttp://vdomekas18.intra.inist.fr:40001/resources/assets/wiki.
pngâ,âgeneratorâ:" MediaWiki 1.31.1 â,âphpversionâ:â7.2.24-0ubuntu0.18.04.7â,âphpsapiâ:âapache2handlerâ,âdbtypeâ:âmysqlâ,âdbversionâ:â5.7.32-0ubuntu0.18.04.1-logâ,âimagewhitelistenabledâ:true,âlangconversionâ:true,âtitleconversionâ:true,âlinkprefixcharsetâ:â",âlinkprefixâ:"",âlinktrailâ:"/^([a-zà ùçéÚĂȘĂźĂŽĂ»Ă€Ă«ĂŻĂ¶ĂŒĂčĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ]+)(.)$/sDu",âlegaltitlecharsâ:" %!"$&â(),\-.\/0-9:;=?@A-Z\\^`a-z~\x80-\xFF+",âinvalidusernamecharsâ:"@:",âallunicodefixesâ:false,âfixarabicunicodeâ:true,âfixmalayalamunicodeâ:true,âcaseâ:âfirst-letterâ,âlangâ:âfrâ,âfallbackâ:[{âcodeâ:âenâ}],ârtlâ:false,âfallback8bitEncodingâ:âwindows-1252â,âreadonlyâ:false,âwriteapiâ:true,âmaxarticlesizeâ:2097152,âtimezoneâ:âEurope/Parisâ,âtimeoffsetâ:60,âarticlepathâ:"/index.php/$1",âscriptpathâ:"",âscriptâ:"/index.php",âvariantarticlepathâ:false,âserverâ:âhttp://vdomekas18.intra.inist.fr:40001â,âservernameâ:âvdomekas18.intra.inist.frâ,âwikiidâ:"mediawiki_db-mediawiki",âtimeâ:â2020-12-18T09:38:26Zâ,âmisermodeâ:false,âuploadsenabledâ:false,âmaxuploadsizeâ:104857600,âminuploadchunksizeâ:1024,âgalleryoptionsâ:{âimagesPerRowâ:0,âimageWidthâ:120,âimageHeightâ:120,âcaptionLengthâ:true,âshowBytesâ:true,âshowDimensionsâ:true,âmodeâ:âtraditionalâ},âthumblimitsâ:{â0â:120,â1â:150,â2â:180,â3â:200,â4â:250,â5â:300},âimagelimitsâ:{â0â:{âwidthâ:320,âheightâ:240},â1â:{âwidthâ:640,âheightâ:480},â2â:{âwidthâ:800,âheightâ:600},â3â:{âwidthâ:1024,âheightâ:768},â4â:{âwidthâ:1280,âheightâ:1024}},âfaviconâ:âhttp://vdomekas18.intra.inist.fr:40001/favicon.ico",âcentralidlookupproviderâ:âlocalâ,âallcentralidlookupprovidersâ:[âlocalâ],âinterwikimagicâ:true,âmagiclinksâ:{âISBNâ:false,âPMIDâ:false,âRFCâ:false},âcategorycollationâ:"uppercaseâ}}} - RĂ©ponse is success