getMain()->createPrinterByName( 'json' ); } public function execute() { $params = $this->extractRequestParams(); $search = $params['search']; $typos = $params['typos']; $searches = LanguageNameSearch::search( $search, $typos ); $result = $this->getResult(); $result->addValue( null, $this->getModuleName(), $searches ); } public function getAllowedParams() { return array( 'search' => array( ApiBase::PARAM_REQUIRED => true ), 'typos' => array( ApiBase::PARAM_REQUIRED => false, ApiBase::PARAM_TYPE => 'integer', ApiBase::PARAM_DFLT => 1 ), ); } public function getParamDescription() { return array( 'search' => 'Search string', 'typos' => 'Number of spelling mistakes allowed in the search string', ); } public function getDescription() { return 'Search for language names in any script'; } public function getExamples() { return array( 'api.php?action=languagesearch&search=Te', 'api.php?action=languagesearch&search=ഫി', 'api.php?action=languagesearch&search=ഫി&typos=1', ); } public function getVersion() { return __CLASS__ . ': ' . ULS_VERSION; } }