Download the PHP package theovdml/doh without Composer

On this page you can find all versions of the php package theovdml/doh. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package doh

D'oh! — PHP Throwable Formatter

Packagist Version GitHub Tag Total Downloads License

D'oh! is a lightweight, flexible PHP library for formatting exceptions and errors (\Throwable)
into various human- and machine-readable formats: HTML, JSON, JSON:API, plain text, and XML.

It simplifies transforming PHP exceptions into structured, beautifully formatted outputs,
perfect for error pages, API error responses, logs, or CLI tools.

Doh was originally designed as part of the Potager framework to provide elegant throwable formatting. However, it is fully decoupled and works perfectly as a standalone package in any PHP project. It’s not as ambitious or feature-rich as libraries like Whoops, and it’s still a work in progress with limited testing. Use with caution and feel free to contribute!

A delightful PHP Throwable formatter that says:
D'oh!

“D’oh!” — Homer Simpson, and now your error pages.

Features

✅ Elegant HTML output with syntax-highlighted source snippets
✅ Structured formats: JSON, JSON:API, Plain Text, and XML
✅ Standalone & framework-agnostic — plug and play
✅ Composer-ready, PSR-4 autoloaded
✅ Ideal for APIs, CLIs, websites, and dev environments

Requirements

Installation

Install via Composer:

Usage

🧪 Example Output (HTML)

Here’s what your exception looks like with D'oh! → toHtml():

✅ Clean layout, clear stack trace, highlighted code snippets — all wrapped in a developer-friendly interface.

API Documentation

The core of D'oh! is the Doh class, which wraps a PHP \Throwable and provides flexible methods to format it into various output types. Below is a detailed overview of its API:

Doh::__construct(\Throwable $throwable)

Creates a new formatter instance from a throwable (exception or error).

Doh::buildTrace(): Trace

Generates a detailed Trace object representing the throwable's stack trace.

Doh::getThrowable(): \Throwable

Returns the original throwable instance wrapped by this formatter.

Doh::getClass(): string

Returns the fully qualified class name of the throwable.

Doh::getMessage(): string

Returns the throwable's error message.

Formatters

Each formatter returns a string in a specific format representing the throwable and its trace.

Doh::toHtml(): string

Doh::toJson(): string

Doh::toJsonApi(): string

Doh::toPlainText(): string

Doh::toXml(): string

Advanced Usage: Working with Trace and Frame

While D'oh! is designed for straightforward formatting of exceptions, its core components — Trace and Frame — provide powerful abstractions for working with stack traces at a granular level. These classes let you analyze, filter, and manipulate error stack traces for custom logging, debugging, or error reporting.

DohFormatting\Doh\Exception\Trace

The Trace class represents the full stack trace of an exception, including a special virtual frame that points exactly to where the throwable was thrown. It acts as a container of Frame instances, each representing one step in the call stack.

Key Features and Methods

Example: Filtering for App Frames

DohFormatting\Doh\Exception\Frame

Each Frame object represents one call in the stack trace with detailed information about the file, line, function, class, and call type.

Properties

Useful Methods

Creating a Frame

Frames are usually created internally from backtrace arrays using:

Example: Displaying Frame Information

License

MIT License © theo_vdml

Contributing

Feel free to submit issues or pull requests on GitHub. Please include tests and documentation for any new features.

Acknowledgments

D’oh! uses scrivo/highlight.php for source code syntax highlighting. Thanks to the open-source community for all the great tools.


All versions of doh with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
scrivo/highlight.php Version ^9.18
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package theovdml/doh contains the following files

Loading the files please wait ...