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


PHP PageType::GetPageType方法代碼示例

本文整理匯總了PHP中PageType::GetPageType方法的典型用法代碼示例。如果您正苦於以下問題:PHP PageType::GetPageType方法的具體用法?PHP PageType::GetPageType怎麽用?PHP PageType::GetPageType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PageType的用法示例。


在下文中一共展示了PageType::GetPageType方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: TransformedText

 /** Constructor.
  *
  * @param WikiDB_Page $page
  * @param string $text  The packed page revision content.
  * @param hash $meta    The version meta-data.
  * @param string $type_override  For markup of page using a different
  *        pagetype than that specified in its version meta-data.
  */
 function TransformedText($page, $text, $meta, $type_override = false)
 {
     $pagetype = false;
     if ($type_override) {
         $pagetype = $type_override;
     } elseif (isset($meta['pagetype'])) {
         $pagetype = $meta['pagetype'];
     }
     $this->_type = PageType::GetPageType($pagetype);
     $this->CacheableMarkup($this->_type->transform($page, $text, $meta), $page->getName());
 }
開發者ID:neymanna,項目名稱:fusionforge,代碼行數:19,代碼來源:PageType.php

示例2: getTransformedContent

 /**
  * Get the transformed content of a page.
  *
  * @param string $pagetype  Override the page-type of the revision.
  *
  * @return object An XmlContent-like object containing the page transformed
  * contents.
  */
 function getTransformedContent($pagetype_override = false)
 {
     $backend =& $this->_wikidb->_backend;
     if ($pagetype_override) {
         // Figure out the normal page-type for this page.
         $type = PageType::GetPageType($this->get('pagetype'));
         if ($type->getName() == $pagetype_override) {
             $pagetype_override = false;
         }
         // Not really an override...
     }
     if ($pagetype_override) {
         // Overriden page type, don't cache (or check cache).
         return new TransformedText($this->getPage(), $this->getPackedContent(), $this->getMetaData(), $pagetype_override);
     }
     $possibly_cache_results = true;
     if (!USECACHE or WIKIDB_NOCACHE_MARKUP) {
         if (WIKIDB_NOCACHE_MARKUP == 'purge') {
             // flush cache for this page.
             $page = $this->getPage();
             $page->set('_cached_html', '');
             // ignored with !USECACHE
         }
         $possibly_cache_results = false;
     } elseif (USECACHE and !$this->_transformedContent) {
         //$backend->lock();
         if ($this->isCurrent()) {
             $page = $this->getPage();
             $this->_transformedContent = TransformedText::unpack($page->get('_cached_html'));
         } else {
             $possibly_cache_results = false;
         }
         //$backend->unlock();
     }
     if (!$this->_transformedContent) {
         $this->_transformedContent = new TransformedText($this->getPage(), $this->getPackedContent(), $this->getMetaData());
         if ($possibly_cache_results and !WIKIDB_NOCACHE_MARKUP) {
             // If we're still the current version, cache the transfomed page.
             //$backend->lock();
             if ($this->isCurrent()) {
                 $page->set('_cached_html', $this->_transformedContent->pack());
             }
             //$backend->unlock();
         }
     }
     return $this->_transformedContent;
 }
開發者ID:nterray,項目名稱:tuleap,代碼行數:55,代碼來源:WikiDB.php


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