+ /**
+ * Edits or creates a page/revision
+ * @param $pageName string page title
+ * @param $text string content of the page
+ * @param $summary string optional summary string for the revision
+ * @param $defaultNs int optional namespace id
+ * @return array as returned by WikiPage::doEditContent()
+ */
+ protected function editPage( $pageName, $text, $summary = '', $defaultNs = NS_MAIN ) {
+ $title = Title::newFromText( $pageName, $defaultNs );
+ $page = WikiPage::factory( $title );
+ return $page->doEditContent( ContentHandler::makeContent( $text, $title ), $summary );