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


PHP WikiError::toString方法代碼示例

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


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

示例1: processUpload

 function processUpload()
 {
     global $wgUser, $wgOut, $wgFileExtensions;
     $details = null;
     $value = null;
     $value = $this->internalProcessUpload($details);
     switch ($value) {
         case self::SUCCESS:
             // don't... do... REDIRECT
             return;
         case self::BEFORE_PROCESSING:
             return false;
         case self::LARGE_FILE_SERVER:
             return wfMsg('largefileserver');
         case self::EMPTY_FILE:
             return wfMsg('emptyfile');
         case self::MIN_LENGTH_PARTNAME:
             return wfMsg('minlength1');
             return;
         case self::ILLEGAL_FILENAME:
             $filtered = $details['filtered'];
             return wfMsg('illegalfilename', $filtered);
         case self::PROTECTED_PAGE:
             return wfMsg('protectedpage');
         case self::OVERWRITE_EXISTING_FILE:
             $errorText = $details['overwrite'];
             $overwrite = new WikiError($wgOut->parse($errorText));
             return $overwrite->toString();
         case self::FILETYPE_MISSING:
             return wfMsg('filetype-missing');
         case self::FILETYPE_BADTYPE:
             $finalExt = $details['finalExt'];
             return wfMsg('filetype-badtype');
         case self::VERIFICATION_ERROR:
             $veri = $details['veri'];
             return $veri->toString();
         case self::UPLOAD_VERIFICATION_ERROR:
             $error = $details['error'];
             return $error;
         case self::UPLOAD_WARNING:
             $warning = $details['warning'];
             return $warning;
     }
     throw new MWException(__METHOD__ . ": Unknown value `{$value}`");
 }
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:45,代碼來源:CreatePageImageUploadForm.php

示例2: processUpload


//.........這裏部分代碼省略.........
                         $duration = $granulepos / $page['rate'];
                     }
                 }
                 fclose($f);
             }
             $dbr =& wfGetDB(DB_WRITE);
             $text = '' . $wgScriptPath . '/images/' . $this->mLocalFile->getUrlRel();
             if ($duration === null) {
                 $duration = 0;
             }
             if ($dbr->insert($mvMediaFilesTable, array('path' => $text, 'duration' => $duration, 'file_desc_msg' => $file_desc_msg), __METHOD__)) {
                 $result = $dbr->query("SELECT LAST_INSERT_ID() AS id");
                 $row = $dbr->fetchObject($result);
                 $id = $row->id;
                 if ($dbr->insert($mvStreamFilesTable, array('file_id' => $id, 'stream_id' => $stream_id), __METHOD__)) {
                     $stream_name = MV_Stream::getStreamNameFromId($stream_id);
                     $title = Title::newFromText($stream_name, MV_NS_STREAM);
                     $wgOut->redirect($title->getLocalURL("action=edit"));
                 } else {
                     $html .= 'Inserting file path into DB failed, Please notify the Administrator immediately';
                 }
             } else {
                 $html .= 'Inserting file path into DB failed, Please notify the Administrator immediately';
             }
             /*
             				
             				if ($dbr->insert($mvStreamFilesTable, array('stream_id'=>$stream_id))) {
             					$result = $dbr->query("SELECT LAST_INSERT_ID()");
             					$row = $dbr->fetchObject($result);
             					if ($duration===null)$duration=0;
             					if ($dbr->insert($mvMediaFilesTable, array('id'=>$row->id,'path'=>$text,'duration'=>$duration))) {
             					
             						//$html .='<input type="button" name="Close" value="Close" Onclick="window.opener.document.getElementById(\'path\').value=\''.$wgScriptPath.'/images/'.$this->mLocalFile->getUrlRel().'\'; window.opener.document.getElementById(\'duration\').value='.floor($duration).'; window.close()"></input>' ;
             						$stream_name = MV_Stream::getStreamNameFromId($stream_id);
             						$title = Title::newFromText( $stream_name, MV_NS_STREAM  );
             						$wgOut->redirect($title->getLocalURL("action=edit"));	
             						
             					}
             					else {
             						$html .= 'Inserting file path into DB failed, Please notify the Administrator immediately';
             					}
             				} else {
             				$html .= 'Inserting file path into DB failed, Please notify the Administrator immediately';
             				}
             */
             $wgOut->addHTML($html);
             break;
         case self::BEFORE_PROCESSING:
             break;
         case self::LARGE_FILE_SERVER:
             $this->mainUploadForm(wfMsgHtml('largefileserver'));
             break;
         case self::EMPTY_FILE:
             $this->mainUploadForm(wfMsgHtml('emptyfile'));
             break;
         case self::MIN_LENGHT_PARTNAME:
             $this->mainUploadForm(wfMsgHtml('minlength1'));
             break;
         case self::ILLEGAL_FILENAME:
             $filtered = $details['filtered'];
             $this->uploadError(wfMsgWikiHtml('illegalfilename', htmlspecialchars($filtered)));
             break;
         case self::PROTECTED_PAGE:
             $this->uploadError(wfMsgWikiHtml('protectedpage'));
             break;
         case self::OVERWRITE_EXISTING_FILE:
             $errorText = $details['overwrite'];
             $overwrite = new WikiError($wgOut->parse($errorText));
             $this->uploadError($overwrite->toString());
             break;
         case self::FILETYPE_MISSING:
             $this->uploadError(wfMsgExt('filetype-missing', array('parseinline')));
             break;
         case self::FILETYPE_BADTYPE:
             $finalExt = $details['finalExt'];
             $this->uploadError(wfMsgExt('filetype-banned-type', array('parseinline'), htmlspecialchars($finalExt), implode(wfMsgExt('comma-separator', array('escapenoentities')), $wgFileExtensions)));
             break;
         case self::VERIFICATION_ERROR:
             $veri = $details['veri'];
             $this->uploadError($veri->toString());
             break;
         case self::UPLOAD_VERIFICATION_ERROR:
             $error = $details['error'];
             $this->uploadError($error);
             break;
         case self::UPLOAD_WARNING:
             $warning = $details['warning'];
             $this->uploadWarning($warning);
             break;
         case self::INTERNAL_ERROR:
             $internal = $details['internal'];
             $this->showError($internal);
             break;
         case 99:
             $this->mainUploadForm('Type ' . $file_desc_msg . ' already exists');
             break;
         default:
             throw new MWException(__METHOD__ . ": Unknown value `{$value}`");
     }
 }
