https://github.com/andreimosman/debugitto
Simple but effective remote debug tool.
https://github.com/andreimosman/debugitto
Last synced: 24 days ago
JSON representation
Simple but effective remote debug tool.
- Host: GitHub
- URL: https://github.com/andreimosman/debugitto
- Owner: andreimosman
- Created: 2022-06-24T13:58:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-30T17:12:02.000Z (almost 3 years ago)
- Last Synced: 2025-12-14T12:10:27.638Z (6 months ago)
- Language: PHP
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# debugitto
This is a very simple way to debug PHP applications without generating output directly to the browser.
## Installation
### Via composer:
```
composer require andreimosman/debugitto
```
### Download
You can download at `https://github.com/andreimosman/debugitto` and just include `src/Debug.php`
## Usage
### On your environment
Once you included or required the main file via `vendor/autoload.php` or direct on your application, you can use it by:
```
// ...
use AndreiMosman\Debugitto\Debugitto;
Debugitto::enable('localhost', 9900);
Debugitto::d('This is my beautiful output');
// ...
```
Of course, you should listen on `localhost` port `9900` to make it work.
You can do it on your machine using netcat:
```
nc -kl 9900
```
### Inside a docker container
By default, the host is set to `host.docker.internal` (which refers, from the perspective of the container, to your docker server, outside the container) and the port to `9900`.
So, once you included manually or via composer autoload, you can add to your code:
```
use AndreiMosman\Debugitto\Debugitto;
Debugitto::enable();
Debugitto::d('Message sent from the container');
```
## print_r by default
The code below:
```
1, 'b' => 2, 'c' => 3];
D::d('My super dupper variable');
D::d($myVariable);
```
Will output:
```
My super duper variable
Array
(
[a] => 1
[b] => 2
[c] => 3
)
```