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


PHP UploadBase::getExistsWarning方法代码示例

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


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

示例1: ajaxGetExistsWarning

 /**
  * Get a list of warnings
  *
  * @param $filename String: local filename, e.g. 'file exists', 'non-descriptive filename'
  * @return Array: list of warning messages
  */
 public static function ajaxGetExistsWarning($filename)
 {
     $file = wfFindFile($filename);
     if (!$file) {
         // Force local file so we have an object to do further checks against
         // if there isn't an exact match...
         $file = wfLocalFile($filename);
     }
     $s = ' ';
     if ($file) {
         $exists = UploadBase::getExistsWarning($file);
         $warning = self::getExistsWarning($exists);
         if ($warning !== '') {
             $s = "<div>{$warning}</div>";
         }
     }
     return $s;
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:24,代码来源:SpecialUpload.php

示例2: getInfo


//.........这里部分代码省略.........
         if ($length) {
             // Call it duration, because "length" can be ambiguous.
             $vals['duration'] = (double) $length;
         }
     }
     $pcomment = isset($prop['parsedcomment']);
     $comment = isset($prop['comment']);
     if ($pcomment || $comment) {
         if ($file->isDeleted(File::DELETED_COMMENT)) {
             $vals['commenthidden'] = true;
             $anyHidden = true;
         }
         if ($canShowField(File::DELETED_COMMENT)) {
             if ($pcomment) {
                 $vals['parsedcomment'] = Linker::formatComment($file->getDescription(File::RAW), $file->getTitle());
             }
             if ($comment) {
                 $vals['comment'] = $file->getDescription(File::RAW);
             }
         }
     }
     $canonicaltitle = isset($prop['canonicaltitle']);
     $url = isset($prop['url']);
     $sha1 = isset($prop['sha1']);
     $meta = isset($prop['metadata']);
     $extmetadata = isset($prop['extmetadata']);
     $commonmeta = isset($prop['commonmetadata']);
     $mime = isset($prop['mime']);
     $mediatype = isset($prop['mediatype']);
     $archive = isset($prop['archivename']);
     $bitdepth = isset($prop['bitdepth']);
     $uploadwarning = isset($prop['uploadwarning']);
     if ($uploadwarning) {
         $vals['html'] = SpecialUpload::getExistsWarning(UploadBase::getExistsWarning($file));
     }
     if ($file->isDeleted(File::DELETED_FILE)) {
         $vals['filehidden'] = true;
         $anyHidden = true;
     }
     if ($anyHidden && $file->isDeleted(File::DELETED_RESTRICTED)) {
         $vals['suppressed'] = true;
     }
     if (!$canShowField(File::DELETED_FILE)) {
         //Early return, tidier than indenting all following things one level
         return $vals;
     }
     if ($canonicaltitle) {
         $vals['canonicaltitle'] = $file->getTitle()->getPrefixedText();
     }
     if ($url) {
         if (!is_null($thumbParams)) {
             $mto = $file->transform($thumbParams);
             self::$transformCount++;
             if ($mto && !$mto->isError()) {
                 $vals['thumburl'] = wfExpandUrl($mto->getUrl(), PROTO_CURRENT);
                 // bug 23834 - If the URL's are the same, we haven't resized it, so shouldn't give the wanted
                 // thumbnail sizes for the thumbnail actual size
                 if ($mto->getUrl() !== $file->getUrl()) {
                     $vals['thumbwidth'] = intval($mto->getWidth());
                     $vals['thumbheight'] = intval($mto->getHeight());
                 } else {
                     $vals['thumbwidth'] = intval($file->getWidth());
                     $vals['thumbheight'] = intval($file->getHeight());
                 }
                 if (isset($prop['thumbmime']) && $file->getHandler()) {
                     list(, $mime) = $file->getHandler()->getThumbType($mto->getExtension(), $file->getMimeType(), $thumbParams);
开发者ID:sukesan1984,项目名称:agrarian-wiki,代码行数:67,代码来源:ApiQueryImageInfo.php

示例3: getInfo


//.........这里部分代码省略.........
		$pcomment = isset( $prop['parsedcomment'] );
		$comment = isset( $prop['comment'] );

		if ( $pcomment || $comment ) {
			if ( $file->isDeleted( File::DELETED_COMMENT ) ) {
				$vals['commenthidden'] = '';
			} else {
				if ( $pcomment ) {
					$vals['parsedcomment'] = Linker::formatComment(
						$file->getDescription(), $file->getTitle() );
				}
				if ( $comment ) {
					$vals['comment'] = $file->getDescription();
				}
			}
		}

		$url = isset( $prop['url'] );
		$sha1 = isset( $prop['sha1'] );
		$meta = isset( $prop['metadata'] );
		$mime = isset( $prop['mime'] );
		$mediatype = isset( $prop['mediatype'] );
		$archive = isset( $prop['archivename'] );
		$bitdepth = isset( $prop['bitdepth'] );
		$uploadwarning = isset( $prop['uploadwarning'] );

		if ( ( $url || $sha1 || $meta || $mime || $mediatype || $archive || $bitdepth )
				&& $file->isDeleted( File::DELETED_FILE ) ) {
			$vals['filehidden'] = '';

			//Early return, tidier than indenting all following things one level
			return $vals;
		}

		if ( $url ) {
			if ( !is_null( $thumbParams ) ) {
				$mto = $file->transform( $thumbParams );
				self::$transformCount++;
				if ( $mto && !$mto->isError() ) {
					$vals['thumburl'] = wfExpandUrl( $mto->getUrl(), PROTO_CURRENT );

					// bug 23834 - If the URL's are the same, we haven't resized it, so shouldn't give the wanted
					// thumbnail sizes for the thumbnail actual size
					if ( $mto->getUrl() !== $file->getUrl() ) {
						$vals['thumbwidth'] = intval( $mto->getWidth() );
						$vals['thumbheight'] = intval( $mto->getHeight() );
					} else {
						$vals['thumbwidth'] = intval( $file->getWidth() );
						$vals['thumbheight'] = intval( $file->getHeight() );
					}

					if ( isset( $prop['thumbmime'] ) && $file->getHandler() ) {
						list( , $mime ) = $file->getHandler()->getThumbType(
							$mto->getExtension(), $file->getMimeType(), $thumbParams );
						$vals['thumbmime'] = $mime;
					}
				} elseif ( $mto && $mto->isError() ) {
					$vals['thumberror'] = $mto->toText();
				}
			}
			$vals['url'] = wfExpandUrl( $file->getFullURL(), PROTO_CURRENT );
			$vals['descriptionurl'] = wfExpandUrl( $file->getDescriptionUrl(), PROTO_CURRENT );
		}

		if ( $sha1 ) {
			$vals['sha1'] = wfBaseConvert( $file->getSha1(), 36, 16, 40 );
		}

		if ( $meta ) {
			wfSuppressWarnings();
			$metadata = unserialize( $file->getMetadata() );
			wfRestoreWarnings();
			if ( $metadata && $version !== 'latest' ) {
				$metadata = $file->convertMetadataVersion( $metadata, $version );
			}
			$vals['metadata'] = $metadata ? self::processMetaData( $metadata, $result ) : null;
		}

		if ( $mime ) {
			$vals['mime'] = $file->getMimeType();
		}

		if ( $mediatype ) {
			$vals['mediatype'] = $file->getMediaType();
		}

		if ( $archive && $file->isOld() ) {
			$vals['archivename'] = $file->getArchiveName();
		}

		if ( $bitdepth ) {
			$vals['bitdepth'] = $file->getBitDepth();
		}

		if ( $uploadwarning ) {
			$vals['html'] = SpecialUpload::getExistsWarning( UploadBase::getExistsWarning( $file ) );
		}

		return $vals;
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:101,代码来源:ApiQueryImageInfo.php


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