Overview

Namespaces

  • SKJ
    • AppException
      • HTTP
      • Logic
      • Runtime

Exceptions

  • AbstractContainerException
  • AbstractDateTimeException
  • AbstractHttpException
  • AbstractValidationException
  • HttpException
  • LogicException
  • RuntimeException
  • Overview
  • Namespace
  • Class

Class AbstractHttpException

HTTP層実行例外の抽象クラス

HTTP層で必要となる、HTTPレスポンスを生成する基となる情報を保持する例外です

◆詳細◆

  • このクラスは抽象クラスです
Exception
Extended by SKJ\AppException implements SKJ\AppExceptionInterface uses SKJ\AppExceptionMethods
Extended by SKJ\AppException\RuntimeException
Extended by SKJ\AppException\AbstractHttpException

Direct known subclasses

SKJ\AppException\HttpException

Indirect known subclasses

SKJ\AppException\HTTP\BadGatewayException, SKJ\AppException\HTTP\BadRequestException, SKJ\AppException\HTTP\LengthRequiredException, SKJ\AppException\HTTP\LockedException, SKJ\AppException\HTTP\MethodNotAllowedException, SKJ\AppException\HTTP\NotAcceptableException, SKJ\AppException\HTTP\NotFoundException, SKJ\AppException\HTTP\NotImplementedException, SKJ\AppException\HTTP\PaymentRequiredException, SKJ\AppException\HTTP\PreconditionFailedException, SKJ\AppException\HTTP\ProxyAuthenticationRequiredException, SKJ\AppException\HTTP\RequestedRangeNotSatisfiableException, SKJ\AppException\HTTP\ConflictException, SKJ\AppException\HTTP\RequestEntityTooLargeException, SKJ\AppException\HTTP\RequestTimeoutException, SKJ\AppException\HTTP\RequestUriTooLongException, SKJ\AppException\HTTP\ServiceUnavailableException, SKJ\AppException\HTTP\UnauthorizedException, SKJ\AppException\HTTP\UnprocessableEntityException, SKJ\AppException\HTTP\UnsupportedMediaTypeException, SKJ\AppException\HTTP\ExpectationFailedException, SKJ\AppException\HTTP\FailedDependencyException, SKJ\AppException\HTTP\ForbiddenException, SKJ\AppException\HTTP\GatewayTimeoutException, SKJ\AppException\HTTP\GoneException, SKJ\AppException\HTTP\HttpVersionNotSupportedException, SKJ\AppException\HTTP\InternalServerErrorException
Abstract
Namespace: SKJ\AppException
Package: SKJ\AppException
Copyright: 2019 Seikouhou.
License: MIT
Author: y3high y3public@49364.net
Version: 0.8.0
Since: Class available since Release 0.8.0
Located at exceptions/AbstractHttpException.php
Methods summary
public string
# getHeader( string $name )

HTTPレスポンスヘッダを取得する

HTTPレスポンスヘッダを取得する

Parameters

$name
HTTPレスポンスヘッダ名称

Returns

string
HTTPレスポンスヘッダ値

Api

public array
# getHeaders( )

全てのHTTPレスポンスヘッダを取得する

全てのHTTPレスポンスヘッダを取得する

戻り値仕様 - HTTPレスポンスヘッダ配列

[
    (string)HTTPレスポンスヘッダ名 => (string)HTTPレスポンスヘッダ値,...
]

Returns

array
HTTPレスポンスヘッダ配列

Api

public SKJ\AppException\AbstractHttpException
# setHeader( string $name, string $value )

名前と値を受け取り、HTTPレスポンスヘッダを設定する

名前と値を受け取り、HTTPレスポンスヘッダを設定する

Parameters

$name
HTTPレスポンスヘッダ名称
$value
HTTPレスポンスヘッダ値

Returns

SKJ\AppException\AbstractHttpException
自分自身を返す

Api

public SKJ\AppException\AbstractHttpException
# setHeaders( array $headers, boolean $append = false )

連想配列を受け取り、HTTPレスポンスヘッダを設定する

連想配列を受け取り、HTTPレスポンスヘッダを設定する

Parameters

$headers
HTTPレスポンスヘッダを表す連想配列
$append
追記モード

Returns

SKJ\AppException\AbstractHttpException
自分自身を返す

Api

public string
# getCookie( string $name )

HTTPクッキーを取得する

HTTPクッキーを取得する

Parameters

$name
HTTPクッキー名称

Returns

string
HTTPクッキー値

Api

public array
# getCookies( )

全てのHTTPクッキーを取得する

全てのHTTPクッキーを取得する

戻り値仕様 - HTTPクッキー配列

[
    (string)HTTPクッキー名 => (string)HTTPクッキー値,...
]

Returns

array
HTTPクッキー配列

Api

public SKJ\AppException\AbstractHttpException
# setCookie( string $name, string $value )

名前と値を受け取り、HTTPクッキーを設定する

名前と値を受け取り、HTTPクッキーを設定する

Parameters

$name
HTTPクッキー名称
$value
HTTPクッキー値

Returns

SKJ\AppException\AbstractHttpException
自分自身を返す

Api

public SKJ\AppException\AbstractHttpException
# setCookies( array $cookies, boolean $append = false )

連想配列を受け取り、HTTPクッキーを設定する

連想配列を受け取り、HTTPクッキーを設定する

Parameters

$cookies
HTTPクッキーを表す連想配列
$append
追記モード

Returns

SKJ\AppException\AbstractHttpException
自分自身を返す

Api

public SKJ\AppException\AbstractHttpException
# setBodyFormat( integer $format )

HTTPレスポンスボディの形式を設定する

HTTPレスポンスボディの形式を設定する

RES_BODY_FORMAT_*以外の定数が渡されたら、何も処理しない

Parameters

$format
HTTPレスポンスボディの形式

Returns

SKJ\AppException\AbstractHttpException
自分自身を返す

Uses

self::RES_BODY_FORMAT_TEXT プレーンテキスト形式
self::RES_BODY_FORMAT_HTML HTML形式
self::RES_BODY_FORMAT_JSON JSONフォーマット形式

Api

public SKJ\AppException\AbstractHttpException
# setBody( string|array|object $body )

HTTPレスポンスボディを設定する

HTTPレスポンスボディを設定する

引数の型がスカラー型、配列型、オブジェクト型以外であれば、何も処理しない

Parameters

$body
HTTPレスポンスボディ

Returns

SKJ\AppException\AbstractHttpException
自分自身を返す

Api

public string
# getBody( boolean $decode = true )

HTTPレスポンスボディを取得する

HTTPレスポンスボディを取得する

Parameters

$decode
真の時はデコードをする、偽の時はしない

Returns

string
HTTPレスポンスボディ

Api

public string
# getJsonBody( integer $options = JSON_UNESCAPED_UNICODE, integer $depth = 512 )

HTTPレスポンスボディをJSONエンコードして取得する

HTTPレスポンスボディをJSONエンコードして取得する

Parameters

$options
json_encodeオプション
$depth
最大の深さ

Returns

string
JSONデコードされたHTTPレスポンスボディ、失敗時には'json encode failed!!'という文字列

Api

Methods inherited from SKJ\AppException
__construct(), getCallerVars(), getGlobalVars()
Methods inherited from Exception
__toString(), __wakeup(), getCode(), getFile(), getLine(), getMessage(), getPrevious(), getTrace(), getTraceAsString()
Methods inherited from SKJ\AppExceptionInterface
disableSkipContainer(), enableSkipContainer(), forge(), getBaseExceptionCode(), getCallQueue(), getClass(), getExceptionLog(), getFields(), getFuncArgsInCurrentContext(), getFunction(), getFunctionInCurrentContext(), getLineInCurrentContext(), getOriginalClassName(), getOriginalException(), getStatusCode(), isExtension(), renew(), resetFilter(), setCode(), setFields(), setFile(), setFilter(), setLine(), setMessage(), setSortOrder(), setStatusCode(), wasCreatedInCurrentContext()
Methods inherited from IteratorAggregate
getIterator()
Methods used from SKJ\AppExceptionMethods
disableSkipContainer(), enableSkipContainer(), forge(), getBaseExceptionCode(), getCallQueue(), getClass(), getExceptionLog(), getFields(), getFuncArgsInCurrentContext(), getFunction(), getFunctionInCurrentContext(), getLineInCurrentContext(), getOriginalClassName(), getOriginalException(), getStatusCode(), isExtension(), renew(), resetFilter(), setCode(), setFields(), setFile(), setFilter(), setLine(), setMessage(), setSortOrder(), setStatusCode(), wasCreatedInCurrentContext()
Constants summary
integer RES_BODY_FORMAT_TEXT

レスポンスボディの形式を表す定数

レスポンスボディの形式を表す定数

Api

# 1
integer RES_BODY_FORMAT_HTML

レスポンスボディの形式を表す定数

レスポンスボディの形式を表す定数

Api

# 2
integer RES_BODY_FORMAT_JSON

レスポンスボディの形式を表す定数

レスポンスボディの形式を表す定数

Api

# 3
Constants inherited from SKJ\AppException
OPT_CALLER_VARS_SNAPSHOT, OPT_GLOBAL_VARS_SNAPSHOT
Constants inherited from SKJ\AppExceptionInterface
SORT_ORDER_ASC, SORT_ORDER_DESC
Properties inherited from SKJ\AppException\RuntimeException
$defCode, $defMessage, $iteratorSortOrder, $messageTemplate, $statusCode
Properties inherited from SKJ\AppException
$enableCallerVarsSnapShot, $enableGlobalVarsSnapShot
Properties inherited from Exception
$code, $file, $line, $message
API documentation generated by ApiGen