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


PHP UploadBase::checkWarnings方法代碼示例

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


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

示例1: processUpload

 /**
  * Do the upload.
  * Checks are made in SpecialUpload::execute()
  */
 protected function processUpload()
 {
     // Fetch the file if required
     $status = $this->mUpload->fetchFile();
     if (!$status->isOK()) {
         $this->showUploadError($this->getOutput()->parse($status->getWikiText()));
         return;
     }
     if (!Hooks::run('UploadForm:BeforeProcessing', array(&$this))) {
         wfDebug("Hook 'UploadForm:BeforeProcessing' broke processing the file.\n");
         // This code path is deprecated. If you want to break upload processing
         // do so by hooking into the appropriate hooks in UploadBase::verifyUpload
         // and UploadBase::verifyFile.
         // If you use this hook to break uploading, the user will be returned
         // an empty form with no error message whatsoever.
         return;
     }
     // Upload verification
     $details = $this->mUpload->verifyUpload();
     if ($details['status'] != UploadBase::OK) {
         $this->processVerificationError($details);
         return;
     }
     // Verify permissions for this title
     $permErrors = $this->mUpload->verifyTitlePermissions($this->getUser());
     if ($permErrors !== true) {
         $code = array_shift($permErrors[0]);
         $this->showRecoverableUploadError($this->msg($code, $permErrors[0])->parse());
         return;
     }
     $this->mLocalFile = $this->mUpload->getLocalFile();
     // Check warnings if necessary
     if (!$this->mIgnoreWarning) {
         $warnings = $this->mUpload->checkWarnings();
         if ($this->showUploadWarning($warnings)) {
             return;
         }
     }
     // This is as late as we can throttle, after expected issues have been handled
     if (UploadBase::isThrottled($this->getUser())) {
         $this->showRecoverableUploadError($this->msg('actionthrottledtext')->escaped());
         return;
     }
     // Get the page text if this is not a reupload
     if (!$this->mForReUpload) {
         $pageText = self::getInitialPageText($this->mComment, $this->mLicense, $this->mCopyrightStatus, $this->mCopyrightSource, $this->getConfig());
     } else {
         $pageText = false;
     }
     $status = $this->mUpload->performUpload($this->mComment, $pageText, $this->mWatchthis, $this->getUser());
     if (!$status->isGood()) {
         $this->showUploadError($this->getOutput()->parse($status->getWikiText()));
         return;
     }
     // Success, redirect to description page
     $this->mUploadSuccessful = true;
     Hooks::run('SpecialUploadComplete', array(&$this));
     $this->getOutput()->redirect($this->mLocalFile->getTitle()->getFullURL());
 }
開發者ID:Acidburn0zzz,項目名稱:mediawiki,代碼行數:63,代碼來源:SpecialUpload.php

示例2: getApiWarnings

 /**
  * Check warnings if ignorewarnings is not set.
  * Returns a suitable array for inclusion into API results if there were warnings
  * Returns the empty array if there were no warnings
  *
  * @return array
  */
 protected function getApiWarnings()
 {
     $warnings = array();
     if (!$this->mParams['ignorewarnings']) {
         $warnings = $this->mUpload->checkWarnings();
     }
     return $this->transformWarnings($warnings);
 }
開發者ID:slackfaith,項目名稱:deadbrain_site,代碼行數:15,代碼來源:ApiUpload.php

示例3: getApiWarnings

 /**
  * Check warnings.
  * Returns a suitable array for inclusion into API results if there were warnings
  * Returns the empty array if there were no warnings
  *
  * @return array
  */
 protected function getApiWarnings()
 {
     $warnings = $this->mUpload->checkWarnings();
     return $this->transformWarnings($warnings);
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:12,代碼來源:ApiUpload.php

示例4: checkWarnings

 /**
  * Wrapper around the parent function in order to defer checking warnings
  * until the file really has been fetched.
  */
 public function checkWarnings()
 {
     if ($this->mAsync) {
         $this->mIgnoreWarnings = false;
         return array();
     }
     return parent::checkWarnings();
 }
開發者ID:laiello,項目名稱:media-wiki-law,代碼行數:12,代碼來源:UploadFromUrl.php

示例5: uploadImage

 /**
  * @param UploadBase $upload
  * @return array
  */
 private function uploadImage($upload)
 {
     global $wgRequest, $wgUser, $wgEnableUploads;
     $uploadStatus = array("status" => "error");
     if (empty($wgEnableUploads)) {
         $uploadStatus["errors"] = [wfMessage('themedesigner-upload-disabled')->plain()];
     } else {
         $upload->initializeFromRequest($wgRequest);
         $permErrors = $upload->verifyPermissions($wgUser);
         if ($permErrors !== true) {
             $uploadStatus["errors"] = array(wfMsg('badaccess'));
         } else {
             $details = $upload->verifyUpload();
             if ($details['status'] != UploadBase::OK) {
                 $uploadStatus["errors"] = array($this->getUploadErrorMessage($details));
             } else {
                 $warnings = $upload->checkWarnings();
                 if (!empty($warnings)) {
                     $uploadStatus["errors"] = $this->getUploadWarningMessages($warnings);
                 } else {
                     //save temp file
                     $status = $upload->performUpload();
                     $uploadStatus["status"] = "uploadattempted";
                     $uploadStatus["isGood"] = $status->isGood();
                 }
             }
         }
     }
     return $uploadStatus;
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:34,代碼來源:ThemeDesignerController.class.php

示例6: checkWarnings

 /**
  * Wrapper around the parent function in order to defer checking warnings
  * until the file really has been fetched.
  */
 public function checkWarnings()
 {
     return parent::checkWarnings();
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:8,代碼來源:UploadFromUrl.php


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