}
function insertSearchData() {
- if( $this->pageExists( 'Not_Main_Page' ) ) {
+ if ( $this->pageExists( 'Not_Main_Page' ) ) {
return;
}
- $this->insertPage("Not_Main_Page", "This is not a main page", 0);
- $this->insertPage('Talk:Not_Main_Page', 'This is not a talk page to the main page, see [[smithee]]', 1);
- $this->insertPage('Smithee', 'A smithee is one who smiths. See also [[Alan Smithee]]', 0);
- $this->insertPage('Talk:Smithee', 'This article sucks.', 1);
- $this->insertPage('Unrelated_page', 'Nothing in this page is about the S word.', 0);
- $this->insertPage('Another_page', 'This page also is unrelated.', 0);
- $this->insertPage('Help:Help', 'Help me!', 4);
- $this->insertPage('Thppt', 'Blah blah', 0);
- $this->insertPage('Alan_Smithee', 'yum', 0);
- $this->insertPage('Pages', 'are\'food', 0);
- $this->insertPage('HalfOneUp', 'AZ', 0);
- $this->insertPage('FullOneUp', 'AZ', 0);
- $this->insertPage('HalfTwoLow', 'az', 0);
- $this->insertPage('FullTwoLow', 'az', 0);
- $this->insertPage('HalfNumbers', '1234567890', 0);
- $this->insertPage('FullNumbers', '1234567890', 0);
- $this->insertPage('DomainName', 'example.com', 0);
+ $this->insertPage( "Not_Main_Page", "This is not a main page", 0 );
+ $this->insertPage( 'Talk:Not_Main_Page', 'This is not a talk page to the main page, see [[smithee]]', 1 );
+ $this->insertPage( 'Smithee', 'A smithee is one who smiths. See also [[Alan Smithee]]', 0 );
+ $this->insertPage( 'Talk:Smithee', 'This article sucks.', 1 );
+ $this->insertPage( 'Unrelated_page', 'Nothing in this page is about the S word.', 0 );
+ $this->insertPage( 'Another_page', 'This page also is unrelated.', 0 );
+ $this->insertPage( 'Help:Help', 'Help me!', 4 );
+ $this->insertPage( 'Thppt', 'Blah blah', 0 );
+ $this->insertPage( 'Alan_Smithee', 'yum', 0 );
+ $this->insertPage( 'Pages', 'are\'food', 0 );
+ $this->insertPage( 'HalfOneUp', 'AZ', 0 );
+ $this->insertPage( 'FullOneUp', 'AZ', 0 );
+ $this->insertPage( 'HalfTwoLow', 'az', 0 );
+ $this->insertPage( 'FullTwoLow', 'az', 0 );
+ $this->insertPage( 'HalfNumbers', '1234567890', 0 );
+ $this->insertPage( 'FullNumbers', '1234567890', 0 );
+ $this->insertPage( 'DomainName', 'example.com', 0 );
}
function removeSearchData() {
return;
- while( count($this->pageList) ) {
+ while ( count( $this->pageList ) ) {
list( $title, $id ) = array_pop( $this->pageList );
$article = new Article( $title, $id );
- $article->doDeleteArticle("Search Test");
+ $article->doDeleteArticle( "Search Test" );
}
}
function fetchIds( $results ) {
$matches = array();
- while( $row = $results->next() ) {
+ while ( $row = $results->next() ) {
$matches[] = $row->getTitle()->getPrefixedText();
}
$results->free();
$article = new Article( $title );
$pageId = $article->getId();
$created = false;
- if( $pageId == 0 ) {
+ if ( $pageId == 0 ) {
# must create the page...
$pageId = $article->insertOn( $dbw );
$created = true;
$changed = $article->updateIfNewerOn( $dbw, $revision );
$GLOBALS['wgTitle'] = $title;
- if( $created ) {
+ if ( $created ) {
Article::onArticleCreate( $title );
$article->createUpdates( $revision );
- } elseif( $changed ) {
+ } elseif ( $changed ) {
Article::onArticleEdit( $title );
$article->editUpdates(
$text, $comment, false, 0, $revId );
}
- $su = new SearchUpdate($article->getId(), $pageName, $text);
+ $su = new SearchUpdate( $article->getId(), $pageName, $text );
$su->doUpdate();
$this->pageList[] = array( $title, $article->getId() );