netlogix / nxerrorhandler
为TYPO3提供的静态页面错误处理程序
7.0.2
2024-06-26 07:22 UTC
Requires
- php: ^8.1
- typo3/cms-core: ^12.4
- typo3/cms-extbase: ^12.4
- typo3/cms-frontend: ^12.4
Requires (Dev)
- ext-sqlite3: *
- netlogix/coding-guidelines-php: ^1.0
- phpunit/phpcov: ^9.0
- ssch/typo3-rector: ^1.5
- typo3/testing-framework: ^8.0
Suggests
- netlogix/nxsentry: Send errors and exceptions to sentry
This package is auto-updated.
Last update: 2024-08-29 18:37:47 UTC
README
通过使用静态渲染的错误文档来输出,以减少对服务器的压力,从而提高TYPO3的错误处理能力。
此扩展仍在开发中。
用法
将此添加到您的 config/system/settings.php
return [ 'EXTENSIONS' => [ 'nxerrorhandler' => [ 'exceptionHandlerComponents' => [ \Netlogix\Nxerrorhandler\ErrorHandler\Component\ExtbaseArgumentsToBadRequestComponent::class, \Netlogix\Nxerrorhandler\ErrorHandler\Component\StaticDocumentComponent::class, ], ] ], 'SYS' => [ 'productionExceptionHandler' => \Netlogix\Nxerrorhandler\ErrorHandler\GeneralExceptionHandler::class ], ];
注意:这将注册ExceptionHandler以处理所有上下文,包括后端请求。如果您只想将其限制为前端请求,则请将此行添加到 config/system/additional.php
if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE) { $GLOBALS['TYPO3_CONF_VARS']['SYS']['productionExceptionHandler'] = \Netlogix\Nxerrorhandler\ErrorHandler\GeneralExceptionHandler::class; }
将此添加到您的 config/sites/sitename/config.yaml
errorHandling: - errorCode: '400' errorHandler: PHP errorPhpClassFQCN: Netlogix\Nxerrorhandler\Error\PageContentErrorHandler errorContentSource: 't3://page?uid=99' - errorCode: '404' errorHandler: PHP errorPhpClassFQCN: Netlogix\Nxerrorhandler\Error\PageContentErrorHandler errorContentSource: 't3://page?uid=99' - errorCode: '500' errorHandler: PHP errorPhpClassFQCN: Netlogix\Nxerrorhandler\Error\PageContentErrorHandler errorContentSource: 't3://page?uid=99'