CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 6.0 API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 6.0
      • 6.0
      • 5.4
      • 5.3
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • AttributeResolver
    • Cache
    • Collection
    • Command
    • Console
    • Container
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Form
    • Http
    • I18n
    • Lock
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • TestSuite
    • Utility
    • Validation
    • View

Namespace Error

Namespaces

  • Cake\Error\Debug
  • Cake\Error\Middleware
  • Cake\Error\Renderer

Function Detail

dd() ¶

dd(mixed ...$vars): void

Prints out debug information about given variable and dies.

Only runs if debug mode is enabled. It will otherwise just continue code execution and ignore this function.

Parameters
mixed ...$vars

Variables to show debug information for.

Returns
void
Links
https://book.cakephp.org/5/en/development/debugging.html#basic-debugging

debug() ¶

debug(mixed $var, bool|null $showHtml = null, bool $showFrom = true): mixed

Prints out debug information about given variable and returns the variable that was passed.

Only runs if debug mode is enabled.

Parameters
mixed $var

Variable to show debug information for.

bool|null $showHtml optional

If set to true, the method prints the debug data in a browser-friendly way.

bool $showFrom optional

If set to true, the method prints from where the function was called.

Returns
mixed

The same $var that was passed

Links
https://book.cakephp.org/5/en/development/debugging.html#basic-debugging

https://book.cakephp.org/5/en/core-libraries/global-constants-and-functions.html#debug

stackTrace() ¶

stackTrace(array<string, mixed> $options = []): void

Outputs a stack trace based on the supplied options.

Options

  • depth - The number of stack frames to return. Defaults to 999
  • args - Should arguments for functions be shown? If true, the arguments for each method call will be displayed.
  • start - The stack frame to start generating a trace from. Defaults to 1
Parameters
array<string, mixed> $options optional

Format for outputting stack trace

Returns
void

Interfaces

  • ErrorLoggerInterface

    Interface for error logging handlers.

    Used by the ErrorHandlerMiddleware and global error handlers to log exceptions and errors.

  • ErrorRendererInterface

    Interface for PHP error rendering implementations

    The core provided implementations of this interface are used by Debugger and ErrorTrap to render PHP errors.

  • ExceptionRendererInterface

    Interface ExceptionRendererInterface

Classes

  • Debugger

    Provide custom logging and error handling.

    Debugger extends PHP's default error handling and gives simpler to use more powerful interfaces.

  • ErrorLogger

    Log errors and unhandled exceptions to Cake\Log\Log

  • ErrorTrap

    Entry point to CakePHP's error handling.

    Using the register() method you can attach an ErrorTrap to PHP's default error handler.

    When errors are trapped, errors are logged (if logging is enabled). Then the Error.beforeRender event is triggered. Finally, errors are 'rendered' using the defined renderer. If no error renderer is defined in configuration one of the default implementations will be chosen based on the PHP SAPI.

  • ExceptionTrap

    Entry point to CakePHP's exception handling.

    Using the register() method you can attach an ExceptionTrap to PHP's default exception handler and register a shutdown handler to handle fatal errors.

    When exceptions are trapped the Exception.beforeRender event is triggered. Then exceptions are logged (if enabled) and finally 'rendered' using the defined renderer.

    Stopping the Exception.beforeRender event has no effect, as we always need to render a response to an exception and custom renderers should be used if you want to replace or skip rendering an exception.

    If undefined, an ExceptionRenderer will be selected based on the current SAPI (CLI or Web).

  • FatalErrorException

    Represents a fatal error

  • PhpError

    Object wrapper around PHP errors that are emitted by trigger_error()

OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs