Download the PHP package sophivorus/easy-wiki without Composer
On this page you can find all versions of the php package sophivorus/easy-wiki. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sophivorus/easy-wiki
More information about sophivorus/easy-wiki
Files in sophivorus/easy-wiki
Package easy-wiki
Short Description Friendly PHP client for the MediaWiki Action API
License GPL-3.0-or-later
Homepage https://github.com/Sophivorus/EasyWiki
Informations about the package easy-wiki
EasyWiki
EasyWiki is a friendly PHP client for the MediaWiki Action API.
Quickstart
Authentication
If you only want to read data from a public wiki (such as Wikipedia), then you don't need to authenticate, you can move on to the next section.
However, if you want to write data or read data from a private wiki, you'll need to authenticate with a bot account. Bot accounts are created from Special:BotPasswords and are the simplest way to get through the MediaWiki security mechanisms.
Reading
If none of the available methods serves your needs, you can always query the API directly. EasyWiki provides handy methods for doing so and for extracting the desired data from the results. Check out the MediaWiki Action API documentation for the available parameters.
Writing
All methods have an optional last argument where you can specify extra parameters. For example:
Architecture
Check out the source code for the ultimate documentation.
- Base methods are the basic building blocks to interact with the MediaWiki Action API:
get()
makes a GET request to the APIpost()
makes a POST request to the APIfind()
extracts data from the results
- Action methods use the base methods to interact with the API modules:
login()
logout()
query()
parse()
edit()
move()
delete()
- Shorthand methods simplify common requests:
create()
append()
prepend()
getHTML()
getWikitext()
getCategories()
getPageInfo()
getSiteInfo()
getNamespaces()
getToken()
If none of the existing methods serves your needs, you can always call the base methods directly.