Skip to content

Commit

Permalink
use xrDebug
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Jul 30, 2023
1 parent 603257f commit fb1b164
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 36 deletions.
49 changes: 25 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# XrDebug
# xrDebug

> 🔔 Subscribe to the [newsletter](https://chv.to/chevere-newsletter) to don't miss any update regarding Chevere.
<p align="center"><img alt="XR" src="xr.svg" width="40%"></p>
<p align="center"><img alt="xrDebug" src="xr.svg" width="40%"></p>

https://user-images.githubusercontent.com/20590102/153045551-619c74cc-c4ae-41da-b7b6-bd8733e623a2.mp4

Expand All @@ -22,7 +22,7 @@ https://user-images.githubusercontent.com/20590102/153045551-619c74cc-c4ae-41da-
[![CodeFactor](https://www.codefactor.io/repository/github/chevere/xr/badge)](https://www.codefactor.io/repository/github/chevere/xr)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/89c64d17be684818b21d44c658c735d0)](https://www.codacy.com/gh/chevere/xr/dashboard)

[XrDebug](https://xr-docs.chevere.org/) is a dump debug utility for PHP. No extras required, **debug** your PHP code **anywhere**. It uses a ReactPHP SSE server to provide a web-based debug application.
[xrDebug](https://xr-docs.chevere.org/) is a dump debug utility for PHP. No extras required, **debug** your PHP code **anywhere**. It uses a ReactPHP SSE server to provide a web-based debug application.

## Quick start

Expand All @@ -32,15 +32,15 @@ https://user-images.githubusercontent.com/20590102/153045551-619c74cc-c4ae-41da-
composer require --dev chevere/xr
```

* Run the XrDebug [server](https://xr-docs.chevere.org/server/)
* Run the xrDebug [server](https://xr-docs.chevere.org/server/)

```sh
docker run -t --init --rm -p 27420:27420 ghcr.io/chevere/xr-server
```

<p align="center">
<img alt="XR light" src=".screen/xr-0.1.3-light-welcome.png">
<img alt="XR light" src=".screen/xr-0.1.3-dark-welcome.png">
<img alt="xrDebug light" src=".screen/xr-0.1.3-light-welcome.png">
<img alt="xrDebug dark" src=".screen/xr-0.1.3-dark-welcome.png">
</p>

## Documentation
Expand All @@ -49,31 +49,32 @@ docker run -t --init --rm -p 27420:27420 ghcr.io/chevere/xr-server

## Features

* 🔏 Signed requests (Ed25519)
* 💎 End-to-end encryption (AES-GCM AE)
* ✨ Dump n arguments with [VarDump](https://chevere.org/packages/var-dump.html) driven variable highlight
* 🐘 One-click PHP server run (no extras required)
* 👻 Filter messages by [Topics](https://xr-docs.chevere.org/helpers/xr.html#topic) and [Emotes](https://xr-docs.chevere.org/helpers/xr.html#emote)
* ✍️ Re-name "XrDebug" to anything you want
* 🏁 Resume, Pause, Stop and Clear debug window controls
* 🥷 Keyboard shortcuts (Resume **R**, Pause **P**, Stop **S** and Clear **C**)
* 😊 Export dump output to clipboard or as PNG image
* 📟 Generates dump [backtrace](https://xr-docs.chevere.org/helpers/xr.html#flags)
*[Pause](https://xr-docs.chevere.org/helpers/xri.html#pause) and resume your code execution
* 🌚 Dark / 🌝 Light mode follows your system preferences
* 👽 Ephemeral, it doesn't store any persistent data
* 🍒 Portable & HTML based (save page, search, etc.)
* 🔥 Uses [FiraCode](https://github.com/tonsky/FiraCode) font for displaying _beautiful looking dumps_
* 😅 Handle exceptions (hook or replace your existing handler)
* Signed requests (Ed25519)
* End-to-end encryption (AES-GCM AE)
* Dump arguments using [VarDump](https://chevere.org/packages/var-dump.html)
* One-click disposable debug PHP server (no extras required)
* Filter messages by [Topics](https://xr-docs.chevere.org/helpers/xr.html#topic) and [Emotes](https://xr-docs.chevere.org/helpers/xr.html#emote)
* Resume, Pause, Stop and Clear debug window controls
* Keyboard shortcuts (Resume **R**, Pause **P**, Stop **S** and Clear **C**)
* Re-name "xrDebug" session to anything you want
* Export dump output to clipboard or as PNG image
* Generates dump [backtrace](https://xr-docs.chevere.org/helpers/xr.html#flags)
* [Pause](https://xr-docs.chevere.org/helpers/xri.html#pause) and resume your code execution
* Dark / 🌝 Light mode follows your system preferences
* Ephemeral, it doesn't store any persistent data
* Portable & HTML based (save page, search, etc.)
* Uses [FiraCode](https://github.com/tonsky/FiraCode) font for displaying _beautiful looking dumps_
* Handle exceptions (hook or replace your existing handler)
* Open with editor links

<p align="center">
<img alt="XR dark demo" src=".screen/xr-0.1.3-dark-demo.png">
<img alt="xrDebug dark demo" src=".screen/xr-0.1.3-dark-demo.png">
</p>

## License

Copyright 2023 [Rodolfo Berrios A.](https://rodolfoberrios.com/)

XR is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text.
xrDebug is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8 changes: 4 additions & 4 deletions demo/demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
break;
}
}
xrr('👋 Welcome to XrDebug!');
xrr('👋 Welcome to xrDebug!');
xri()->pause();
xr(
🤓: 'XrDebug is a lightweight remote debugger.',
🤓: 'xrDebug is a lightweight remote debugger.',
t: 'hello-world',
e: '🐘'
);
sleep(5);
xr(
👆: 'Edit session title by clicking on "XrDebug" up there.',
👆: 'Edit session title by clicking on "xrDebug" up there.',
t: 'how-to',
e: '😜'
);
Expand Down Expand Up @@ -65,6 +65,6 @@
);
sleep(5);
xrr(
'🎉 Enjoy <b>XrDebug</b>',
'🎉 Enjoy <b>xrDebug</b>',
e: '😊'
);
2 changes: 1 addition & 1 deletion src/XrInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static function get(): XrInterface
{
if (! isset(self::$instance)) {
throw new LogicException(
message('No XrDebug instance present')
message('No xrDebug instance present')
);
}

Expand Down
14 changes: 7 additions & 7 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function getXrFailover(): ?XrInterface
$line = strval($caller['line'] ?? 0);
error_log(
strtr(
'Unable to use XrDebug at %s: %e',
'Unable to use xrDebug at %s: %e',
[
'%s' => "{$file}:{$line}",
'%e' => $e->getMessage(),
Expand All @@ -75,7 +75,7 @@ function getXrFailover(): ?XrInterface
}

/**
* Register XrDebug throwable handler.
* Register xrDebug throwable handler.
*
* @param bool $callPrevious True to call the previous handler.
* False to disable the previous handler.
Expand All @@ -99,10 +99,10 @@ function (Throwable $throwable) use ($xrHandler, $previous) {
}

/**
* Handle a Throwable using XrDebug.
* Handle a Throwable using xrDebug.
*
* @param Throwable $throwable The throwable to handle
* @param string $extra Extra contents to append to the XrDebug message
* @param string $extra Extra contents to append to the xrDebug message
*
* @codeCoverageIgnore
*/
Expand Down Expand Up @@ -143,7 +143,7 @@ function throwableHandler(Throwable $throwable, string $extra = ''): void
// @codeCoverageIgnoreEnd
if (! function_exists('xr')) { // @codeCoverageIgnore
/**
* Dumps information about one or more variables to XrDebug.
* Dumps information about one or more variables to xrDebug.
*
* ```php
* xr($foo, $bar,...);
Expand Down Expand Up @@ -184,7 +184,7 @@ function xr(mixed ...$vars): void
}
if (! function_exists('xrr')) { // @codeCoverageIgnore
/**
* Send a raw html message to XrDebug.
* Send a raw html message to xrDebug.
*
* ```php
* xrr($html, ...);
Expand Down Expand Up @@ -222,7 +222,7 @@ function xrr(
}
if (! function_exists('xri')) { // @codeCoverageIgnore
/**
* Access XrDebug inspector to send debug information.
* Access xrDebug inspector to send debug information.
*
* @codeCoverageIgnore
*/
Expand Down

0 comments on commit fb1b164

Please sign in to comment.