On Jul 10, 2014, at 7:41 AM, Robert Cummings wrote:

> On 14-07-10 04:56 AM, Sigbert Klinke wrote:
>> Hi,
>> 
>> for my extension I also deliver some test pages. Currently I'am
>> exporting the test pages into a XML file and the wiki adminstrator could
>> import them with importDump.php.
>> 
>> Is there a way that the extension automatically integrates some pages
>> into the wiki (of course into my own namespace)?
> 
> I use something like the following:
> 
> <?php
> 
> $titleObj = Title::newFromText( "SomeNamespace:Some Article Title" );
> $articleObj = new Article( $titleObj );

I would use WikiPage instead of Article, since a lot of the Article based hooks 
have been deprecated since 1.21

> 
> if( $articleObj )
> {
>    $flags = EDIT_MINOR;
>    $articleObj->doEdit( 'This is the article text.', 'This is the edit 
> summary.', $flags );
> }
> 
> ?>
> 
> Cheers,
> Rob.
> -- 
> Phone: 613-822-9060    +++    Cell: 613-600-2836
> E-Mail Disclaimer: Information contained in this message and any
> attached documents is considered confidential and legally protected.
> This message is intended solely for the addressee(s). Disclosure,
> copying, and distribution are prohibited unless authorized.
> 
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

=====================================
Jim Hu
Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to