Download the PHP package chevere/xr without Composer

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

xrDebug PHP client

Build Code size PHPStan Mutation testing badge

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

Summary

PHP client library for xrDebug. This library provides a set of functions to dump variables, send raw messages, and interact with the inspector from your codebase.

Quick start

Install using Composer.

Use xr() directly in your code to dump any variable. For example:

Configuring

This xrDebug PHP client uses the following default configuration.

Skip this section if running from the xrDebug binary and on the same machine.

Property Type Effect
isEnabled bool Controls sending messages to the server
isHttps bool Controls use of https
host string The host where xrDebug server is running
port int The Port to connect to the host
key string Private key (ed25519) for signed requests

host The hostname or IP. When running xrDebug on Docker use host.docker.internal.

File-based config

Configure the client by placing a xr.php file in project's root directory. Need to define only the properties that override the default config.

We recommend adding xr.php to your .gitignore.

Here some examples of xr.php:

Code-based config

Use function xrConfig() to configure the xrDebug server connection directly in your logic. Need to define only the properties that override the default config.

Here some examples of xrConfig():

Debug helpers

This xrDebug PHP client provides the following helper functions in the root namespace. Use these anywhere in your code.

Function Purpose
xr Dump one or more variables
xrr Dump raw message
xri Dump inspector (pauses, etc)

xr

Use function xr($var1, $var2,...) to dump one or more variable(s).

Pass a topic using t:.

Pass an emote using e:.

Pass bitwise flags to trigger special behavior.

xrr

Use function xrr() to send a raw message.

xri

Use function xri() to interact with the inspector.

Use pause to pause code execution.

Use memory to send memory usage information.

Debug helpers (VarDump)

This xrDebug PHP client also provides the following helper functions provided by the VarDump package.

Function Purpose
vd VarDump to output stream
vdd VarDump to output stream and die

vd

Function vd is a drop-in replacement for var_dump. It prints information about one or more variables to the output stream.

vdd

Function vdd does same as vd, but with die(0) which halts further execution.

Exception handling

The PHP client provides a throwable handler that can hook or replace existing exception handler logic thanks to the ThrowableHandler package.

Register handler

Use registerThrowableHandler to enable xrDebug throwable handling.

Error handling

To handle errors with xrDebug you will require to configure your project to handle errors as exceptions and register a shutdown function:

Triggered handler

Use throwableHandler in any existing exception handler logic:

Custom inspectors

Extra inspectors can be defined to provide more context aware debug information. To create a custom inspector use XrInspectorTrait to implement the XrInspectorInterface and use sendCommand method.

For code below, myDump defines a method that will stream data from your application logic and myPause sends a pause with debug backtrace by default.

The method sendCommand enables to interact with the existing xrDebug instance.

Null inspector

A null inspector is required to void any inspection call if xrDebug is disabled. The null inspector should implement the same methods as the real inspector, but without carrying any action.

💡 Use XrInspectorNullTrait to implement the XrInspectorInterface when providing null inspector.

Helper function for custom inspector

To use your custom helper:

Documentation

Documentation available at docs.xrdebug.com.

License

Copyright Rodolfo Berrios A.

xrDebug is licensed under the Apache License, Version 2.0. See 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.


All versions of xr with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-curl Version *
ext-json Version *
chevere/filesystem Version ^1.0.0
chevere/message Version ^1.0.0
chevere/standard Version ^1.0.1
chevere/throwable-handler Version ^1.0.2
chevere/trace Version ^2.0.0
chevere/var-dump Version ^2.0.1
phpseclib/phpseclib Version ~3.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 chevere/xr contains the following files

Loading the files please wait ....