本文整理汇总了PHP中ContentHandler::deprecated方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentHandler::deprecated方法的具体用法?PHP ContentHandler::deprecated怎么用?PHP ContentHandler::deprecated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentHandler
的用法示例。
在下文中一共展示了ContentHandler::deprecated方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: newFromRedirectArray
/**
* Extract a redirect destination from a string and return an
* array of Titles, or null if the text doesn't contain a valid redirect
* The last element in the array is the final destination after all redirects
* have been resolved (up to $wgMaxRedirects times)
*
* @param string $text Text with possible redirect
* @return Title[] Array of Titles, with the destination last
* @deprecated since 1.21, use Content::getRedirectChain instead.
*/
public static function newFromRedirectArray($text)
{
ContentHandler::deprecated(__METHOD__, '1.21');
$content = ContentHandler::makeContent($text, null, CONTENT_MODEL_WIKITEXT);
return $content->getRedirectChain();
}
示例2: getAutosummary
/**
* Return an applicable autosummary if one exists for the given edit.
* @param string|null $oldtext the previous text of the page.
* @param string|null $newtext The submitted text of the page.
* @param int $flags bitmask: a bitmask of flags submitted for the edit.
* @return string An appropriate autosummary, or an empty string.
*
* @deprecated since 1.21, use ContentHandler::getAutosummary() instead
*/
public static function getAutosummary( $oldtext, $newtext, $flags ) {
// NOTE: stub for backwards-compatibility. assumes the given text is wikitext. will break horribly if it isn't.
ContentHandler::deprecated( __METHOD__, '1.21' );
$handler = ContentHandler::getForModelID( CONTENT_MODEL_WIKITEXT );
$oldContent = is_null( $oldtext ) ? null : $handler->unserializeContent( $oldtext );
$newContent = is_null( $newtext ) ? null : $handler->unserializeContent( $newtext );
return $handler->getAutosummary( $oldContent, $newContent, $flags );
}
示例3: getText
/**
* @return string
*
* @deprecated Since 1.21, use getContent() instead.
*/
function getText()
{
ContentHandler::deprecated(__METHOD__, '1.21');
return $this->text;
}
示例4: setText
/**
* Use specified text instead of loading from the database
* @deprecated since 1.21, use setContent() instead.
*/
public function setText($oldText, $newText)
{
ContentHandler::deprecated(__METHOD__, "1.21");
$oldContent = ContentHandler::makeContent($oldText, $this->getTitle());
$newContent = ContentHandler::makeContent($newText, $this->getTitle());
$this->setContent($oldContent, $newContent);
}
示例5: fetchContent
/**
* Get text of an article from database
* Does *NOT* follow redirects.
*
* @protected
* @note this is really internal functionality that should really NOT be used by other functions. For accessing
* article content, use the WikiPage class, especially WikiBase::getContent(). However, a lot of legacy code
* uses this method to retrieve page text from the database, so the function has to remain public for now.
*
* @return mixed string containing article contents, or false if null
* @deprecated in 1.21, use WikiPage::getContent() instead
*/
function fetchContent()
{
#BC cruft!
ContentHandler::deprecated(__METHOD__, '1.21');
if ($this->mContentLoaded && $this->mContent) {
return $this->mContent;
}
wfProfileIn(__METHOD__);
$content = $this->fetchContentObject();
$this->mContent = ContentHandler::getContentText($content);
#@todo: get rid of mContent everywhere!
ContentHandler::runLegacyHooks('ArticleAfterFetchContent', array(&$this, &$this->mContent));
wfProfileOut(__METHOD__);
return $this->mContent;
}
示例6: fetchContent
/**
* Get text of an article from database
* Does *NOT* follow redirects.
*
* @protected
* @note This is really internal functionality that should really NOT be
* used by other functions. For accessing article content, use the WikiPage
* class, especially WikiBase::getContent(). However, a lot of legacy code
* uses this method to retrieve page text from the database, so the function
* has to remain public for now.
*
* @return string|bool String containing article contents, or false if null
* @deprecated since 1.21, use WikiPage::getContent() instead
*/
function fetchContent()
{
// BC cruft!
ContentHandler::deprecated(__METHOD__, '1.21');
if ($this->mContentLoaded && $this->mContent) {
return $this->mContent;
}
$content = $this->fetchContentObject();
if (!$content) {
return false;
}
// @todo Get rid of mContent everywhere!
$this->mContent = ContentHandler::getContentText($content);
ContentHandler::runLegacyHooks('ArticleAfterFetchContent', array(&$this, &$this->mContent));
return $this->mContent;
}
示例7: mergeChangesInto
/**
* Attempts to merge text content with base and current revisions
*
* @param $editText string
*
* @return bool
* @deprecated since 1.21, use mergeChangesIntoContent() instead
*/
function mergeChangesInto(&$editText)
{
ContentHandler::deprecated(__METHOD__, "1.21");
$editContent = $this->toEditContent($editText);
$ok = $this->mergeChangesIntoContent($editContent);
if ($ok) {
$editText = $this->toEditText($editContent);
return true;
}
return false;
}
示例8: getRawText
/**
* Fetch revision text without regard for view restrictions
*
* @return String
*
* @deprecated since 1.21. Instead, use Revision::getContent( Revision::RAW )
* or Revision::getSerializedData() as appropriate.
*/
public function getRawText()
{
ContentHandler::deprecated(__METHOD__, "1.21");
return $this->getText(self::RAW);
}
示例9: getText
/**
* Call to WikiPage function for backwards compatibility.
* @see WikiPage::getText
*/
public function getText($audience = Revision::FOR_PUBLIC, User $user = null)
{
ContentHandler::deprecated(__METHOD__, '1.21');
return $this->mPage->getText($audience, $user);
}
示例10: replaceSection
/**
* Call to WikiPage function for backwards compatibility.
* @see WikiPage::replaceSection
*/
public function replaceSection($sectionId, $text, $sectionTitle = '', $edittime = null)
{
ContentHandler::deprecated(__METHOD__, '1.21');
return $this->mPage->replaceSection($sectionId, $text, $sectionTitle, $edittime);
}
示例11: mergeChangesInto
/**
* @private
* @todo document
*
* @param $editText string
*
* @return bool
* @deprecated since 1.21, use mergeChangesIntoContent() instead
*/
function mergeChangesInto(&$editText)
{
ContentHandler::deprecated(__METHOD__, "1.21");
wfProfileIn(__METHOD__);
$db = wfGetDB(DB_MASTER);
// This is the revision the editor started from
$baseRevision = $this->getBaseRevision();
if (is_null($baseRevision)) {
wfProfileOut(__METHOD__);
return false;
}
$baseText = $baseRevision->getText();
// The current state, we want to merge updates into it
$currentRevision = Revision::loadFromTitle($db, $this->mTitle);
if (is_null($currentRevision)) {
wfProfileOut(__METHOD__);
return false;
}
$currentText = $currentRevision->getText();
$result = '';
$editText = $this->toEditText($editText);
if (wfMerge($baseText, $editText, $currentText, $result)) {
$editText = $result;
wfProfileOut(__METHOD__);
return true;
} else {
wfProfileOut(__METHOD__);
return false;
}
}
示例12: getText
/**
* Fetch revision text if it's available to the specified audience.
* If the specified audience does not have the ability to view this
* revision, an empty string will be returned.
*
* @param int $audience One of:
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
* @param User $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
*
* @deprecated since 1.21, use getContent() instead
* @todo Replace usage in core
* @return string
*/
public function getText($audience = self::FOR_PUBLIC, User $user = null)
{
ContentHandler::deprecated(__METHOD__, '1.21');
$content = $this->getContent($audience, $user);
return ContentHandler::getContentText($content);
# returns the raw content text, if applicable
}
示例13: generateDiffBody
/**
* Generate a diff, no caching
*
* @param string $otext Old text, must be already segmented
* @param string $ntext New text, must be already segmented
*
* @return bool|string
* @deprecated since 1.21, use generateContentDiffBody() instead!
*/
public function generateDiffBody($otext, $ntext)
{
ContentHandler::deprecated(__METHOD__, "1.21");
return $this->generateTextDiffBody($otext, $ntext);
}