開發者ID:BenoitTalbot,項目名稱:bungeni-portal,代碼行數:101,代碼來源:MV_SpecialUpload.php

示例3: processUpload

 /**
  * Do the upload
  * Checks are made in SpecialUpload::execute()
  *
  * @access private
  */
 function processUpload()
 {
     global $wgUser, $wgOut, $wgFileExtensions;
     $details = null;
     $value = null;
     $value = $this->internalProcessUpload($details);
     switch ($value) {
         case self::SUCCESS:
             $wgOut->redirect($this->mLocalFile->getTitle()->getFullURL());
             break;
         case self::BEFORE_PROCESSING:
             break;
         case self::LARGE_FILE_SERVER:
             $this->mainUploadForm(wfMsgHtml('largefileserver'));
             break;
         case self::EMPTY_FILE:
             $this->mainUploadForm(wfMsgHtml('emptyfile'));
             break;
         case self::MIN_LENGHT_PARTNAME:
             $this->mainUploadForm(wfMsgHtml('minlength1'));
             break;
         case self::ILLEGAL_FILENAME:
             $filtered = $details['filtered'];
             $this->uploadError(wfMsgWikiHtml('illegalfilename', htmlspecialchars($filtered)));
             break;
         case self::PROTECTED_PAGE:
             $this->uploadError(wfMsgWikiHtml('protectedpage'));
             break;
         case self::OVERWRITE_EXISTING_FILE:
             $errorText = $details['overwrite'];
             $overwrite = new WikiError($wgOut->parse($errorText));
             $this->uploadError($overwrite->toString());
             break;
         case self::FILETYPE_MISSING:
             $this->uploadError(wfMsgExt('filetype-missing', array('parseinline')));
             break;
         case self::FILETYPE_BADTYPE:
             $finalExt = $details['finalExt'];
             $this->uploadError(wfMsgExt('filetype-banned-type', array('parseinline'), htmlspecialchars($finalExt), implode(wfMsgExt('comma-separator', array('escapenoentities')), $wgFileExtensions)));
             break;
         case self::VERIFICATION_ERROR:
             $veri = $details['veri'];
             $this->uploadError($veri->toString());
             break;
         case self::UPLOAD_VERIFICATION_ERROR:
             $error = $details['error'];
             $this->uploadError($error);
             break;
         case self::UPLOAD_WARNING:
             $warning = $details['warning'];
             $this->uploadWarning($warning);
             break;
         case self::INTERNAL_ERROR:
             $internal = $details['internal'];
             $this->showError($internal);
             break;
         default:
             throw new MWException(__METHOD__ . ": Unknown value `{$value}`");
     }
 }
開發者ID:BackupTheBerlios,項目名稱:shoutwiki-svn,代碼行數:66,代碼來源:SpecialUpload.php


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