Download the PHP package raffaelecarelle/php-error-insight without Composer

On this page you can find all versions of the php package raffaelecarelle/php-error-insight. 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 php-error-insight

PHP Error Insight

A tool that intercepts PHP errors, warnings, and exceptions and provides practical help and advice generated by AI (local models or external APIs). No static text: details and suggestions are created on-the-fly by artificial intelligence based on the error message and context.

Screenshots:

Requirements

Installation

Configuration

You can configure the tool via environment variables or through code.

Supported environment variables:

Configuration examples:

1) Local backend (Ollama):

2) API backend (OpenAI compatible):

3) API backend (Anthropic Claude):

4) API backend (Google Gemini):

Editor integration and stack trace copying

When viewing the HTML error page, each stack frame now shows:

Configuration options:

Example (VS Code):

Example (PhpStorm):

Docker/containers mapping (open files in host IDE):

When running the app inside a container, set PHP_ERROR_INSIGHT_ROOT to the container project root and PHP_ERROR_INSIGHT_HOST_ROOT to the corresponding host path. Editor links will be generated with the host path so your IDE can open files.

Example (Docker + VS Code):

Example (Docker + PhpStorm):

Code-based configuration example:

Notes:

Usage (Vanilla PHP)

In your application's bootstrap, register the handler. A minimal example is available in examples/vanilla/index.php.

Quick example:

Output:

Usage with PHPUnit

To use PHP Error Insight with PHPUnit, you can register the error handler in your PHPUnit bootstrap file. This will catch errors that occur during your test runs and provide detailed, AI-powered explanations.

First, ensure your phpunit.xml or phpunit.xml.dist is configured to use a bootstrap file:

Then, in your tests/bootstrap.php file, register the error handler:

Now, when you run PHPUnit, any errors will be processed by PHP Error Insight, and you'll see the enhanced error output directly in your console.

How it works

Note: the tool no longer uses static translated texts for details/suggestions. If the AI backend is not configured or doesn't respond, those sections might remain empty.

Privacy and Data Sanitization

Automatic Sanitization of Sensitive Parameters

PHP Error Insight automatically sanitizes sensitive data to prevent leakage in AI prompts. The sanitization system supports two main features:

1. Sensitive Parameter Detection

Function and method parameters marked with the #[SensitiveParameter] attribute are automatically redacted in stack traces:

How it works:

Example output:

2. Text Pattern Sanitization

In addition to parameter-level sanitization, the system also masks common sensitive patterns in error messages and file paths before sending to AI:

3. Configuration

The default mask string is ***REDACTED***, but you can customize it programmatically if needed:

Where sanitization applies:

Best practices:

  1. Mark all sensitive parameters with #[SensitiveParameter]: passwords, tokens, API keys, personal data
  2. The sanitization is automatic and requires no configuration

For more implementation details, see src/Internal/Util/SensitiveParameterSanitizer.php.

Console colors customization (CLI)

You can customize the colors used in the CLI output (syntax highlighting, severity header background, title, AI suggestions, stack trace and locations).

Two ways to configure:

Structure of the JSON/object:

Notes:

Examples

Development

This project uses several development tools to maintain code quality. Use the following composer scripts for easy access to these tools:

Code Quality Scripts

Combined Scripts

Development Workflow

  1. Install dependencies: composer install
  2. Make your changes
  3. Run quality checks: composer quality
  4. Fix issues automatically: composer fix-all
  5. Run tests with coverage: composer test-coverage

The project is configured for PHP 8.1+ and includes:

License

GPL-3.0-or-later

This project is licensed under the GNU General Public License v3.0 or later. See the LICENSE file for details.


All versions of php-error-insight with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
symfony/var-dumper Version ^5.0|^6.0|^7.0|^8.0
ext-curl Version *
symfony/console Version ^5.0|^6.0|^7.0|^8.0
symfony/filesystem Version ^5.0|^6.0|^7.0|^8.0
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 raffaelecarelle/php-error-insight contains the following files

Loading the files please wait ...