wiki.techinc.nl/includes/api
Brad Jorsch 1c57794e37 API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.

ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.

So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
  arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
  Formatters are responsible for stripping it if necessary. "raw mode"
  is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
  question, and so on.
* New class for formatting warnings and errors using i18n messages, and
  support for multiple errors and a more machine-readable format for
  warnings. For the moment, though, the actual output will not be changing
  yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
  between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
  modules currently returning booleans will need to use
  ApiResult::META_BC_BOOLS to preserve their current output.

Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.

Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2015-04-10 16:57:15 -04:00
..
i18n API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiBase.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiBlock.php Refactor out 'infinity' variants 2015-03-12 16:38:02 +00:00
ApiCheckToken.php API: Add authz features for RESTBase 2015-02-19 16:45:03 -05:00
ApiClearHasMsg.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiComparePages.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiContinuationManager.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiCreateAccount.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiDelete.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiDisabled.php API: Internationalize all remaining core API modules 2014-10-20 16:56:35 -04:00
ApiEditPage.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiEmailUser.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiErrorFormatter.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiExpandTemplates.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFeedContributions.php Introduce ApiFeedContributions::feedItem hook 2015-01-23 10:11:22 -08:00
ApiFeedRecentChanges.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiFeedWatchlist.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFileRevert.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFormatBase.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFormatDbg.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFormatDump.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFormatFeedWrapper.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFormatJson.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFormatNone.php
ApiFormatPhp.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFormatRaw.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFormatTxt.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFormatWddx.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFormatXml.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiFormatYaml.php
ApiHelp.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiHelpParamValueMessage.php API: Allow for documenting individual values of 'prop' parameters 2014-12-22 16:46:44 -05:00
ApiImageRotate.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiImport.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiLogin.php New convenience method ApiBase::lacksSameOriginSecurity() 2015-02-27 09:48:37 -05:00
ApiLogout.php Replace wfRunHooks calls with direct Hooks::run calls 2014-12-10 12:26:59 -08:00
ApiMain.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiManageTags.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiMessage.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiModuleManager.php
ApiMove.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiOpenSearch.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiOptions.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiPageSet.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiParamInfo.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiParse.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiPatrol.php Fix case of various newFromID/newFromId functions 2014-12-10 19:40:27 +00:00
ApiProtect.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiPurge.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQuery.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryAllCategories.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryAllDeletedRevisions.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryAllImages.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryAllLinks.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryAllMessages.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryAllPages.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryAllUsers.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryBacklinks.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryBacklinksprop.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiQueryBase.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryBlocks.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryCategories.php Removed FORCE INDEX from API category queries 2015-02-23 05:10:57 +00:00
ApiQueryCategoryInfo.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiQueryCategoryMembers.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryContributors.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiQueryDeletedRevisions.php Refactor content fetch condition in ApiQueryRevisionsBase 2014-11-10 18:50:36 +01:00
ApiQueryDeletedrevs.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryDisabled.php API: Internationalize all remaining core API modules 2014-10-20 16:56:35 -04:00
ApiQueryDuplicateFiles.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiQueryExternalLinks.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryExtLinksUsage.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryFilearchive.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryFileRepoInfo.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryImageInfo.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryImages.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiQueryInfo.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryIWBacklinks.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryIWLinks.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryLangBacklinks.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryLangLinks.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryLinks.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiQueryLogEvents.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryORM.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryPagePropNames.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryPageProps.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiQueryPagesWithProp.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryPrefixSearch.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryProtectedTitles.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryQueryPage.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryRandom.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryRecentChanges.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryRevisions.php New convenience method ApiBase::lacksSameOriginSecurity() 2015-02-27 09:48:37 -05:00
ApiQueryRevisionsBase.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQuerySearch.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQuerySiteinfo.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryStashImageInfo.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryTags.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryTokens.php New convenience method ApiBase::lacksSameOriginSecurity() 2015-02-27 09:48:37 -05:00
ApiQueryUserContributions.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryUserInfo.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryUsers.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryWatchlist.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiQueryWatchlistRaw.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiResult.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiRevisionDelete.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiRollback.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiRsd.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiSerializable.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiSetNotificationTimestamp.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiStashEdit.php Split out internal parseAndStash from the edit stashing API 2015-03-27 22:16:59 +00:00
ApiTokens.php New convenience method ApiBase::lacksSameOriginSecurity() 2015-02-27 09:48:37 -05:00
ApiUnblock.php API: Fix access on getExamplesMessages 2014-10-29 11:15:27 -04:00
ApiUndelete.php Replace wfRunHooks calls with direct Hooks::run calls 2014-12-10 12:26:59 -08:00
ApiUpload.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiUserrights.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00
ApiWatch.php API: Overhaul ApiResult, make format=xml not throw, and add json formatversion 2015-04-10 16:57:15 -04:00