Download the PHP package buggregator/trap without Composer

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

logo

Revolutionize Your Debugging Experience with PHP

Buggregator Trap

[![Twitter](https://img.shields.io/badge/-Follow-black?style=flat-square&logo=X)](https://twitter.com/buggregator) [![Discord](https://img.shields.io/static/v1?style=flat-square&label=Join&message=Discord&logo=Discord&color=%235865F2)](https://discord.gg/qF3HpXhMEP) [![Support](https://img.shields.io/static/v1?style=flat-square&label=Support&message=%E2%9D%A4&logo=GitHub&color=%23fe0086)](https://patreon.com/roxblnfk)


Trap is a package designed to enhance the debugging experience in conjunction with the Buggregator Server.
Trap includes:

Table of content:

Installation

To install Buggregator Trap in your PHP application, add the package as a dev dependency to your project using Composer:

PHP Latest Version on Packagist Total Downloads

And that's it. Trap is ready to go.

Phar

Sometimes your project may conflict with Trap's dependencies, or you might be interested in using only the local server (e.g., for analyzing local profiler files). In this case, consider installing Trap as a Phar (a self-contained PHP executable). Using wget:

Using Phive:

Overview

Buggregator Trap provides a toolkit for use in your code. Firstly, just having Buggregator Trap in your package enhances the capabilities of Symfony Var-Dumper.

If you've already worked with google/protobuf, you probably know how unpleasant it can be. Now let's compare the dumps of protobuf-message: on the left (with trap) and on the right (without trap).

trap-proto-diff

This simultaneously compact and informative output format of protobuf message will be just as compact and informative in the Buggregator Server interface. Now, working with protobuf is enjoyable.


Buggreagtor Trap includes a console application - a mini-server. The application is entirely written in PHP and does not require Docker to be installed in the system. It may seem like it's just the same as the symfony/var-dumper server, but it's not. Buggregator Trap boasts a much wider range of handlers ("traps") for debug messages:

You can effortlessly visualize and analyze console information about various elements of your codebase.

Here's a sneak peek into the console output you can expect with Trap:

symfony/var-dumper (proto) Binary Data
var-dumper Binary Data
SMTP Mail Trap HTTP Dump
smtp http-dump

Additionally, you can manually set traps in the code. Use the trap() function, which works almost the same as Symfony's dump(), but configures the dumper to send dumps to the local server, unless other user settings are provided.

Also, the trap() has a lot of useful options:


[!TIP] Feature in development: add the flag --ui to rise the web interface of the Buggregator Server without docker. trap-ui

We care about the quality of our products' codebase and strive to provide the best user experience. Buggregator Trap has passed the Proof of Concept stage and is now an important part of the Buggregator ecosystem. We have big plans for the development of the entire ecosystem and we would be delighted if you join us on this journey.

Usage

After successfully installing Buggregator Trap, you can initiate the debugging process by using the following command:

This command will start the Trap server, ready to receive any debug messages. Once a debug message is trapped, you will see a convenient report about it right here in the terminal.

Then just call the trap() function in your code:

Note: The trap() function configures $_SERVER['REMOTE_ADDR'] and $_SERVER['REMOTE_PORT'] automatically, if they are not set.

Also, there are a couple of shortcuts here:

If called without arguments, they will display a short stack trace, used memory, and time between shortcut calls.

Default port

Trap automatically recognizes the type of traffic. Therefore, there is no need to open separate ports for different protocols. By default, it operates on the same ports as the Buggregator Server: 9912, 9913, 1025, and 8000. However, if you wish to utilize a different port, you can easily make this adjustment using the -p option:

Environment variables can also be used to set endpoints:

Choosing Your Senders

Buggregator Trap provides a variety of "senders" that dictate where the dumps will be sent. Currently, the available sender options include:

By default, the Trap server is set to display dumps in the console. However, you can easily select your preferred senders using the -s option.

For instance, to simultaneously use the console, file, and server senders, you would input:

Contributing

We believe in the power of community-driven development. Here's how you can contribute:

Remember, every great developer was once a beginner. Contributing to open source projects is a step in your journey to becoming a better developer. So, don't hesitate to jump in and start contributing!

License

Buggregator Trap is open-sourced software licensed under the BSD-3 license.


All versions of trap with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-filter Version *
ext-sockets Version *
clue/stream-filter Version ^1.6
nunomaduro/termwind Version ^1.15 || ^2
nyholm/psr7 Version ^1.8
php-http/message Version ^1.15
psr/container Version ^1.1 || ^2.0
psr/http-message Version ^1.1 || ^2
symfony/console Version ^6.4 || ^7
symfony/var-dumper Version ^6.3 || ^7
yiisoft/injector Version ^1.2
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 buggregator/trap contains the following files

Loading the files please wait ....