10 defined(
'JPATH_PLATFORM') or die;
36 public function getLinks(array $titles, array $plnamespace = null, $pllimit = null, $plcontinue = null, array $pltitles = null, $pldir = null)
39 $path =
'?action=query&prop=links';
42 $path .=
'&titles=' . $this->buildParameter($titles);
44 if (isset($plnamespace))
46 $path .=
'&plnamespace=' . $this->buildParameter($plnamespace);
51 $path .=
'&pllimit=' . $pllimit;
54 if (isset($plcontinue))
56 $path .=
'&plcontinue=' . $plcontinue;
61 $path .=
'&pltitles=' . $this->buildParameter($pltitles);
66 $path .=
'&pldir=' . $pldir;
70 $response = $this->client->get($this->fetchUrl($path));
72 return $this->validateResponse($response);
84 public function getLinksUsed(array $titles)
87 $path =
'?action=query&generator=links&prop=info';
90 $path .=
'&titles=' . $this->buildParameter($titles);
93 $response = $this->client->get($this->fetchUrl($path));
95 return $this->validateResponse($response);
113 public function getIWLinks(array $titles, $iwurl =
false, $iwlimit = null, $iwcontinue =
false, $iwprefix = null, $iwtitle = null, $iwdir = null)
116 $path =
'?action=query&prop=links';
119 $path .=
'&titles=' . $this->buildParameter($titles);
128 $path .=
'&iwlimit=' . $iwlimit;
133 $path .=
'&iwcontinue=';
136 if (isset($iwprefix))
138 $path .=
'&iwprefix=' . $iwprefix;
143 $path .=
'&iwtitle=' . $iwtitle;
148 $path .=
'&iwdir=' . $iwdir;
152 $response = $this->client->get($this->fetchUrl($path));
154 return $this->validateResponse($response);
172 public function getLangLinks(array $titles, $lllimit = null, $llcontinue =
false, $llurl = null, $lllang = null, $lltitle = null, $lldir = null)
175 $path =
'?action=query&prop=langlinks';
178 $path .=
'&titles=' . $this->buildParameter($titles);
182 $path .=
'&lllimit=' . $lllimit;
187 $path .=
'&llcontinue=';
192 $path .=
'&llurl=' . $llurl;
197 $path .=
'&lllang=' . $lllang;
202 $path .=
'&lltitle=' . $lltitle;
207 $path .=
'&lldir=' . $lldir;
211 $response = $this->client->get($this->fetchUrl($path));
213 return $this->validateResponse($response);
229 public function getExtLinks(array $titles, $ellimit = null, $eloffset = null, $elprotocol = null, $elquery = null)
232 $path =
'?action=query&prop=extlinks';
235 $path .=
'&titles=' . $this->buildParameter($titles);
239 $path .=
'&ellimit=' . $ellimit;
242 if (isset($eloffset))
244 $path .=
'&eloffset=' . $eloffset;
247 if (isset($elprotocol))
249 $path .=
'&elprotocol=' . $elprotocol;
254 $path .=
'&elquery=' . $elquery;
258 $response = $this->client->get($this->fetchUrl($path));
260 return $this->validateResponse($response);
279 public function enumerateLinks($alcontinue =
false, $alfrom = null, $alto = null, $alprefix = null, $alunique = null, array $alprop = null,
280 $alnamespace = null, $allimit = null)
283 $path =
'?action=query&meta=siteinfo';
287 $path .=
'&alcontinue=';
292 $path .=
'&alfrom=' . $alfrom;
297 $path .=
'&alto=' . $alto;
300 if (isset($alprefix))
302 $path .=
'&alprefix=' . $alprefix;
305 if (isset($alunique))
307 $path .=
'&alunique=' . $alunique;
312 $path .=
'&alprop=' . $this->buildParameter($alprop);
315 if (isset($alnamespace))
317 $path .=
'&alnamespace=' . $alnamespace;
322 $path .=
'&allimit=' . $allimit;
326 $response = $this->client->get($this->fetchUrl($path));
328 return $this->validateResponse($response);