Xr - Lightweight debug server utility built on ReactPHP.

Overview

XR

🔔 Subscribe to the newsletter to don't miss any update regarding Chevere.

XR XR dark XR dark

Code size AGPL-3.0-only

Quality Gate Status Maintainability Rating Reliability Rating Security Rating Coverage Technical Debt CodeFactor Codacy Badge Maintainability

XR is a dump server utility built on top of ReactPHP.

Features

  • Dump single or multiple arguments
  • 😊 One-click server run on top of PHP (no extras required)
  • 👻 Filter messages by Topics and/or Emotes
  • 📟 Dump backtrace (if you need it)
  • Pause your code execution (*not implemented yet)
  • 🌚 Dark / 🌝 Light mode follows your system preferences
  • 👽 Ephemeral as it doesn't require to store any persistent data
  • 🤓 Multi-client as it broadcast dump messages to all connected clients
  • 🍒 It's HTML based, save your session for offline usage

Status

This project is under preview status.

Getting started

🚧 Min stability dev

  • Add chevere/xr as a dev dependency in your project:
composer require --dev chevere/xr

Start the server

  • With PHP:
php vendor/chevere/xr/server.php 27420
  • With Docker:
docker run -d -p 27420:27420 \
    --name chevere-xr \
    ghcr.io/chevere/xr:main

The server will be available at http://localhost:27420

Demo

Open the debugger and then run:

  • With PHP:
php demo/showtime.php
  • With Docker:
docker exec -it \
    chevere-xr \
    php demo/showtime.php

XR Helpers

Dump variables

Use xr($var1, $var2,...) to dump any variable from your code.

xr($var, 'Hola, mundo!');

Topic

Add a topic passing t:.

xr($var, 'Hola, mundo!', t: 'Epic win');

Emote

Add an emote passing e:.

xr($var, 'Hola, mundo!', t: 'Epic win', e: '😎');

Flags

Pass bitwise flags to trigger special behavior.

  • f: XR_BACKTRACE to dump debug backtrace.
xr($var, 'Hola, mundo!', t: 'Epic win', e: '😎', f: XR_BACKTRACE);
  • f: XR_PAUSE to pause code execution (*not implemented).
xr($var, 'Hola, mundo!', t: 'Epic win', e: '😎', f: XR_PAUSE);

Message reference

POST http://localhost:27420/message
    body=Hola, mundo
    file_path=/var/www/file.php
    file_line=123
    ...
  • body - The message raw body (HTML).
  • file_path - The file path.
  • file_line - The file line.
  • emote - emote (emojis/symbols)
  • topic - Topic as message context.

Docker

Start/Stop

docker container start chevere-xr
docker container stop chevere-xr

Remove

docker container rm chevere-xr -f

Build

docker build -t ghcr.io/chevere/xr:tag . \
    -f xr.Dockerfile
You might also like...
An utility component for XML usage and best practices in PHP

An utility component for XML usage and best practices in PHP

Glob-like file and pattern matching utility.

Glob-like file and pattern matching utility.

The Pantheon CLI — a standalone utility for performing operations on the Pantheon Platform

terminus : Pantheon's Command-Line Interface Status About Terminus is Pantheon's Command Line Interface (CLI), providing at least equivalent functiona

Pagekit is a modular and lightweight CMS built with Symfony components and Vue.js.
Pagekit is a modular and lightweight CMS built with Symfony components and Vue.js.

Pagekit Pagekit is a modular and lightweight CMS built with Symfony components and Vue.js. Homepage - Learn more about Pagekit Documentation - User an

A powerful debug and profilers tool for the Phalcon Framework
A powerful debug and profilers tool for the Phalcon Framework

Phalcon Debugbar Integrates PHP Debug Bar with Phalcon Framework. 中文说明 Features Normal request capturing Ajax request capturing Redirect request chain

Debug with Ray to fix problems faster
Debug with Ray to fix problems faster

Debug with Ray to fix problems faster This package can be installed in any PHP application to send messages to the Ray app. The desktop app: can be us

Hook-logger-plugin - Debug WordPress action / filter hooks.

hook-logger-plugin Easily debug WordPress action / filter hooks, finding where actions are called from and understanding the flow of execution. This p

Magento 2 Debug Helper Module for easy debugging with Xdebug and PHPStorm or any other IDE

Magento 2 Debug Helper Information and Usage Magento 2 Debug Helper Module usage with PHPStorm and Xdebug Installation To install the Magento 2 Debug

Frog - A new way to debug in PHP

Frog - A new way to debug in PHP There are situations where you want to show information of variables in PHP. While print_r, var_dump and var_export a

Comments
  • Add throwable handler

    Add throwable handler

    Add a set_exception_handler callable to handle and send Throwable messages to the server.

    registerXrThrowableHandler(bool $previous = true);
    
    xrThrowableHandler(Throwable $e): void;
    
    opened by rodber 1
  • Provide monsopace font

    Provide monsopace font

    Default monospace font works fine, but it doesn't support ligatures and each system ships a different version.

    😘 By including Fira Code font the output will be the same for all users.

    opened by rodber 1
  • XR inspector: xri

    XR inspector: xri

    Provide an extendable inspector allowing to provide system-aware information.

    xri()->memory();
    xri()->myRelevantData();
    

    💡Users can create their own specialized methods for retrieving relevant information without the hassle of doing it all manual.

    opened by rodber 0
  • CMS integration

    CMS integration

    Provide a guide for CMS providers so they can include XR on their products. If there's a PHP CMS provider reading this let me know to start modeling this based on your needs.

    I am myself a CMS provider, but I would like external opinions if possible here.

    The idea is that users of your CMS software can rely on XR to easily debug. I'm building it with that purpose, so it fits perfect on CMS land.

    help wanted 
    opened by rodber 0
