HTML_INTERVAL
HTML_INTERVAL = 4000 : integer
エラーのインターバル
Exception Renderer.
Captures and handles all unhandled exceptions. Displays helpful framework errors when debug > 1. When debug < 1 a CakeException will render 404 or 500 errors. If an uncaught exception is thrown and it is a type that ExceptionHandler does not know about it will be treated as a 500 error.
You can implement application specific exception handling in one of a few ways:
Exception.rendererThis controller method is called instead of the default exception handling. It receives the thrown exception as its only argument. You should implement your error handling in that method.
Using a subclass of YAExceptionRenderer gives you full control over how Exceptions are rendered, you
can configure your class in your core.php, with Configure::write('Exception.renderer', 'MyClass');
You should place any custom exception renderers in app/Lib/Error.
_getController(\Exception $exception) : \Controller
Exceptionが発生した場合、ExceptionRenderer.phpでは、 CakeErrorController::startupProcessを呼んでいるため、PermissionComponentが2度処理されてしまう。 NC3ではCakeErrorController::startupProcessを呼ぶ必要がないので、 オーバライドして、startupProcessを呼ばないようにする。
例) 1.アクセス不可の画面にログインなしで呼ぶ。 2.PermissionComponentで設定画面のアクセスチェックが実行され、エラーとなり、ForbiddenExceptionをthrowする。 3.ExcepitonRendererがnewされ、ExceptionRendererの__construct()が呼ばれる。 4.下記で、CakeErrorControllerがnewされ、startupProcess()が実行される。 CakeErrorControllerがAppController(NetCommonsAppController)を継承していて、そこで設定されているPermissionComponentが再度呼ばれる。 https://github.com/cakephp/cakephp/blob/2.10.15/lib/Cake/Error/ExceptionRenderer.php#L157-L159 5.4は、try cacheされてるので、4のPermissionComponentのExceptionは、無視され、処理が継続され、error400()が実行される。
| \Exception | $exception | The exception to get a controller for. |