PHP Class Wikimate, Wikimate

Author: Robert McLeod
Afficher le fichier Open project: hamstar/Wikimate Class Usage Examples

Protected Properties

Свойство Type Description
$api
$debugMode
$error
$password
$session Requests_Session
$useragent
$username

Méthodes publiques

Méthode Description
__construct ( $api ) : Wikimate Create a new Wikimate object.
debugCurlConfig ( boolean $echo = false ) : mixed Used to return or print the curl settings, but now prints an error and returns Wikimate::debugRequestsConfig().
debugRequestsConfig ( boolean $echo = false ) : boolean Get or print the Requests configuration.
delete ( array $array ) : array Perfoms a delete query to the wiki API.
download ( string $url ) : mixed Downloads data from the given URL.
edit ( array $array ) : array Perfoms an edit query to the wiki API.
getError ( ) : mixed Returns the latest error if there is one.
getFile ( string $filename ) : WikiFile Returns a WikiFile object populated with the file data.
getPage ( string $title ) : WikiPage Returns a WikiPage object populated with the page data.
login ( string $username, string $password, string $domain = null ) : boolean Logs in to the wiki.
parse ( array $array ) : array Performs a parse query to the wiki API.
query ( array $array ) : array Performs a query to the wiki API with the given details.
setDebugMode ( boolean $b ) : Wikimate Sets the debug mode.
upload ( array $array ) : array Uploads a file to the wiki API.

Méthodes protégées

Méthode Description
initRequests ( ) : void Set up a Requests_Session with appropriate user agent.

Method Details

__construct() public méthode

Create a new Wikimate object.
public __construct ( $api ) : Wikimate
Résultat Wikimate

debugCurlConfig() public méthode

Used to return or print the curl settings, but now prints an error and returns Wikimate::debugRequestsConfig().
Deprecation: Since version 0.10.0
public debugCurlConfig ( boolean $echo = false ) : mixed
$echo boolean True to echo the configuration
Résultat mixed Array of config if $echo is false, (boolean) true if echo is true

debugRequestsConfig() public méthode

Get or print the Requests configuration.
public debugRequestsConfig ( boolean $echo = false ) : boolean
$echo boolean Whether to echo the options
Résultat boolean Options if $echo is false

delete() public méthode

Perfoms a delete query to the wiki API.
public delete ( array $array ) : array
$array array Array of details to be passed in the query
Résultat array Unserialized php output from the wiki API

download() public méthode

Downloads data from the given URL.
public download ( string $url ) : mixed
$url string The URL to download from
Résultat mixed The downloaded data (string), or null if error

edit() public méthode

Perfoms an edit query to the wiki API.
public edit ( array $array ) : array
$array array Array of details to be passed in the query
Résultat array Unserialized php output from the wiki API

getError() public méthode

Returns the latest error if there is one.
public getError ( ) : mixed
Résultat mixed The error array, or null if no error

getFile() public méthode

Returns a WikiFile object populated with the file data.
public getFile ( string $filename ) : WikiFile
$filename string The name of the wiki file
Résultat WikiFile The file object

getPage() public méthode

Returns a WikiPage object populated with the page data.
public getPage ( string $title ) : WikiPage
$title string The name of the wiki article
Résultat WikiPage The page object

initRequests() protected méthode

Set up a Requests_Session with appropriate user agent.
protected initRequests ( ) : void
Résultat void

login() public méthode

Logs in to the wiki.
public login ( string $username, string $password, string $domain = null ) : boolean
$username string The user name
$password string The user password
$domain string The domain (optional)
Résultat boolean True if logged in

parse() public méthode

Performs a parse query to the wiki API.
public parse ( array $array ) : array
$array array Array of details to be passed in the query
Résultat array Unserialized php output from the wiki API

query() public méthode

Performs a query to the wiki API with the given details.
public query ( array $array ) : array
$array array Array of details to be passed in the query
Résultat array Unserialized php output from the wiki API

setDebugMode() public méthode

Sets the debug mode.
public setDebugMode ( boolean $b ) : Wikimate
$b boolean True to turn debugging on
Résultat Wikimate This object

upload() public méthode

Uploads a file to the wiki API.
public upload ( array $array ) : array
$array array Array of details to be used in the upload
Résultat array Unserialized php output from the wiki API

Property Details

$api protected_oe property

protected $api

$debugMode protected_oe property

protected $debugMode

$error protected_oe property

protected $error

$password protected_oe property

protected $password

$session protected_oe property

protected Requests_Session $session
Résultat Requests_Session

$useragent protected_oe property

protected $useragent

$username protected_oe property

protected $username