GitHub - spatie/global-ray: Enable Ray in all PHP files on your system
source link: https://github.com/spatie/global-ray
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Enable Ray in all PHP files on your system
By installing Ray globally, you can use ray()
and all framework agnostic Ray functions in any PHP app or script on your system.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
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.
Installation
You can install the global Ray via composer:
composer global require spatie/global-ray global-ray install
When running global-ray install
, we'll add a line in your php.ini
to automatically load ray, allowing ray to be available in any PHP project or script.
Usage
You can use ray()
and all Ray's framework agnostic functions in any PHP file.
Using framework specific functionality
To use framework specific functionality, such as viewing queries in Laravel, or displaying mails in WordPress, you should still install the relevant package or library.
If a framework specific package is detected, it will be used instead of the global Ray.
How to uninstall
To uninstall you must first issue this command:
global-ray uninstall
This will remove the line in php.ini
that automatically loads ray.
After that, you can install the package itself using
composer global remove spatie/global-ray
Troubleshooting
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 php.ini
.
You find the location of your php.ini
by executing this command:
php --ini
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK