PHP 클래스 Wikimate, Wikimate

저자: Robert McLeod
파일 보기 프로젝트 열기: hamstar/Wikimate 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$api
$debugMode
$error
$password
$session Requests_Session
$useragent
$username

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
initRequests ( ) : void Set up a Requests_Session with appropriate user agent.

메소드 상세

__construct() 공개 메소드

Create a new Wikimate object.
public __construct ( $api ) : Wikimate
리턴 Wikimate

debugCurlConfig() 공개 메소드

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

debugRequestsConfig() 공개 메소드

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

delete() 공개 메소드

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

download() 공개 메소드

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

edit() 공개 메소드

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

getError() 공개 메소드

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

getFile() 공개 메소드

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

getPage() 공개 메소드

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

initRequests() 보호된 메소드

Set up a Requests_Session with appropriate user agent.
protected initRequests ( ) : void
리턴 void

login() 공개 메소드

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)
리턴 boolean True if logged in

parse() 공개 메소드

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

query() 공개 메소드

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
리턴 array Unserialized php output from the wiki API

setDebugMode() 공개 메소드

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

upload() 공개 메소드

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

프로퍼티 상세

$api 보호되어 있는 프로퍼티

protected $api

$debugMode 보호되어 있는 프로퍼티

protected $debugMode

$error 보호되어 있는 프로퍼티

protected $error

$password 보호되어 있는 프로퍼티

protected $password

$session 보호되어 있는 프로퍼티

protected Requests_Session $session
리턴 Requests_Session

$useragent 보호되어 있는 프로퍼티

protected $useragent

$username 보호되어 있는 프로퍼티

protected $username