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


PHP ParserOutput::addImage方法代码示例

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


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

示例1: fetchFileAndTitle

 /**
  * Fetch a file and its title and register a reference to it.
  * If 'broken' is a key in $options then the file will appear as a broken thumbnail.
  * @param Title $title
  * @param Array $options Array of options to RepoGroup::findFile
  * @return Array ( File or false, Title of file )
  */
 function fetchFileAndTitle($title, $options = array())
 {
     if (isset($options['broken'])) {
         $file = false;
         // broken thumbnail forced by hook
     } elseif (isset($options['sha1'])) {
         // get by (sha1,timestamp)
         $file = RepoGroup::singleton()->findFileFromKey($options['sha1'], $options);
     } else {
         // get by (name,timestamp)
         $file = wfFindFile($title, $options);
     }
     $time = $file ? $file->getTimestamp() : false;
     $sha1 = $file ? $file->getSha1() : false;
     # Register the file as a dependency...
     $this->mOutput->addImage($title->getDBkey(), $time, $sha1);
     if ($file && !$title->equals($file->getTitle())) {
         # Update fetched file title
         $title = $file->getTitle();
         if (is_null($file->getRedirectedTitle())) {
             # This file was not a redirect, but the title does not match.
             # Register under the new name because otherwise the link will
             # get lost.
             $this->mOutput->addImage($title->getDBkey(), $time, $sha1);
         }
     }
     return array($file, $title);
 }
开发者ID:h4ck3rm1k3,项目名称:mediawiki,代码行数:35,代码来源:Parser.php

示例2: fetchFileAndTitle

 /**
  * Fetch a file and its title and register a reference to it.
  * If 'broken' is a key in $options then the file will appear as a broken thumbnail.
  * @param Title $title
  * @param array $options Array of options to RepoGroup::findFile
  * @return Array ( File or false, Title of file )
  */
 function fetchFileAndTitle($title, $options = array())
 {
     $file = $this->fetchFileNoRegister($title, $options);
     $time = $file ? $file->getTimestamp() : false;
     $sha1 = $file ? $file->getSha1() : false;
     # Register the file as a dependency...
     $this->mOutput->addImage($title->getDBkey(), $time, $sha1);
     if ($file && !$title->equals($file->getTitle())) {
         # Update fetched file title
         $title = $file->getTitle();
         $this->mOutput->addImage($title->getDBkey(), $time, $sha1);
     }
     return array($file, $title);
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:21,代码来源:Parser.php

示例3: fetchFileAndTitle

	/**
	 * Fetch a file and its title and register a reference to it.
	 * If 'broken' is a key in $options then the file will appear as a broken thumbnail.
	 * @param Title $title
	 * @param array $options Array of options to RepoGroup::findFile
	 * @return Array ( File or false, Title of file )
	 */
	function fetchFileAndTitle( $title, $options = array() ) {
		$file = $this->fetchFileNoRegister( $title, $options );

		$time = $file ? $file->getTimestamp() : false;
		$sha1 = $file ? $file->getSha1() : false;
		# Register the file as a dependency...
		$this->mOutput->addImage( $title->getDBkey(), $time, $sha1 );
		if ( $file && !$title->equals( $file->getTitle() ) ) {
			# Update fetched file title
			$title = $file->getTitle();
			if ( is_null( $file->getRedirectedTitle() ) ) {
				# This file was not a redirect, but the title does not match.
				# Register under the new name because otherwise the link will
				# get lost.
				$this->mOutput->addImage( $title->getDBkey(), $time, $sha1 );
			}
		}
		return array( $file, $title );
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:26,代码来源:Parser.php


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