當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ContentHandler::deprecated方法代碼示例

本文整理匯總了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();
 }
開發者ID:MediaWiki-stable,項目名稱:1.26.1,代碼行數:16,代碼來源:Title.php

示例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 );
	}
開發者ID:nahoj,項目名稱:mediawiki_ynh,代碼行數:20,代碼來源:WikiPage.php

示例3: getText

 /**
  * @return string
  *
  * @deprecated Since 1.21, use getContent() instead.
  */
 function getText()
 {
     ContentHandler::deprecated(__METHOD__, '1.21');
     return $this->text;
 }
開發者ID:eliagbayani,項目名稱:LiteratureEditor,代碼行數:10,代碼來源:Import.php

示例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);
 }
開發者ID:guochangjiang,項目名稱:mediawiki,代碼行數:11,代碼來源:DifferenceEngine.php

示例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;
 }
開發者ID:nischayn22,項目名稱:mediawiki-core,代碼行數:27,代碼來源:Article.php

示例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;
 }
開發者ID:ngertrudiz,項目名稱:mediawiki,代碼行數:30,代碼來源:Article.php

示例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;
 }
開發者ID:Grprashanthkumar,項目名稱:ColfusionWeb,代碼行數:19,代碼來源:EditPage.php

示例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);
 }
開發者ID:mangowi,項目名稱:mediawiki,代碼行數:13,代碼來源:Revision.php

示例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);
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:9,代碼來源:Article.php

示例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);
 }
開發者ID:emmyansel,項目名稱:mediawiki,代碼行數:9,代碼來源:Article.php

示例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;
     }
 }
開發者ID:nischayn22,項目名稱:mediawiki-core,代碼行數:39,代碼來源:EditPage.php

示例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
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:23,代碼來源:Revision.php

示例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);
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:14,代碼來源:DifferenceEngine.php


注:本文中的ContentHandler::deprecated方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。