Commit ade77363 authored by Freddy's avatar Freddy

Merge branch 'patch/DebugMissingLinks' into 'master'

Add getMissingLinks to Debug

Closes #93

See merge request !100
parents 52123a61 da8dd038
Pipeline #1712 passed with stages
in 2 minutes and 27 seconds
......@@ -1099,13 +1099,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();
......
......@@ -458,6 +458,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