當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。