API:How to make a PHP request
Appearance
| This page is part of the MediaWiki Action API documentation. |
How to make a request in PHP
For a beginner in wikimedia development, this link is the most important:
And all options can be find here
And here:
And the code to create a page is:
global $wgUser;
echo "<p>".$token = $wgUser->editToken();
$params = new FauxRequest( array(
'action'=>'edit',
'title'=>'Talk:Main_Page',
'section'=>'new',
'summary'=>'Hello%20World',
'text'=>'Hello%20everyone!',
'watch'=>'',
'basetimestamp'=>'2008-03-20T17:26:39Z',
'token'=>$token,
));
$enableWrite = true; // This is set to false by default, in the ApiMain constructor
$api = new ApiMain( $params, $enableWrite );
$api->execute();
echo "<p>";
print_r($data = & $api->getResultData());