Commit da8dd038 authored by Luke081515's avatar Luke081515

Add getMissingLinks to Debug

* Added the config for Debug
* Fixed an error at the function which lead to an error
* Used a more common name for the param of GetMissingLinks
parent 1a38ed8e
Pipeline #1583 passed with stages
in 2 minutes and 46 seconds
......@@ -1095,13 +1095,13 @@ class Core extends Password {
/** getMissingLinks
* Returns missing links "redlinks" on a page
* @author Freddy2001
* @param $Site - Page with links that will be checked
* @param $page - Page with links that will be checked
* @return Array with missing pages or false if there are no links
*/
public function getMissingLinks ($Site) {
$request = "action=query&format=json&prop=info&generator=links&utf8=1&formatversion=2&gpllimit=max&titles=" . urlencode($Site);
public function getMissingLinks ($page) {
$request = "action=query&format=json&prop=info&generator=links&utf8=1&formatversion=2&gpllimit=max&titles=" . urlencode($page);
try {
$result = $this->httpRequest($data, $this->job, 'GET');
$result = $this->httpRequest($request, $this->job, 'GET');
$result = json_decode($result, true);
$answer = $result['query']['pages'];
$result = array();
......
......@@ -452,6 +452,20 @@ class Debug extends Core {
$this->processError($e, $starttime, $endtime);
}
break;
case 'getMissingLinks':
$required = array("page");
$Param = $this->getParams($required);
$this->echoNotice('Starting the function call of getMissingLinks...');
$starttime = microtime(true);
try {
$ret = $this->getMissingLinks($Param[0]);
$endtime = microtime (true);
$this->processFunction($ret, $starttime, $endtime);
} catch (Exception $e) {
$endtime = microtime (true);
$this->processError($e, $starttime, $endtime);
}
break;
case 'getAllPages':
$required = array("namespace");
$Param = $this->getParams($required);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment