Enable Ray in all PHP files on your system
This package is auto-updated.
Last update: 2023-12-09 18:42:54 UTC
Ray is a wonderful desktop application that can help you debug applications faster. It can beautifully show you all debugging information, can pause your code, measure performance and a whole lot more.
To send debugging information to Ray, you can use the
spatie/global-ray, you can use
ray() and all framework agnostic Ray functions in any PHP app or script on your system.
If you installed a specific Ray package, such as spatie/laravel-ray in your project already, then
ray() will execute that specific version, so you can use still use framework specific things such as
ray()->showQueries() to show all executed queries.
❤️ As a bonus the popular
dump functions will be made available globally too.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
You can install the global Ray via composer:
composer global require spatie/global-ray global-ray install
global-ray install, we'll add a line in your
php.ini to automatically load the functions provided by this package.
You can use
ray() and all Ray's framework agnostic functions in any PHP file.
dd() will also be available in any PHP project or script.
If a framework specific package is detected, it will be used instead of the global Ray.
To uninstall you must first issue this command:
This will remove the line in
php.ini that automatically loads
ray() and related functions.
After that, you can uninstall the package itself using
composer global remove spatie/global-ray
If suddenly all of PHP scripts terminate very early with a strange error after upgrading PHP or switching to another version, then global ray might be the culprit.
As mentioned before, during install we slightly modify your
php.ini. To manually uninstall global ray, remove the script named
global-ray-loader.php in the
auto_prepend_file directive in
You find the location of your
php.ini by executing this command:
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.