summaryrefslogtreecommitdiff
path: root/bin/wiki/vendor/addwiki/mediawiki-api-base/src/MediawikiApiInterface.php
blob: 83580676954d453e64f33fd55dea4bf80bdd3d77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php

namespace Mediawiki\Api;

/**
 * @since 2.2
 * @licence GNU GPL v2+
 * @author Addshore
 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 */
interface MediawikiApiInterface extends ApiRequester, AsyncApiRequester {

	/**
	 * @since 2.2
	 *
	 * @return bool|string false or the name of the current user
	 */
	public function isLoggedin();

	/**
	 * @since 2.2
	 *
	 * @param ApiUser $apiUser The ApiUser to log in as.
	 *
	 * @throws UsageException
	 * @return bool success
	 */
	public function login( ApiUser $apiUser );

	/**
	 * @since 2.2
	 *
	 * @return bool success
	 */
	public function logout();

	/**
	 * @since 2.2
	 *
	 * @param string $type The type of token to get.
	 *
	 * @return string
	 */
	public function getToken( $type = 'csrf' );

	/**
	 * @since 2.2
	 *
	 * Clears all tokens stored by the api
	 */
	public function clearTokens();

	/**
	 * @since 2.2
	 *
	 * @return string
	 */
	public function getVersion();

}