Data structures

From Apibot
Revision as of 00:45, 20 July 2014 by Grigor Gatchev (talk | contribs) (an incomplete skeleton)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Every task of Apibot is about wiki data - reading it, processing it , writing it back to the wiki. This data will typically be wiki pages, but sometimes can be other types of wiki data - users, page revisions, recentchanges, images, usercontribs etc.

Wiki data can be represented in two forms: either as PHP arrays (rarely - strings or numerics), or as objects. Every type of data can be represented as an array or scalar. Most types can be represented also as objects: for them, this usually is the preferable representation.

Some of the wiki data is collected in special objects. The prime example is the Info object, which handles all types of wiki info.

Some of the Apibot data is also available as objects.

Wiki data

The wiki data (except for the wiki info) belongs to one of the following types:

  • Page
  • User
  • Block
  • Image
  • Recentchange
  • Logevent
  • Usercontrib

There are also wiki data types that concern elements of a page. There are:

  • Page revision
  • Page category
  • Page image
  • Page imageinfo
  • Page template
  • Page extlink
  • Page link
  • Page langlink
  • Page duplicating files
  • Page global usage

And there are wiki data types that hold identifiers (eg. titles) for pages, selected by some criterion:

  • Protected page
  • Page from a list
  • Page that contains an extlink