當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。