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


PHP MWException::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Constructor
  *
  * @param int $httpCode HTTP status code to send to the client
  * @param string|Message $content Content of the message
  * @param string|Message|null $header Content of the header (\<title\> and \<h1\>)
  */
 public function __construct($httpCode, $content, $header = null)
 {
     parent::__construct($content);
     $this->httpCode = (int) $httpCode;
     $this->header = $header;
     $this->content = $content;
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:14,代码来源:HttpError.php

示例2: __construct

 /**
  * @todo Pass around Messages when Status class doesn't suck
  * @param array $msg Message key with parameters
  */
 public function __construct(array $msg)
 {
     $this->msg = $msg;
     // Using ->plain() instead of ->text() due to bug T58226
     $wikitext = call_user_func_array('wfMessage', $msg)->plain();
     parent::__construct($wikitext);
 }
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:11,代码来源:TPException.php

示例3:

 /**
  * Construct a database error
  * @param $db DatabaseBase object which threw the error
  * @param $error String A simple error message to be used for debugging
  */
 function __construct(DatabaseBase &$db, $error)
 {
     global $wgDBcluster;
     $this->db = $db;
     parent::__construct($error);
     $isMaster = !is_null($db->getLBInfo('master'));
     // Wikia change - @author macbre - MAIN-2304
     \Wikia\Logger\WikiaLogger::instance()->error('DBError', ['name' => $db->getDBname(), 'cluster' => $wgDBcluster, 'server' => $db->getServer(), 'server_role' => $isMaster ? 'master' : 'slave', 'errno' => $db->lastErrno(), 'err' => $db->lastError(), 'exception' => $this]);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:14,代码来源:DatabaseError.php

示例4: __construct

 /**
  * Constructor
  *
  * @link  http://pl2.php.net/manual/en/exception.construct.php
  * @param string $message
  * @param int $code
  * @param Exception $exception
  */
 public function __construct($message = '', $code = 0, Exception $previous = null)
 {
     if (version_compare(PHP_VERSION, '5.3.0', '<')) {
         parent::__construct($message, $code);
         $this->_previous = $previous;
     } else {
         parent::__construct($message, $code, $previous);
     }
     // log more details (macbre)
     Wikia::logBacktrace(__METHOD__);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:19,代码来源:WikiaException.php

示例5: array

 function __construct($exceptionID, $engine, $module = null, $line = null, $params = array())
 {
     if ($module) {
         $codelocation = wfMsg('scripting-codelocation', $module, $line);
         $msg = wfMsgExt("scripting-exception-{$engine}-{$exceptionID}", array(), array_merge(array($codelocation), $params));
     } else {
         $msg = wfMsgExt("scripting-exception-{$engine}-{$exceptionID}", array(), $params);
     }
     parent::__construct($msg);
     $this->mExceptionID = $exceptionID;
     $this->mLine = $line;
     $this->mModule = $module;
     $this->mParams = $params;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:14,代码来源:Common.php

示例6: __construct

 /**
  * Note: these arguments are keys into wfMessage(), not text!
  *
  * @param string|Message $title Message key (string) for page title, or a Message object
  * @param string|Message $msg Message key (string) for error text, or a Message object
  * @param array $params Array with parameters to wfMessage()
  */
 public function __construct($title, $msg, $params = [])
 {
     $this->title = $title;
     $this->msg = $msg;
     $this->params = $params;
     // Bug 44111: Messages in the log files should be in English and not
     // customized by the local wiki. So get the default English version for
     // passing to the parent constructor. Our overridden report() below
     // makes sure that the page shown to the user is not forced to English.
     if ($msg instanceof Message) {
         $enMsg = clone $msg;
     } else {
         $enMsg = wfMessage($msg, $params);
     }
     $enMsg->inLanguage('en')->useDatabase(false);
     parent::__construct($enMsg->text());
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:24,代码来源:ErrorPageError.php

示例7:

 /**
  * Note: these arguments are keys into wfMsg(), not text!
  */
 function __construct($title, $msg)
 {
     $this->title = $title;
     $this->msg = $msg;
     parent::__construct(wfMsg($msg));
 }
开发者ID:negabaro,项目名称:alfresco,代码行数:9,代码来源:Exception.php

示例8:

 /**
  * Construct a database error
  * @param DatabaseBase $db Object which threw the error
  * @param string $error A simple error message to be used for debugging
  */
 function __construct(DatabaseBase $db = null, $error)
 {
     $this->db = $db;
     parent::__construct($error);
 }
开发者ID:D66Ha,项目名称:mediawiki,代码行数:10,代码来源:DatabaseError.php

示例9: __construct

 /**
  * @param string $message
  * @param string $codestr
  * @param int $code
  * @param array|null $extradata
  */
 public function __construct($message, $codestr, $code = 0, $extradata = null)
 {
     parent::__construct($message, $code);
     $this->mCodestr = $codestr;
     $this->mExtraData = $extradata;
     // This should never happen, so throw an exception about it that will
     // hopefully get logged with a backtrace (T138585)
     if (!is_string($codestr) || $codestr === '') {
         throw new InvalidArgumentException('Invalid $codestr, was ' . ($codestr === '' ? 'empty string' : gettype($codestr)));
     }
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:17,代码来源:ApiMain.php

示例10:

 /** @param string $modelId */
 function __construct($modelId)
 {
     parent::__construct("The content model '{$modelId}' is not registered on this wiki.\n" . 'See https://www.mediawiki.org/wiki/Content_handlers to find out which extensions ' . 'handle this content model.');
     $this->modelId = $modelId;
 }
开发者ID:Acidburn0zzz,项目名称:mediawiki,代码行数:6,代码来源:ContentHandler.php

示例11: array

 /**
  * @param string $messageName
  * @param array $params
  */
 function __construct($messageName, $params = array())
 {
     if (isset($params['args'])) {
         $this->messageArgs = $params['args'];
     } else {
         $this->messageArgs = array();
     }
     if (isset($params['module']) && isset($params['line'])) {
         $codeLocation = false;
         if (isset($params['title'])) {
             $moduleTitle = Title::newFromText($params['module']);
             if ($moduleTitle && $moduleTitle->equals($params['title'])) {
                 $codeLocation = wfMessage('scribunto-line', $params['line'])->inContentLanguage()->text();
             }
         }
         if ($codeLocation === false) {
             $codeLocation = wfMessage('scribunto-module-line', $params['module'], $params['line'])->inContentLanguage()->text();
         }
     } else {
         $codeLocation = '[UNKNOWN]';
     }
     array_unshift($this->messageArgs, $codeLocation);
     $msg = wfMessage($messageName)->params($this->messageArgs)->inContentLanguage()->text();
     parent::__construct($msg);
     $this->messageName = $messageName;
     $this->params = $params;
 }
开发者ID:sammykumar,项目名称:TheVRForums,代码行数:31,代码来源:Common.php

示例12:

 /**
  * Construct a database error
  * @param Database $db The database object which threw the error
  * @param string $error A simple error message to be used for debugging
  */
 function __construct(Database &$db, $error)
 {
     $this->db =& $db;
     parent::__construct($error);
 }
开发者ID:puring0815,项目名称:OpenKore,代码行数:10,代码来源:Database.php

示例13:

 /**
  * Note: these arguments are keys into wfMsg(), not text!
  */
 function __construct($title, $msg, $params = null)
 {
     $this->title = $title;
     $this->msg = $msg;
     $this->params = $params;
     if ($msg instanceof Message) {
         parent::__construct($msg);
     } else {
         parent::__construct(wfMsg($msg));
     }
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:14,代码来源:Exception.php

示例14: __construct

 /**
  * @param string $message
  * @param string $codestr
  * @param int $code
  * @param array|null $extradata
  */
 public function __construct($message, $codestr, $code = 0, $extradata = null)
 {
     parent::__construct($message, $code);
     $this->mCodestr = $codestr;
     $this->mExtraData = $extradata;
 }
开发者ID:soumyag213,项目名称:mediawiki,代码行数:12,代码来源:ApiMain.php

示例15:

 /**
  * Construct a database error
  * @param Database $db The database object which threw the error
  * @param string $error A simple error message to be used for debugging
  */
 function __construct($faultcode, $error = '')
 {
     $this->mFaultCode = $faultcode;
     $this->mFaultText = !empty($error) ? $error : $this->getApiFaultName();
     parent::__construct($this->mFaultText);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:11,代码来源:WikiaApiQuery.php


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