Class Exceptions

Summary

Fully Qualified Name: CodeIgniter\Debug\Exceptions

Description

Exceptions manager

Methods

Name Description Defined By
__construct() Constructor. Exceptions
cleanPath() Clean Path Exceptions
describeMemory() Describes memory usage in real-world units. Intended for use with memory_get_usage, etc. Exceptions
errorHandler() Even in PHP7, some errors make it through to the errorHandler, so convert these to Exceptions and let the exception handler log it and display it. Exceptions
exceptionHandler() Catches any uncaught errors and exceptions, including most Fatal errors (Yay PHP7!). Will log the error, display it if display_errors is on, and fire an event that allows custom actions to be taken at this point. Exceptions
highlightFile() Creates a syntax-highlighted version of a PHP file. Exceptions
initialize() Responsible for registering the error, exception and shutdown handling of our application. Exceptions
shutdownHandler() Checks to see if any errors have happened during shutdown that need to be caught and handle them. Exceptions

Method Details

__construct()

Constructor.

Parameter Name Type Description
$config \Config\Exceptions
$request \CodeIgniter\HTTP\IncomingRequest
$response \CodeIgniter\HTTP\Response

Returns:

cleanPath()

Clean Path

This makes nicer looking paths for the error output.

Parameter Name Type Description
$file string

Returns: string

describeMemory()

Describes memory usage in real-world units. Intended for use with memory_get_usage, etc.

Parameter Name Type Description
$bytes
$bytes

Returns: string

errorHandler()

Even in PHP7, some errors make it through to the errorHandler, so convert these to Exceptions and let the exception handler log it and display it.

This seems to be primarily when a user triggers it with trigger_error().

Parameter Name Type Description
$severity int
$message string
$file string|null
$line int|null

Returns:

exceptionHandler()

Catches any uncaught errors and exceptions, including most Fatal errors (Yay PHP7!). Will log the error, display it if display_errors is on, and fire an event that allows custom actions to be taken at this point.

Parameter Name Type Description
$exception \Throwable

Returns:

highlightFile()

Creates a syntax-highlighted version of a PHP file.

Parameter Name Type Description
$file string
$lineNumber int
$lines int

Returns: bool|string

initialize()

Responsible for registering the error, exception and shutdown handling of our application.

Returns:

shutdownHandler()

Checks to see if any errors have happened during shutdown that need to be caught and handle them.

Returns:

Top