当前位置: 首页>>代码示例>>PHP>>正文


PHP Article::doDeleteArticle方法代码示例

本文整理汇总了PHP中Article::doDeleteArticle方法的典型用法代码示例。如果您正苦于以下问题:PHP Article::doDeleteArticle方法的具体用法?PHP Article::doDeleteArticle怎么用?PHP Article::doDeleteArticle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Article的用法示例。


在下文中一共展示了Article::doDeleteArticle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 public function execute()
 {
     $user = 'MediaWiki default';
     $reason = 'No longer required';
     $this->output("Checking existence of old default messages...");
     $dbr = wfGetDB(DB_SLAVE);
     $res = $dbr->select(array('page', 'revision'), array('page_namespace', 'page_title'), array('page_namespace' => NS_MEDIAWIKI, 'page_latest=rev_id', 'rev_user_text' => 'MediaWiki default'));
     if ($dbr->numRows($res) == 0) {
         # No more messages left
         $this->output("done.\n");
         return;
     }
     # Deletions will be made by $user temporarly added to the bot group
     # in order to hide it in RecentChanges.
     global $wgUser;
     $wgUser = User::newFromName($user);
     $wgUser->addGroup('bot');
     # Handle deletion
     $this->output("\n...deleting old default messages (this may take a long time!)...", 'msg');
     $dbw = wfGetDB(DB_MASTER);
     foreach ($res as $row) {
         if (function_exists('wfWaitForSlaves')) {
             wfWaitForSlaves(5);
         }
         $dbw->ping();
         $title = Title::makeTitle($row->page_namespace, $row->page_title);
         $article = new Article($title);
         $dbw->begin();
         $article->doDeleteArticle($reason);
         $dbw->commit();
     }
     $this->output('done!', 'msg');
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:33,代码来源:deleteDefaultMessages.php

示例2: deleteArticle

	public static function deleteArticle( $titletext ) {
		if ( ! OpenStackNovaArticle::canCreatePages() ) {
			return;
		}
		$title = Title::newFromText( $titletext, NS_NOVA_RESOURCE );
		$article = new Article( $title, 0 );
		$article->doDeleteArticle( '' );
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:8,代码来源:OpenStackNovaArticle.php

示例3: run

	function run() {
		global $wgUser;

		// Initialization
		$title = $this->title;
		// Other stuff
		$user    = $this->getUser();
		$summary = $this->getSummary();
		$base    = $this->getBase();

		PageTranslationHooks::$allowTargetEdit = true;
		$oldUser = $wgUser;
		$wgUser = $user;

		$error = '';
		$article = new Article( $title, 0 );
		$ok = $article->doDeleteArticle( $summary, false, 0, true, $error );
		if ( !$ok ) {
			$logger = new LogPage( 'pagetranslation' );
			$params = array(
				'user' => $this->getPerformer(),
				'target' => $base,
				'error' => base64_encode( serialize( $ok ) ), // This is getting ridiculous
			);
			$doer = User::newFromName( $this->getPerformer() );
			$msg = $this->getFull() ? 'deletefnok' : 'deletelnok';
			$logger->addEntry( $msg, $title, null, array( serialize( $params ) ), $doer );
		}

		PageTranslationHooks::$allowTargetEdit = false;

		$cache = wfGetCache( CACHE_DB );
		$pages = (array) $cache->get( wfMemcKey( 'pt-base', $base ) );
		$lastitem = array_pop( $pages );
		if ( $title->getPrefixedText() === $lastitem ) {
			$cache->delete( wfMemcKey( 'pt-base', $base ) );
			$logger = new LogPage( 'pagetranslation' );
			$params = array( 'user' => $this->getPerformer() );
			$doer = User::newFromName( $this->getPerformer() );
			$msg = $this->getFull() ? 'deletefok' : 'deletelok';
			$logger->addEntry( $msg, Title::newFromText( $base ), null, array( serialize( $params ) ), $doer );

			$tpage = TranslatablePage::newFromTitle( $title );
			$tpage->getTranslationPercentages( true );
			foreach ( $tpage->getTranslationPages() as $page ) {
				$page->invalidateCache();
			}
			$title->invalidateCache();
		}

		$wgUser = $oldUser;

		return true;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:54,代码来源:DeleteJob.php

示例4: checkForEmpty

function checkForEmpty($t)
{
    $deleteComment = "Deleting unused profile box page";
    if ($t) {
        $a = new Article($t);
        if ($a->exists()) {
            $content = $a->getContent();
            if ($content == "") {
                if ($a->doDeleteArticle($deleteComment)) {
                    echo $deleteComment . " " . $t->getText() . "\n";
                    return true;
                }
            }
        }
    }
    return false;
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:17,代码来源:removeEmptyProfilePages.php

示例5: deleteFileByTitle

 /**
  * Helper function -- remove files and associated articles by Title
  * @param $title Title: title to be removed
  */
 public function deleteFileByTitle($title)
 {
     if ($title->exists()) {
         $file = wfFindFile($title, array('ignoreRedirect' => true));
         $noOldArchive = "";
         // yes this really needs to be set this way
         $comment = "removing for test";
         $restrictDeletedVersions = false;
         $status = FileDeleteForm::doDelete($title, $file, $noOldArchive, $comment, $restrictDeletedVersions);
         if (!$status->isGood()) {
             return false;
         }
         $article = new Article($title);
         $article->doDeleteArticle("removing for test");
         // see if it now doesn't exist; reload
         $title = Title::newFromText($title->getText(), NS_FILE);
     }
     return !($title && $title instanceof Title && $title->exists());
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:23,代码来源:ApiTestCaseUpload.php

示例6: deleteDefaultMessages

function deleteDefaultMessages()
{
    $user = 'MediaWiki default';
    $reason = 'No longer required';
    global $wgUser;
    $wgUser = User::newFromName($user);
    $wgUser->addGroup('bot');
    $dbr =& wfGetDB(DB_SLAVE);
    $res = $dbr->select(array('page', 'revision'), array('page_namespace', 'page_title'), array('page_namespace' => NS_MEDIAWIKI, 'page_latest=rev_id', 'rev_user_text' => 'MediaWiki default'));
    $dbw =& wfGetDB(DB_MASTER);
    while ($row = $dbr->fetchObject($res)) {
        if (function_exists('wfWaitForSlaves')) {
            wfWaitForSlaves(5);
        }
        $dbw->ping();
        $title = Title::makeTitle($row->page_namespace, $row->page_title);
        $article = new Article($title);
        $dbw->begin();
        $article->doDeleteArticle($reason);
        $dbw->commit();
    }
}
开发者ID:negabaro,项目名称:alfresco,代码行数:22,代码来源:deleteDefaultMessages.php

示例7: wfGetDB

<?php

include '../commandLine.inc';
$wgShowExceptionDetails = true;
$wgUser = User::newFromName('Wikia');
$dbr = wfGetDB(DB_SLAVE);
$res = $dbr->select('page', array('page_title'), array('page_namespace' => 200), 'BlameTor', array('LIMIT' => 5));
while ($row = $dbr->fetchObject($res)) {
    $wikiTitle = Title::newFromText($row->page_title, 200);
    $wikiArticle = new Article($wikiTitle);
    $userTitle = Title::newFromText($wikiTitle->getText(), NS_USER);
    if (!$userTitle->exists()) {
        // move to new location
        $wikiTitle->moveNoAuth($userTitle);
        echo "Moved " . $wikiTitle->getText() . "\n";
        continue;
    }
    $userArticle = new Article($userTitle);
    if ($wikiArticle->getContent() !== '' && $userArticle->getContent() == '') {
        // delete
        $userArticle->doDeleteArticle('making way for user page move', true, $userArticle->mTitle->getArticleID(Title::GAID_FOR_UPDATE));
        echo "Deleted " . $userTitle->getText() . "\n";
        // then move the page
        $wikiTitle->moveNoAuth($userTitle);
        echo "Moved " . $wikiTitle->getText() . "\n";
        continue;
    }
    echo "Nothing happened\n";
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:29,代码来源:FixSocialProfiles.php

示例8: deleteBoard

 /**
  * delete board
  */
 public function deleteBoard($board)
 {
     wfProfileIn(__METHOD__);
     Forum::$allowToEditBoard = true;
     $article = new Article($board->getTitle());
     $article->doDeleteArticle('', true);
     Forum::$allowToEditBoard = false;
     wfProfileOut(__METHOD__);
 }
开发者ID:yusufchang,项目名称:app,代码行数:12,代码来源:Forum.class.php

示例9: deleteArticle

 /**
  *
  * Deletes the article with the given nfdid
  *
  */
 function deleteArticle($nfdid, $nfdReason)
 {
     global $wgUser, $wgLang;
     wfLoadExtensionMessages("NFDGuardian");
     // keep the article
     $dbr = wfGetDB(DB_SLAVE);
     // load the revision text
     $pageid = $dbr->selectField('nfd', array('nfd_page'), array('nfd_id' => $nfdid), __METHOD__);
     $t = Title::newFromID($pageid);
     if (!$t) {
         return false;
     }
     $r = Revision::newFromTitle($t);
     if (!$r) {
         return false;
     }
     $article = new Article($t);
     if (!$article) {
         return false;
     }
     $dateStr = gmdate('n/j/Y', time());
     //$wgLang->date(wfTimestampNow());
     $votes = $this->getVotes($nfdid, $dbr);
     $comment = wfMsgHtml('nfd_delete_message', $dateStr, $nfdReason['type'], $votes['deleteUsers'], $votes['keepUsers'], "[[" . $t->getText() . "]]", number_format($article->getCount(), 0, "", ","));
     $foundDup = false;
     if ($nfdReason['type'] == "dup") {
         //check if it was a duplicate
         $dupTitle = Title::newFromText($nfdReason['article']);
         if (!$dupTitle) {
             $dupTitle = Title::newFromText("Deleted-Article", NS_PROJECT);
         }
         if ($dupTitle) {
             $dupRev = Revision::newFromTitle($dupTitle);
             if ($dupRev) {
                 //the duplicate title exists, so turn the current article into a redirct
                 $editSuccess = $article->doEdit("#REDIRECT [[" . $dupTitle->getPrefixedURL() . "]]", $comment);
                 $foundDup = true;
                 self::markAsDup($nfdid, $pageid);
                 //log redirect in the nfd table
                 $log = new LogPage('nfd', false);
                 $log->addEntry('redirect', $t, $comment);
                 $commentDup = wfMsgHtml('nfd_dup_message', $dateStr, $nfdReason['type'], $votes['deleteUsers'], $votes['keepUsers'], "[[" . $t->getText() . "]]", number_format($article->getCount(), 0, "", ","), "[[" . $dupTitle->getText() . "]]");
                 $formattedComment = wfMsg('postcomment_formatted_comment', $dateStr, "NFD-Voter-Tool", "NFD Voter Tool", $commentDup);
                 $discussionTitle = $t->getTalkPage();
                 $text = "";
                 if ($discussionTitle->getArticleId() > 0) {
                     $r = Revision::newFromTitle($discussionTitle);
                     $text = $r->getText();
                 }
                 //add a comment to the discussion page
                 $articleDiscussion = new Article($discussionTitle);
                 $text .= "\n\n{$formattedComment}\n\n";
                 $articleDiscussion->doEdit($text, "");
             }
         }
     }
     //if we haven't found a duplicate, then go ahead and do the delete
     if (!$foundDup) {
         $formattedComment = wfMsg('postcomment_formatted_comment', $dateStr, "NFD-Voter-Tool", "NFD Voter Tool", $comment);
         $discussionTitle = $t->getTalkPage();
         $text = "";
         if ($discussionTitle->getArticleId() > 0) {
             $r = Revision::newFromTitle($discussionTitle);
             $text = $r->getText();
         }
         //add a comment to the discussion page
         $articleDiscussion = new Article($discussionTitle);
         $text .= "\n\n{$formattedComment}\n\n";
         $articleDiscussion->doEdit($text, "");
         //now delete the article
         $editSuccess = $article->doDeleteArticle($comment);
         //no need to log in the deletion table b/c doDeleteArticle does it for you
         //log same delete in the nfd table
         $log = new LogPage('nfd', false);
         $log->addEntry('delete', $t, $comment);
     }
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:82,代码来源:NFDGuardian.body.php

示例10: execute

 public function execute()
 {
     global $wgUser;
     # Change to current working directory
     $oldCwd = getcwd();
     chdir($oldCwd);
     # Options processing
     $user = $this->getOption('u', 'Delete page script');
     $reason = $this->getOption('r', '');
     $interval = $this->getOption('i', 0);
     if ($this->hasArg()) {
         $file = fopen($this->getArg(), 'r');
     } else {
         $file = $this->getStdin();
     }
     # Setup
     if (!$file) {
         $this->error("Unable to read file, exiting", true);
     }
     $wgUser = User::newFromName($user);
     $dbw = wfGetDB(DB_MASTER);
     # Handle each entry
     for ($linenum = 1; !feof($file); $linenum++) {
         $line = trim(fgets($file));
         if ($line == '') {
             continue;
         }
         $page = Title::newFromText($line);
         if (is_null($page)) {
             $this->output("Invalid title '{$line}' on line {$linenum}\n");
             continue;
         }
         if (!$page->exists()) {
             $this->output("Skipping nonexistent page '{$line}'\n");
             continue;
         }
         $this->output($page->getPrefixedText());
         $dbw->begin();
         if ($page->getNamespace() == NS_FILE) {
             $art = new ImagePage($page);
             $img = wfFindFile($art->mTitle);
             if (!$img || !$img->isLocal() || !$img->delete($reason)) {
                 $this->output(" FAILED to delete image file... ");
             }
         } else {
             $art = new Article($page);
         }
         $success = $art->doDeleteArticle($reason);
         $dbw->commit();
         if ($success) {
             $this->output(" Deleted!\n");
         } else {
             $this->output(" FAILED to delete article\n");
         }
         if ($interval) {
             sleep($interval);
         }
         wfWaitForSlaves();
     }
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:60,代码来源:deleteBatch.php

示例11: wfLocalFile

$wgTitle = $page;
// this cannot be NULL
print $page->getPrefixedText();
$dbw->begin();
$nspace = $page->getNamespace();
$success = 0;
$removed = 0;
if (in_array($nspace, array(NS_IMAGE, NS_FILE))) {
    $file = wfLocalFile($page);
    if ($file) {
        $oldimage = null;
        // Must be passed by reference
        $success = FileDeleteForm::doDelete($page, $file, $oldimage, $reason, $suppress)->isOK();
        $removed = 1;
    }
}
if ($removed == 0) {
    $page_id = $page->getArticleID();
    $art = new Article($page);
    $success = $art->doDeleteArticle($reason, $suppress);
}
$dbw->commit();
if ($success) {
    print "\n";
} else {
    print " FAILED\n";
}
if ($interval) {
    sleep($interval);
}
wfWaitForSlaves();
开发者ID:Tjorriemorrie,项目名称:app,代码行数:31,代码来源:deleteOn.php

示例12: Article

	$text = $revision->getText();
	if ( $text === false ) {
		echo "Cannot load text: $line\n";
		continue;
	}
	$redir = Title::newFromRedirect( $text );
	if ( !$redir ) {
		echo "Not a redirect: $line\n";
		continue;
	}


	if ( $unbrokenTitle->exists() ) {
		# Exists already, just delete this redirect
		$article = new Article( $brokenTitle );
		$success = $article->doDeleteArticle( 'Redundant redirect' );
		if ( $success ) {
			echo "Deleted: $line\n";
		} else {
			echo "Failed to delete: $line\n";
		}
	} else {
		# Does not exist, move this redirect to the unbroken title
		# Do not leave a redirect behind
		$result = $brokenTitle->moveTo( $unbrokenTitle, /*auth*/ false,
			'Fixing broken redirect', /*createRedirect*/ false );
		if ( $result === true ) {
			echo "Moved: $line\n";
		} else {
			$error = reset( $result );
			echo "Move error: {$error[0]}: $line\n";
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:31,代码来源:cleanupMl.php

示例13: array

<?php

require_once 'commandLine.inc';
$users = array("A.langley21", "ABCBlind", "ADILeak1", "ADresses0", "AEEL", "AEGONDirect", "AJohnson420", "ALexandra2012", "ASIANNATION", "ASMUDIN", "ATEAMHOMEIMPROVEMENT", "AZHeart", "Aaanetsolution", "Aacdevices", "Aadeshwarmetal", "Aadityaceramics", "Aadseducation", "Aagjeaaiza", "Aahnaawasthi", "Aakarexport", "Aakash101", "Aakashmehraa", "Aakritipackaging", "Aanalmagnet", "Aangel123", "Aangell79", "Aarankell123", "Aarceeengineeringworks", "Aarindustrial", "Aaronabel143", "Aaronhenryj", "Aaronlazarss", "Aaronlewis142", "Aaronslater", "Aaronstatonss", "Aartifashion", "Aashelyweng16", "Aatouspower", "Aatouspowerindia", "Aatravelromania", "Aba223", "Abacusmanufacturers", "Abang12", "Abbigilabbot", "Abbittedeen", "Abbittlothar", "Abccarpetcleaning", "Abclcarpet", "Abdellah", "Abdihow", "Abelabbey73", "Abeladam21", "Abelhenderson", "Abeniwilson", "Abercrombieclothes", "Abetterhealthway", "Abeyaustin111", "Abhilashenterprises", "Abhimanyushama003", "Abhisays", "Abhishekarar", "Abhishekenterprises", "Abhishekentp", "Abhishekmishra", "Abhishekpaul", "Abhishektch", "Abia524", "Abia619", "Abileweb", "Abilio", "Abimj", "Ableelectropolishing", "Abluescarab", "Abodedrugs", "AboutAsbestos", "Abrahamexports", "AbramCovington", "Absoluteair", "Abswood", "Abudhabirelocation", "Abunzareview7", "Acaforreal", "Acaiberryboutique", "Acarpetcleaning", "Accentstudios", "Accesscontrolsystem", "Accessories", "Accessoriesbuy2", "Accommdotcom", "Accountia", "Accountmmo", "Acdrives", "Acehardware", "Aceleertet", "Acer925", "Aceroinoxidable", "Achievablefashion", "Achievebeyond", "Achillemdz", "Achilles", "Acidrefluxdiet", "Acmeelevators", "AcneCream", "Acnehomeremedies2012", "Aconnect", "Acorncontrols", "Actech-drives", "Activatedliquid", "Activemds", "Activeseals", "Activitybreaks", "AdMaiorem", "Adalatham194", "AdalbertoRangel", "Adam-Sai", "AdamCartel", "Adambaldwinss", "Adambarnetts1", "Adamdevis", "Adamholland73", "Adamlf", "Adammarshale", "Adamparkar", "Adamwhi86", "Adanjay123", "Adanlloyd49", "Adapterlist", "AdaraHotel", "Adarshhosierymills", "Adasport01", "Addictivemedia", "Addisonclark94", "Addisoncurt", "Additivemaster", "Addy80", "Addysmith", "Adharvaamart", "Adiartech", "Adinkalis", "Adinojones", "Adiprcike", "Adithgraphicdesigns", "Aditya-finfab", "Adityainterior", "Adkins321", "Adksolar", "AdlerLaw", "Adneart01", "AdonesDe23", "Adoption25", "Adremoa", "Adren", "AdrianRKPS", "Adriana15", "Adrianaosorio11", "Adrianasimon", "Adrianhage", "Adrianogianninis", "Adrianus", "Adroit-techna", "Adryn", "Adt-florida", "Adultcallchat", "Advanced-Chiropractic-Rehab-Center", "Advanceddrying", "Advancedexteriors", "Advancedfootandanklesd", "Advancedhomes", "Advancerubber", "Advantagetreeny", "Adventurediscoverytreks", "Adventurespl", "AdvertisingCEO", "Advonnikon", "Adwardcarele", "Adwardmaklon", "Adwardmiclen", "Adwarnsiyan", "Adwords", "Aechellecaves", "Aelbane", "Aepiot", "Aeroequipments", "Aeronejames", "Aeronejamez", "Aeronejhomar33", "Aferrhasim", "Affiliate-radar", "AffiliateABCs", "AffiliateCoach", "Affilrev", "Affinitydrivingschools", "Affirmations9977", "Affluentpage", "Affordable_webhosting", "Affordabledentist", "Affordablereplica", "Affordablesmallbusinessseoservices", "Afia", "Aficaralaw", "Aforeverrecovery", "Africa-Travel", "Afrika111", "Afronom", "Afshispeaks", "Aftab111", "Aftab555", "Ag-af100", "Agabza2010", "Agelessmalereviews", "AgencyQ", "Agentzee", "Aggarwalrubberindustries", "Agiftidea", "Agingjohn", "Agnes11rb4v", "Agnes84561", "Agnesvann", "Agrainofsands", "Agriculturemachine", "Agriculturemachineindia", "Agritech", "Agtechnologies", "Aguapuroequipment", "Agustinpoteete", "Ahanna", "Ahfashion", "Ahito68", "Ahmedabadpneumatic", "Aiainsurance", "Aidenjump", "Ailasmoda", "Aimsinternational", "Aimyourway", "Air-separation-plant", "AirConditioningRepair", "AirGun-Depot", "Airconditioning", "Aires", "Airplanesimulatorgames", "Airporttaxi1", "Airroengineering", "Airtechgasplant", "Airtechgasplants", "Airtet", "Aisterwlsn", "Aithein", "AizaMarie101", "Ajantafoodproducts", "Ajayexim", "Ajayshirma", "Aje842", "Ajnabii", "Ajplumber", "Ak_271984", "Akalanka", "Akankshamart", "Akashfurniture", "Aki015", "Akif", "Akinggirl", "Akshayaboilers", "Akshayurja", "Alainc", "Alamannobjer923", "Alamlothar", "Alamocapital", "Alamoudi", "Alamowatches", "AlanRosinsky", "AlanaSophie", "Alangkarmazin", "Alankarmazin", "Alankarshilpa", "Alankingdave", "Alanmmaxzsd", "Alanpointing123", "Alansalton", "Alansfactoryoutlet", "Alastairclark90", "Albanyhomes", "Albanysalon", "Albanysheetrock", "Albanysuzuki", "Albee123", "Albert20", "AlbertDuran", "AlbertFontaine", "Albertaddy", "Albertaoil123", "Alberto%27s-Electric%2C-UCE", "Albertot1ago", "Albertrmikelscv", "Albertuimax", "Albertwochrisx", "Albertydx", "Albin", "Albiont11", "Albri1", "Albrightpatents", "Alcatelpbx", "Alcoholismtreatment", "Alcoholrehabfl", "Aldaren", "Aldarenxandar", "Alden32", "AldenEagle", "Aldennorris52", "Alder", "Alder-Eagle", "Aldiwan", "Aldora", "Aldougo", "AldrichDesmond", "AldrichDillon", "Aldwyn", "Aldzmodelo", "Alecramon", "AleenaShelly", "Aleksey1994j", "Alenntmaxgt", "Alenstuart", "Alenstuart007", "Alenturetx", "Alesanderburgess", "Aleseohubpages", "Alex00900", "Alex1223321", "Alex12321", "Alex17basler", "Alex2", "Alex2341", "Alex4395", "AlexJohnson420", "AlexJorden", "Alexagraf", "AlexanderDexter", "Alexanderwells642", "Alexandriatoyota", "Alexasakes", "Alexbanzamin", "Alexender", "Alexey", "Alexinawhite", "Alexiskillen", "Alexisnielsen", "Alexmartinyr", "Alexpolelein", "Alexrabe", "Alexreed975", "Alexrsmartins", "Alexsiyoen", "Alextrytomr", "Alextsui", "Alexwi1", "Alexz19", "Alfandi", "Alhindexports", "AliWatkins", "AliaBrown", "Aliadevyn", "Aliatemacx", "Aliatemaxfgh", "Aliatemaxv", "Alic015", "AlicaMetis", "Alicabacon", "Alice-Leung", "AliceHealthcare", "AliceIacuzzo", "Alicecheril", "Alicediets", "Alicemcintosh", "Alicenikolic", "Aliciadwyer", "AlignNet", "Alimessi10", "Alina1", "AlinaOrlova", "Alinagloria142", "Alinalagoviyer", "Alinapayne", "Alishahiggins", "Alishakhatri", "Alisonreddin", "Alissacordry", "Alixzarat", "Alizabaith", "Aljhur69", "Alkantenik", "AllElectric", "AllGreenLawns", "Allabouttoronto", "Allacesservices", "Allan285", "Allanalguire", "Allanta", "Allbestmessages", "Allblogtools", "Allcoast", "Alleganydental", "Allenkelly02", "Allenmorris36", "Allenssgarments", "Allgardenmachine", "Allgardenmachines", "Allhybrid", "Allianzexports", "Allina-jas", "Allisonbaunt", "Allisonfelix", "Allisonpaulsi924", "Allitsupported", "AllnOne", "Alloysteelpipes", "Allshore", "Allstate", "Allwc", "Allwinerecips", "Almamasmas", "Almasn4712", "Alnabiotech", "Alnikolic", "Alocalseo", "Alohaeverafter", "Alokrubber", "Alomari", "Alonfreediver", "Alorak", "Alphalinear", "Alreanbuc", "AltaMiraRecovery", "Altermarval", "Aluminum00", "Aluminumdiecasting", "Aluminumfence", "Alvin23", "AlvinCook", "Alvinbill", "Alvinbrown", "Alvinjoo", "Alvinolds", "Alviscuttingtools", "Alyajabeen", "Alycedesigns", "Amaalmcclure", "Amackley", "Amaiazohar", "Amalfis-Pizza", "Amandaranhami", "Amaralupin", "Amardan", "Amarketforce", "Amarrmartt", "Ambernecklace", "AmbitEnerg", "Ambit_Energy", "Ambrose", "Ambsil", "Amcguiness77", "Ameliabradshaw", "Ameliahoke411", "Amelm", "American-Invsco", "American-Striping", "Americantrainingonline", "Americarpetcommercial", "Americarpetfloors", "Amescastillo", "Amhebert100", "Ami4567", "Amiciziaeamore", "Amiclubwear", "Amidouche2011", "Amiegrace", "Aminconile", "Aminesbiotech", "Aminsiyone", "Aminul932", "Aminx89", "AmishHandcrafted", "Amit-Poreli", "Amitavaray", "Amitbajpai", "Amitgksingh", "Amitozsingh", "Amitsingh12", "Amjenfrank", "AmlenVigoth1", "Ammaf", "Ammyhilton", "Amod01nara", "Amol111", "Amolebonde", "Amperehourmeter", "Ampmfashion", "Amulo", "Amuorn", "AmyJohnson", "AmyPsa", "AmyTrenton", "Amyback795", "Amyfreeman", "Amyhall837", "Amyharris442", "Amyjackson", "Ana015", "Ana123", "Anab01", "AnabolicSteroids1", "Anaesthesia", "Anandhika", "Anandinternational", "Anandranawat", "AnanyaCreations", "Anapaul", "AnastassiaM", "Anazgombic", "AncientWisdom", "AnciraBuickGMC", "AnciraChevrolet", "Anciranissan", "Anddystand", "Andersonkid04", "Andin2187", "Andr10985", "Andrearayne", "Andrei49", "Andrejewelry", "Andrew-Edwards", "AndrewEdwards24", "Andrewclay57", "Andrewcorbin", "Andrewcruise12", "Andrewgreek", "Andrewgreggs", "Andrewhelland", "Andrewlucky", "Andrewmaxtr", "Andrewmichel");
$wgUser = User::newFromName("MiscBot");
$articleTitles = array("/profilebox-live", "/profilebox-aboutme", "/profilebox-occupation");
$totalDeleted = 0;
$deleteComment = "Deleting unused profile box page";
foreach ($users as $user) {
    $u = User::newFromName($user);
    if ($u) {
        $userPage = $u->getUserPage();
        foreach ($articleTitles as $title) {
            $t = Title::newFromText($userPage->getBaseText() . $title, NS_USER);
            if ($t) {
                $a = new Article($t);
                if ($a->exists()) {
                    if ($a->doDeleteArticle($deleteComment)) {
                        echo $deleteComment . " " . $t->getText() . "\n";
                    }
                }
            }
        }
    }
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:25,代码来源:findSuspectUserPagesSupplement.php

示例14: deleteFile

 /**
  *
  */
 protected function deleteFile($name)
 {
     $t = Title::newFromText($name, NS_FILE);
     $this->assertTrue($t->exists(), "File '{$name}' exists");
     if ($t->exists()) {
         $file = wfFindFile($name, array('ignoreRedirect' => true));
         $empty = "";
         FileDeleteForm::doDelete($t, $file, $empty, "none", true);
         $a = new Article($t);
         $a->doDeleteArticle("testing");
     }
     $t = Title::newFromText($name, NS_FILE);
     $this->assertFalse($t->exists(), "File '{$name}' was deleted");
 }
开发者ID:laiello,项目名称:media-wiki-law,代码行数:17,代码来源:UploadFromUrlTest.php

示例15: executeScript

 function executeScript($type)
 {
     global $wgOut, $wgRequest, $wgUser;
     wfLoadExtensionMessages('Maintenance');
     @set_time_limit(0);
     //if we can, disable the time limit
     $this->setHeaders();
     $wgOut->addHTML($wgUser->getSkin()->makeKnownLinkObj($this->getTitle(), wfMsgHtml('maintenance-backlink')) . '<br />');
     switch ($type) {
         case 'changePassword':
             $name = $wgRequest->getText('wpName');
             $password = $wgRequest->getText('wpPassword');
             $user = User::newFromName($name);
             if (!is_object($user) || !$user->getId()) {
                 $wgOut->addWikiMsg('maintenance-invalidname');
                 return;
             }
             $dbw = wfGetDB(DB_MASTER);
             $user->setPassword($password);
             $user->saveSettings();
             $wgOut->addWikiMsg('maintenance-success', $type);
             break;
         case 'createAndPromote':
             $name = $wgRequest->getText('wpName');
             $password = $wgRequest->getText('wpPassword');
             $bcrat = $wgRequest->getCheck('wpBcrat');
             $user = User::newFromName($name);
             if (!is_object($user)) {
                 $wgOut->addWikiMsg('maintenance-invalidname');
                 return;
             } elseif (0 != $user->idForName()) {
                 $wgOut->addWikiMsg('maintenance-userexists');
                 return;
             }
             $user->addToDatabase();
             $user->setPassword($password);
             $user->saveSettings();
             $user->addGroup('sysop');
             if ($bcrat) {
                 $user->addGroup('bureaucrat');
             }
             $ssu = new SiteStatsUpdate(0, 0, 0, 0, 1);
             $ssu->doUpdate();
             $wgOut->addWikiMsg('maintenance-success', $type);
             break;
         case 'deleteBatch':
             $reason = $wgRequest->getText('wpReason', '');
             $interval = 0;
             $pages = $wgRequest->getText('wpDelete');
             $dbw = wfGetDB(DB_MASTER);
             $lines = explode("\n", $pages);
             foreach ($lines as &$line) {
                 $line = trim($line);
                 if ($line == '') {
                     continue;
                 }
                 $page = Title::newFromText($line);
                 if (is_null($page)) {
                     $wgOut->addWikiMsg('maintenance-invalidtitle', $line);
                     continue;
                 }
                 if (!$page->exists()) {
                     $wgOut->addWikiMsg('maintenance-titlenoexist', $line);
                     continue;
                 }
                 $return = '* ' . $page->getPrefixedText();
                 // Switch the user here from the current user to Delete page script
                 $OldUser = $wgUser;
                 $wgUser = User::newFromName('Delete page script');
                 // Begin transaction
                 $dbw->begin();
                 if ($page->getNamespace() == NS_IMAGE) {
                     $art = new ImagePage($page);
                     $img = wfFindFile($art->mTitle);
                     if (!$img || !$img->delete($reason)) {
                         $return .= '... ' . wfMsg('maintenance-failed');
                     }
                 } else {
                     $art = new Article($page);
                 }
                 $success = $art->doDeleteArticle($reason);
                 // Commit changes to the database
                 $dbw->commit();
                 // ...and switch user back to the old user
                 $wgUser = $OldUser;
                 if ($success) {
                     $return .= '... ' . wfMsg('maintenance-deleted');
                 } else {
                     $return .= '... ' . wfMsg('maintenance-failed');
                 }
                 $wgOut->addWikiText($return);
                 waitForSlaves(5);
             }
             $wgOut->addWikiMsg('maintenance-success', $type);
             break;
         case 'deleteRevision':
             $delete = $wgRequest->getText('wpDelete');
             $revisions = explode("\n", $delete);
             $wgOut->addWikiMsg('maintenance-revdelete', implode(', ', $revisions), wfWikiID());
             $affected = 0;
//.........这里部分代码省略.........
开发者ID:amjadtbssm,项目名称:website,代码行数:101,代码来源:Maintenance_body.php


注:本文中的Article::doDeleteArticle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。