10 defined(
'JPATH_PLATFORM') or die;
36 public function getCategories(array $titles, array $clprop = null, array $clshow = null, $cllimit = null, $clcontinue =
false,
37 array $clcategories = null, $cldir = null)
40 $path =
'?action=query&prop=categories';
43 $path .=
'&titles=' . $this->buildParameter($titles);
47 $path .=
'&clprop=' . $this->buildParameter($clprop);
52 $path .=
'&$clshow=' . $this->buildParameter($clshow);
57 $path .=
'&cllimit=' . $cllimit;
62 $path .=
'&clcontinue=';
65 if (isset($clcategories))
67 $path .=
'&clcategories=' . $this->buildParameter($clcategories);
72 $path .=
'&cldir=' . $cldir;
76 $response = $this->client->get($this->fetchUrl($path));
78 return $this->validateResponse($response);
90 public function getCategoriesUsed(array $titles)
93 $path =
'?action=query&generator=categories&prop=info';
96 $path .=
'&titles=' . $this->buildParameter($titles);
99 $response = $this->client->get($this->fetchUrl($path));
101 return $this->validateResponse($response);
114 public function getCategoriesInfo(array $titles, $clcontinue =
false)
117 $path =
'?action=query&prop=categoryinfo';
120 $path .=
'&titles=' . $this->buildParameter($titles);
124 $path .=
'&clcontinue=';
128 $response = $this->client->get($this->fetchUrl($path));
130 return $this->validateResponse($response);
149 public function enumerateCategories($acfrom = null, $acto = null, $acprefix = null, $acdir = null, $acmin = null,
150 $acmax = null, $aclimit = null, array $acprop = null)
153 $path =
'?action=query&list=allcategories';
157 $path .=
'&acfrom=' . $acfrom;
162 $path .=
'&acto=' . $acto;
165 if (isset($acprefix))
167 $path .=
'&acprefix=' . $acprefix;
172 $path .=
'&acdir=' . $acdir;
177 $path .=
'&acfrom=' . $acfrom;
182 $path .=
'&acmin=' . $acmin;
187 $path .=
'&acmax=' . $acmax;
192 $path .=
'&aclimit=' . $aclimit;
197 $path .=
'&acprop=' . $this->buildParameter($acprop);
201 $response = $this->client->get($this->fetchUrl($path));
203 return $this->validateResponse($response);
216 public function getChangeTags(array $tgprop = null, $tglimit = null)
219 $path =
'?action=query&list=tags';
223 $path .=
'&tgprop=' . $this->buildParameter($tgprop);
228 $path .=
'&tglimit=' . $tglimit;
234 $response = $this->client->get($this->fetchUrl($path));
236 return $this->validateResponse($response);