本文整理汇总了PHP中WikiPage::clear方法的典型用法代码示例。如果您正苦于以下问题:PHP WikiPage::clear方法的具体用法?PHP WikiPage::clear怎么用?PHP WikiPage::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WikiPage
的用法示例。
在下文中一共展示了WikiPage::clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clear
/**
* Clear the object
*/
public function clear()
{
$this->mContentLoaded = false;
$this->mRedirectedFrom = null;
# Title object if set
$this->mRevIdFetched = 0;
$this->mRedirectUrl = false;
$this->mPage->clear();
}
示例2: clear
/**
* Clear object process cache values
* @return void
*/
public function clear()
{
$this->stable = 0;
$this->stableRev = null;
$this->revsArePending = null;
$this->pendingRevCount = null;
$this->pageConfig = null;
$this->syncedInTracking = null;
$this->file = null;
parent::clear();
// call super!
}
示例3: forceRevisionDate
/**
* @param WikiPage $page
* @param string|int $timestamp
*/
protected function forceRevisionDate(WikiPage $page, $timestamp)
{
$dbw = wfGetDB(DB_MASTER);
$dbw->update('revision', array('rev_timestamp' => $dbw->timestamp($timestamp)), array('rev_id' => $page->getLatest()));
$page->clear();
}
示例4: internalAttemptSave
//.........这里部分代码省略.........
// message with content equivalent to default (allow empty pages
// in this case to disable messages, see bug 50124)
$defaultMessageText = $this->mTitle->getDefaultMessageText();
if ($this->mTitle->getNamespace() === NS_MEDIAWIKI && $defaultMessageText !== false) {
$defaultText = $defaultMessageText;
} else {
$defaultText = '';
}
if (!$this->allowBlankArticle && $this->textbox1 === $defaultText) {
$this->blankArticle = true;
$status->fatal('blankarticle');
$status->setResult(false, self::AS_BLANK_ARTICLE);
return $status;
}
if (!$this->runPostMergeFilters($textbox_content, $status, $wgUser)) {
return $status;
}
$content = $textbox_content;
$result['sectionanchor'] = '';
if ($this->section == 'new') {
if ($this->sectiontitle !== '') {
// Insert the section title above the content.
$content = $content->addSectionHeader($this->sectiontitle);
} elseif ($this->summary !== '') {
// Insert the section title above the content.
$content = $content->addSectionHeader($this->summary);
}
$this->summary = $this->newSectionSummary($result['sectionanchor']);
}
$status->value = self::AS_SUCCESS_NEW_ARTICLE;
} else {
# not $new
# Article exists. Check for edit conflict.
$this->page->clear();
# Force reload of dates, etc.
$timestamp = $this->page->getTimestamp();
wfDebug("timestamp: {$timestamp}, edittime: {$this->edittime}\n");
if ($timestamp != $this->edittime) {
$this->isConflict = true;
if ($this->section == 'new') {
if ($this->page->getUserText() == $wgUser->getName() && $this->page->getComment() == $this->newSectionSummary()) {
// Probably a duplicate submission of a new comment.
// This can happen when CDN resends a request after
// a timeout but the first one actually went through.
wfDebug(__METHOD__ . ": duplicate new section submission; trigger edit conflict!\n");
} else {
// New comment; suppress conflict.
$this->isConflict = false;
wfDebug(__METHOD__ . ": conflict suppressed; new section\n");
}
} elseif ($this->section == '' && Revision::userWasLastToEdit(DB_MASTER, $this->mTitle->getArticleID(), $wgUser->getId(), $this->edittime)) {
# Suppress edit conflict with self, except for section edits where merging is required.
wfDebug(__METHOD__ . ": Suppressing edit conflict, same user.\n");
$this->isConflict = false;
}
}
// If sectiontitle is set, use it, otherwise use the summary as the section title.
if ($this->sectiontitle !== '') {
$sectionTitle = $this->sectiontitle;
} else {
$sectionTitle = $this->summary;
}
$content = null;
if ($this->isConflict) {
wfDebug(__METHOD__ . ": conflict! getting section '{$this->section}' for time '{$this->edittime}'" . " (article time '{$timestamp}')\n");
$content = $this->page->replaceSectionContent($this->section, $textbox_content, $sectionTitle, $this->edittime);