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


PHP HttpException::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Code and message positions are reverted.
  *
  * @param int    $code
  * @param string $message
  */
 public function __construct($code = null, $message = "")
 {
     if (empty($code) && empty($this->code)) {
         $code = self::NOT_FOUND;
     }
     parent::__construct($message, $code);
 }
开发者ID:jwdeitch,项目名称:components,代码行数:13,代码来源:ClientException.php

示例2: __construct

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

示例3: __construct

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

示例4: __construct

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

示例5: __construct

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

示例6: __construct

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

示例7: __construct

 public function __construct($message = '', $code = 0, \Exception $previous = null)
 {
     if (!$message) {
         $message = 'Forbidden';
     }
     parent::__construct($message, 403, $previous);
 }
开发者ID:rsky,项目名称:symfony,代码行数:7,代码来源:ForbiddenHttpException.php

示例8: __construct

 /**
  * Class constructor.
  *
  * @param string          $location    The redirect URL.
  * @param int             $statusCode  The HTTP status code, 3XX.
  * @param string          $message     An optional exception message for debugging.
  * @param \Throwable|null $previous    An optional previous exception for chaining.
  *
  * @throws \RuntimeException
  */
 public function __construct($location, $statusCode = 302, $message = '', \Throwable $previous = null)
 {
     if ($statusCode < 300 || $statusCode >= 400) {
         throw new \RuntimeException('Invalid HTTP redirect status code: ' . $statusCode);
     }
     parent::__construct($statusCode, ['Location' => $location]);
 }
开发者ID:brick,项目名称:http,代码行数:17,代码来源:HttpRedirectException.php

示例9: __construct

 public function __construct($message = null, $code = 404)
 {
     if (empty($message)) {
         $message = 'Not Found';
     }
     parent::__construct($message, $code);
 }
开发者ID:exonintrendo,项目名称:Primer,代码行数:7,代码来源:NotFoundException.php

示例10: __construct

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

示例11: __construct

 /**
  * Constructor
  *
  * @param string|null $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:JesseDarellMoore,项目名称:CS499,代码行数:13,代码来源:UnauthorizedException.php

示例12: __construct

 /**
  * @param string          $location
  * @param integer         $statusCode
  * @param string          $message
  * @param \Exception|null $previous
  */
 public function __construct($location, $statusCode = 302, $message = '', \Exception $previous = null)
 {
     if ($statusCode < 300 || $statusCode >= 400) {
         throw new \InvalidArgumentException('Invalid HTTP redirect status code: ' . $statusCode);
     }
     parent::__construct($statusCode, ['Location' => $location], $message, $previous);
 }
开发者ID:xxoxx,项目名称:php-waf,代码行数:13,代码来源:HttpRedirectException.php

示例13: __construct

 public function __construct($message = '')
 {
     if (!$message) {
         $message = 'Forbidden';
     }
     parent::__construct($message, 403);
 }
开发者ID:CodingFabian,项目名称:symfony,代码行数:7,代码来源:ForbiddenHttpException.php

示例14: __construct

 /**
  * Constructor
  *
  * @param string|null $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:nrother,项目名称:cakephp,代码行数:13,代码来源:MethodNotAllowedException.php

示例15: __construct

 public function __construct($message = '', $code = 0, \Exception $previous = null)
 {
     if (!$message) {
         $message = 'Not Found';
     }
     parent::__construct($message, 404, $previous);
 }
开发者ID:rsky,项目名称:symfony,代码行数:7,代码来源:NotFoundHttpException.php


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