Releases(0.7.0)
  • 0.7.0(Dec 14, 2022)

  • 0.6.1(Nov 27, 2022)

  • 0.6.0(Nov 13, 2022)

  • 0.5.0(Nov 2, 2022)

    • Added end-to-end encryption
    • Checks PHPStan Level 9
    • Fixed unhandled errors triggered by open base dir restrictions

    Full Changelog: https://github.com/chevere/xr/compare/0.4.0...0.5.0

    Flagg

    This release is codenamed "Flagg" in honor to the delicious flaggs.

    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Aug 8, 2022)

  • 0.3.0(Jun 19, 2022)

  • 0.2.5(May 6, 2022)

  • 0.2.4(Apr 27, 2022)

    • Fixed cursor display
    • Fixed export to PNG
    • Updated dependencies
    • Rename to "XR Debug"

    Full Changelog: https://github.com/chevere/xr/compare/0.2.3...0.2.4

    Source code(tar.gz)
    Source code(zip)
  • 0.2.3(Feb 28, 2022)

  • 0.2.2(Feb 22, 2022)

  • 0.2.1(Feb 17, 2022)

  • 0.2.0(Feb 16, 2022)

    • Added portable mode (single save HTML)
    • Added XR inspector
    • Added pause code execution
    • Added auto remove status messages

    Full Changelog: https://github.com/chevere/xr/compare/0.1.3...0.2.0

    Egocéntrico

    This release is codenamed "Egocéntrico" in honor to the delicious egocéntricos.

    Source code(tar.gz)
    Source code(zip)
  • 0.1.3(Feb 8, 2022)

    • Added message options (copy, remove, export) #43 f4c535a1d2e971e22fc5971933aa803e66a57525
    • Improved Docker 02f790c565846c2353eaea0202e9009a7560a530
    • Improved styling bd37cc6e6758570f108d3a744a4dfff8f3f91819
    • Fixed bug with meta keys #42
    • Fixed bug with Safari 507d0cd011112a9cad9587250a93284148cf42c2
    • Updated dependencies (chevere)

    Full Changelog: https://github.com/chevere/xr/compare/0.1.2...0.1.3

    Crocanty

    This release is codenamed "Crocanty" in honor to the delicious crocantys.

    Source code(tar.gz)
    Source code(zip)
  • 0.1.2(Jan 27, 2022)

    • Added window controls (resume, pause, stop and clear)
    • Added throwable handler
    • Added xrr helper
    • Added welcome screen
    • Added keyboard shortcuts
    • Changed license from AGPLv3 to Apache-2.0
    • Improved backtrace display

    Full Changelog: https://github.com/chevere/xr/compare/0.1.1...0.1.2

    Chocolito

    This release is codenamed "Chocolito" in honor to the delicious chocolitos.

    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Jan 13, 2022)

    • Added new icon (thank you! @barbra-bio)
    • Improved styling

    Full Changelog: https://github.com/chevere/xr/compare/0.1.0...0.1.1

    Centella

    This release is codenamed "Centella" in honor to the delicious Centellas.

    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Jan 10, 2022)

Owner
Chevere
Software for creating extensible server-side applications.
Chevere
Debug - The Debug component provides tools to ease debugging PHP code.

Debug Component CAUTION: this component is deprecated since Symfony 4.4. Instead, use the ErrorHandler component. The Debug component provides tools t

Symfony 7.3k Jan 8, 2023
This library brought ReactPHP and QueryList together

ReactPHP QueryList This library brought ReactPHP and QueryList together. Installation composer require ahmard/reactphp-querylist Usage Playing with Q

Ahmad Mustapha 5 Nov 19, 2021
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP

Lodash-PHP Lodash-PHP is a port of the Lodash JS library to PHP. It is a set of easy to use utility functions for everyday PHP projects. Lodash-PHP tr

Lodash PHP 474 Dec 31, 2022
Utility that helps you switch git configurations with ease.

git-profile Utility that helps you switch git configurations with ease Preface It is possible that you have multiple git configurations. For example:

Zeeshan Ahmad 240 Jul 18, 2022
[READ-ONLY] CakePHP Utility classes such as Inflector, Text, Hash, Security and Xml. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Utility Classes This library provides a range of utility classes that are used throughout the CakePHP framework What's in the toolbox? Hash A

CakePHP 112 Feb 15, 2022
Small utility library that handles metadata minification and expansion.

composer/metadata-minifier Small utility library that handles metadata minification and expansion.

Composer 134 Dec 26, 2022
A utility package that helps inspect functions in PHP.

A utility package that helps inspect functions in PHP. This package provides some utilities for inspecting functions (callables) in PHP. You can use i

Ryan Chandler 14 May 24, 2022
m4b-tool is a command line utility to merge, split and chapterize audiobook files such as mp3, ogg, flac, m4a or m4b

m4b-tool m4b-tool is a is a wrapper for ffmpeg and mp4v2 to merge, split or and manipulate audiobook files with chapters. Although m4b-tool is designe

Andreas 798 Jan 8, 2023
Php-timer - Utility class for timing

phpunit/php-timer Utility class for timing things, factored out of PHPUnit into a stand-alone component. Installation You can add this library as a lo

Sebastian Bergmann 7.4k Jan 5, 2023
Warden is a CLI utility for orchestrating Docker based developer environments

Warden Warden is a CLI utility for orchestrating Docker based developer environments, and enables multiple local environments to run simultaneously wi

David Alger 314 Dec 2, 2022