Thanks .I have add this into my class to edit page.
                                        $params = new FauxRequest(array (
                                                                                
'action' => 'edit',
                                                                                
'title' => $page,
                                                                                
'basetimestamp' => $ts,
                                                                                
'starttimestamp' => $sts,
                                                                                
'token' => $token,
                                                                                
'text' => $newtext
                                        ));
                                        
                                        $api = new ApiMain($params);
                                        $api->execute();

                                        $data = & $api->getResultData();
                                        
                                        return $data;

and then add this
                                require_once('../../includes/WebRequest.php');
                                        
require_once('../../includes/api/ApiMain.php');
at the top of my class.

But there is an error when I access this class.

The error info is :
                                Unsupported operand types in ApiMain.php on 
line 143
        Line 143 is :   $this->mModules = $wgAPIModules + self :: $Modules;

Do I need other operations?




-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Jools Wills
Sent: 2009年6月10日 21:25
To: MediaWiki API announcements & discussion
Subject: Re: [Mediawiki-api] postAPI

On Wed, 2009-06-10 at 02:12 -0700, Nan Li wrote:

If you are wanting to use the API from an extension, it would be much
easier to do it like this:

http://www.mediawiki.org/wiki/API:Calling_internally

Best Regards

Jools



_______________________________________________
Mediawiki-api mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

_______________________________________________
Mediawiki-api mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Reply via email to