Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mu-plugin does not take precedence over global #78

Open
Brugman opened this issue Jun 19, 2024 · 2 comments
Open

mu-plugin does not take precedence over global #78

Brugman opened this issue Jun 19, 2024 · 2 comments

Comments

@Brugman
Copy link
Contributor

Brugman commented Jun 19, 2024

source: https://myray.app/docs/php/vanilla-php/installation

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.

Is this still working in the case of WordPress?

My global installation is working, and my mu-plugin installation is working, tested on their own.

When both are active, running this in a custom plugin:

ray()->clearScreen();
ray('hello');
ray()->showHooks(); // WP only function
ray()->stopShowingHooks(); // WP only function

results in:

Fatal error:  Uncaught BadMethodCallException: Method showHooks does not exist. in phar://C:/Users/Tim/AppData/Roaming/Composer/vendor/spatie/global-ray/ray-phars/ray_php_8.0.phar/vendor/spatie/macroable/src/Macroable.php:42
Stack trace:
#0 C:\webdev\wptest3\public_html\wp-content\plugins\test\test.php(20): GlobalRay\Spatie\Ray\Ray->__call('showHooks', Array)
#1 C:\webdev\wptest3\public_html\wp-settings.php(517): include_once('C:\\webdev\\wptes...')
#2 C:\webdev\wptest3\public_html\wp-config.php(78): require_once('C:\\webdev\\wptes...')
#3 C:\webdev\wptest3\public_html\wp-load.php(50): require_once('C:\\webdev\\wptes...')
#4 C:\webdev\wptest3\public_html\wp-admin\admin.php(34): require_once('C:\\webdev\\wptes...')
#5 C:\webdev\wptest3\public_html\wp-admin\plugins.php(10): require_once('C:\\webdev\\wptes...')
#6 {main}
thrown in phar://C:/Users/Tim/AppData/Roaming/Composer/vendor/spatie/global-ray/ray-phars/ray_php_8.0.phar/vendor/spatie/macroable/src/Macroable.php on line 42

If I disable the global install:

; auto_prepend_file = C:\Users\Tim\AppData\Roaming\Composer\vendor\spatie\global-ray\src\scripts\global-ray-loader.php

Then it works.

@spatie-bot
Copy link

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.

@Brugman
Copy link
Contributor Author

Brugman commented Oct 21, 2024

I don't have permissions to reopen this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants