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


PHP Exception::__construct方法代码示例

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


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

示例1: sprintf

 /**
  * Constructor.
  *
  * @param string $message
  * @param string $code
  * @param string $httpBody
  * @param integer $httpCode
  *
  * @return void
  */
 function __construct($message = null, $code = 0, $httpBody = null, $httpCode = 0)
 {
     $this->httpBody = $httpBody;
     $this->httpCode = $httpCode;
     $message = sprintf($this->message, $httpCode);
     parent::__construct($message, $code);
 }
开发者ID:monbro,项目名称:php-soundcloud,代码行数:17,代码来源:Exception.php

示例2: __construct

 /**
  * Builds a new TailException object.
  *
  * @param string $filename the name of the file
  * @param int $nblines the number of lines wanted
  * @param int $hint an estimation of the median number of characters per line
  * @param string $message the message of the exception
  * @param int $code the error code associated to this exception
  */
 public function __construct($filename, $nblines, $hint, $message, $code)
 {
     parent::__construct($message, $code);
     $this->_filename = $filename;
     $this->_nblines = $nblines;
     $this->_hint = $hint;
 }
开发者ID:anastaszor,项目名称:php-tail,代码行数:16,代码来源:TailException.php

示例3: switch

 function __construct($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection)
 {
     switch ($fn) {
         case 'EXECUTE':
             $this->sql = $p1;
             $this->params = $p2;
             $s = "{$dbms} error: [{$errno}: {$errmsg}] in {$fn}(\"{$p1}\")\n";
             break;
         case 'PCONNECT':
         case 'CONNECT':
             $user = $thisConnection->user;
             $s = "{$dbms} error: [{$errno}: {$errmsg}] in {$fn}({$p1}, '{$user}', '****', {$p2})\n";
             break;
         default:
             $s = "{$dbms} error: [{$errno}: {$errmsg}] in {$fn}({$p1}, {$p2})\n";
             break;
     }
     $this->dbms = $dbms;
     if ($thisConnection) {
         $this->host = $thisConnection->host;
         $this->database = $thisConnection->database;
     }
     $this->fn = $fn;
     $this->msg = $errmsg;
     if (!is_numeric($errno)) {
         $errno = -1;
     }
     parent::__construct($s, $errno);
 }
开发者ID:CristianOspinaOspina,项目名称:testlinkpruebas,代码行数:29,代码来源:adodb-exceptions.inc.php

示例4: __construct

 public function __construct($message, $file, $line)
 {
     $message .= " in {$file} on line {$line}";
     parent::__construct($message);
     $this->file = $file;
     $this->line = $line;
 }
开发者ID:cbsistem,项目名称:appflower_engine,代码行数:7,代码来源:afErrorHandler.class.php

示例5: __construct

 public function __construct($message = null, $code = null, Exception $previous = null)
 {
     $message = $message ?: 'Please make sure you either provide an Eloquent Model Class as the 3rd argument or use this inside an Eloquent Model';
     $code = $code ?: 403;
     // make sure everything is assigned properly
     parent::__construct($message, $code, $previous);
 }
开发者ID:vitorf7,项目名称:lv-loadmorepagination,代码行数:7,代码来源:ModelClassRequiredException.php

示例6: __construct

 /**
  * Constructor.
  *
  * @param string  $message Message default = ''.
  * @param integer $code    Code default = 404.
  * @param mixed   $debug   Debug default = null.
  */
 public function __construct($message = '', $code = 404, $debug = null)
 {
     if (empty($message)) {
         $message = __('The requested page could not be found or is not currently accessible.');
     }
     parent::__construct($message, $code, $debug);
 }
开发者ID:planetenkiller,项目名称:core,代码行数:14,代码来源:NotFoundException.php

示例7: __construct

 /**
  * Make a new API Exception with the given result.
  *
  * @param Array $result the result from the API server
  */
 public function __construct($result)
 {
     $this->result = $result;
     $code = isset($result['error_code']) ? $result['error_code'] : 0;
     $msg = isset($result['error']) ? $result['error']['message'] : $result['error_msg'];
     parent::__construct($msg, $code);
 }
开发者ID:scottmac,项目名称:php-sdk,代码行数:12,代码来源:facebook.php

示例8: assert

 /**
  * Create a new AnewtException.
  *
  * \param $fmt
  *   A error message, optionally with sprintf format specifiers
  * \param $args
  *   Zero or more values passed to vsprintf
  */
 function __construct($fmt, $args = null)
 {
     $args = func_get_args();
     $fmt = array_shift($args);
     assert('is_string($fmt);');
     parent::__construct(vsprintf($fmt, $args));
 }
开发者ID:jijkoun,项目名称:ssscrape,代码行数:15,代码来源:exception.lib.php

示例9: __construct

 /**
  * Constructor
  *
  * @param string $message If no message is given 'Method Not Allowed' will be the message
  * @param int $code Status code, defaults to 405
  */
 public function __construct($message = null, $code = 405)
 {
     if (empty($message)) {
         $message = 'Method Not Allowed';
     }
     parent::__construct($message, $code);
 }
开发者ID:coretyson,项目名称:coretyson,代码行数:13,代码来源:MethodNotAllowedException.php

示例10: __construct

 public function __construct(&$Variable, array $arrRequireTypes = array(), $sVarName = null)
 {
     $this->Variable =& $Variable;
     $this->sVarName = $sVarName;
     $this->arrRequireTypes =& $arrRequireTypes;
     parent::__construct("变量%s类型为:%s,不满足要求的类型: %s", array($this->sVarName ?: '', Type::reflectType($this->Variable), implode(",", $this->arrRequireTypes)));
 }
开发者ID:JeCat,项目名称:framework,代码行数:7,代码来源:TypeException.php

示例11: __construct

 /**
  * Constructor.
  *
  * @param  string  $message
  * @param  integer $code
  * @param  string  $file
  * @param  integer $line
  * @param  array   $trace
  */
 public function __construct($message, $code, $file, $line, $trace)
 {
     parent::__construct($message, $code);
     $this->file = $file;
     $this->line = $line;
     $this->trace = $trace;
 }
开发者ID:xiplias,项目名称:pails,代码行数:16,代码来源:Error.php

示例12: __construct

 /**
  * Constructor
  *
  * @param string $message If no message is given 'Unauthorized' will be the message
  * @param int $code Status code, defaults to 401
  */
 public function __construct($message = null, $code = 401)
 {
     if (empty($message)) {
         $message = 'Unauthorized';
     }
     parent::__construct($message, $code);
 }
开发者ID:coretyson,项目名称:coretyson,代码行数:13,代码来源:UnauthorizedException.php

示例13: __construct

 public function __construct($className, $message = null, \Exception $previous = null, $code = 0)
 {
     if (is_null($message)) {
         $message = sprintf("Class is not an interactor: %s", $className);
     }
     parent::__construct($message, $code, $previous);
 }
开发者ID:mattdanbrown,项目名称:php-interactor,代码行数:7,代码来源:NonInteractorException.php

示例14: __construct

 public function __construct($message, $code, $query = '')
 {
     parent::__construct($message, $code);
     $this->last_query = $query;
     $this->error = $message;
     $this->errno = $code;
 }
开发者ID:jaywilliams,项目名称:ezsql,代码行数:7,代码来源:ezSQL_Base.class.php

示例15: __construct

 public function __construct($msg, $domain = null, $params = [])
 {
     $this->msgId = $msg;
     $this->msgDomain = $domain;
     $this->msgParams = $params;
     parent::__construct($msg);
 }
开发者ID:minchal,项目名称:vero,代码行数:7,代码来源:TranslatableException.php


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