buildParameter($srnamespace); } if (isset($srwhat)) { $path .= '&srwhat=' . $srwhat; } if (isset($srinfo)) { $path .= '&srinfo=' . $this->buildParameter($srinfo); } if (isset($srprop)) { $path .= '&srprop=' . $this->buildParameter($srprop); } if ($srredirects) { $path .= '&srredirects='; } if (isset($sroffest)) { $path .= '&sroffest=' . $sroffest; } if (isset($srlimit)) { $path .= '&srlimit=' . $srlimit; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to search the wiki using opensearch protocol. * * @param string $search Search string. * @param integer $limit Maximum amount of results to return. * @param array $namespace Namespaces to search. * @param string $suggest Do nothing if $wgEnableOpenSearchSuggest is false. * @param string $format Output format. * * @return object * * @since 12.3 */ public function openSearch($search, $limit = null, array $namespace = null, $suggest = null, $format = null) { // Build the request. $path = '?action=query&list=search'; if (isset($search)) { $path .= '&search=' . $search; } if (isset($limit)) { $path .= '&limit=' . $limit; } if (isset($namespace)) { $path .= '&namespace=' . $this->buildParameter($namespace); } if (isset($suggest)) { $path .= '&suggest=' . $suggest; } if (isset($format)) { $path .= '&format=' . $format; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } }