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


PHP UploadBase::stashFile方法代码示例

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


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

示例1: performStash

 /**
  * Stash the file and return the file key
  * Also re-raises exceptions with slightly more informative message strings (useful for API)
  * @throws MWException
  * @return String file key
  */
 function performStash()
 {
     try {
         $fileKey = $this->mUpload->stashFile()->getFileKey();
     } catch (MWException $e) {
         $message = 'Stashing temporary file failed: ' . get_class($e) . ' ' . $e->getMessage();
         wfDebug(__METHOD__ . ' ' . $message . "\n");
         throw new MWException($message);
     }
     return $fileKey;
 }
开发者ID:tuxmania87,项目名称:GalaxyAdventures,代码行数:17,代码来源:ApiUpload.php

示例2: performStash

 /**
  * Stash the file and return the file key
  * Also re-raises exceptions with slightly more informative message strings (useful for API)
  * @throws MWException
  * @return string File key
  */
 private function performStash()
 {
     try {
         $stashFile = $this->mUpload->stashFile($this->getUser());
         if (!$stashFile) {
             throw new MWException('Invalid stashed file');
         }
         $fileKey = $stashFile->getFileKey();
     } catch (Exception $e) {
         $message = 'Stashing temporary file failed: ' . get_class($e) . ' ' . $e->getMessage();
         wfDebug(__METHOD__ . ' ' . $message . "\n");
         $className = get_class($e);
         throw new $className($message);
     }
     return $fileKey;
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:22,代码来源:ApiUpload.php

示例3: stashFile

 /**
  * Stash the file.
  *
  * @param User $user
  * @return UploadStashFile
  */
 public function stashFile(User $user = null)
 {
     // replace mLocalFile with an instance of UploadStashFile, which adds some methods
     // that are useful for stashed files.
     $this->mLocalFile = parent::stashFile($user);
     return $this->mLocalFile;
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:13,代码来源:UploadFromStash.php

示例4: stashFile

 /**
  * There is no need to stash the image twice
  */
 public function stashFile($key = null)
 {
     if (!empty($this->mLocalFile)) {
         return $this->mLocalFile;
     }
     return parent::stashFile($key);
 }
开发者ID:natalieschauser,项目名称:csp_media_wiki,代码行数:10,代码来源:UploadFromStash.php


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