spatie / global-ray Goto Github PK
View Code? Open in Web Editor NEWEnable Ray in all PHP files on your system
Home Page: https://myray.app
License: MIT License
Enable Ray in all PHP files on your system
Home Page: https://myray.app
License: MIT License
Hello!
I wanted to install ray globally but zsh didn't find the global-ray executable. Composer require executed without errors. I have several PHP versions installed with brew, I don't know if it matters, the linked version is 7.4. if I specify the full path to the global-ray executable, it runs without a hitch. If I knew how to fix this bug I would've done it :)
Thank you for your time!
I'm getting this error when using ray()->showQueries()
in a test (so on CLI).
BadMethodCallException : Method showQueries does not exist.
phar:///Users/username/.composer/vendor/spatie/global-ray/ray-phars/ray_php_8.1.phar/vendor/spatie/macroable/src/Macroable.php:42
Once I install ray locally in the project everything works.
Love the idea of not needing to install the package on a per-project basis. Trying to install on ubuntu 18 - php 8.0:
The package installs no problem but the global-ray is have permissions issues.
$ global-ray install
Updating PHP ini: /etc/php/8.0/cli/php.ini
PHP Warning: file_put_contents(/etc/php/8.0/cli/php.ini): Failed to open stream: Permission denied in /home/forge/.composer/vendor/spatie/global-ray/src/Support/PhpIni.php on line 36
Warning: file_put_contents(/etc/php/8.0/cli/php.ini): Failed to open stream: Permission denied in /home/forge/.composer/vendor/spatie/global-ray/src/Support/PhpIni.php on line 36
Unable to update PHP ini.
Trying with sudo
doesn't help.
$ sudo global-ray install
sudo: global-ray: command not found
Upgrading from 1.0.6 to 1.1.0 seems to break using ray on objects within the Phalcon framework.
doing ray($model)
Will normally return an instance of model or something extending it.
or ray($model->relationship)
Would normally return an instance of simple result
But after upgrading it just doesn't return anything in the ray client, like I didn't have any rays in the code base.
I noticed doing ray()->raw($model)
or ray()->raw($model->relationship)
seem to give the old output.
I have a feeling that this commit is the culprit spatie/ray@f547ffb
But I've tried to track it down more specially but since this comes with a bundled ray version it's hard to figure out what is actually breaking.
For some bizar reason, Global Ray has stopped working for me. Everytime I try to use ray
, dd
or dump
nothing happens for me and nothing appears in Ray. I have no idea how this happened or where to begin to troubleshoot...
I've tried:
auto_prepend_file
config is correct in php.iniAny help is greatly appreciated.
Right now, Ray displays the wrong path, it probably gets confused with those phar paths.
Hi,
Just started using Ray and already loving it. But there seems to be a problem with floats on php 7.4
Describe the bug
$arraytest = array( 'price' => 412.39); // as float
ray($arraytest);
Gives an error:
PHP Fatal error: Uncaught Error: Call to undefined function str_contains() in phar://C:/Users//Composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/symfony/var-dumper/Dumper/CliDumper.php:126
Stack trace:
#0 phar://C:/Users//Composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/symfony/var-dumper/Cloner/Data.php(371): GlobalRay\Symfony\Component\VarDumper\Dumper\CliDumper->dumpScalar(Object(GlobalRay\Symfony\Component\VarDumper\Cloner\Cursor), 'double', '412.39')
spatie/ray#1 phar://C:/Users//Composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/symfony/var-dumper/Cloner/Data.php(278): GlobalRay\Symfony\Component\VarDumper\Cloner\Data->dumpItem(Object(GlobalRay\Symfony\Component\VarDumper\Dumper\HtmlDumper), Object(GlobalRay\Symfony\Component\VarDumper\Cloner\Cursor), Array, 412.39)
spatie/ray-app#5 phar://C:/Users//Composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/symfony/var-dumper/Dumper/AbstractDumper.php(120): in phar://C:/Users/***/Composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/symfony/var-dumper/Dumper/CliDumper.php on line 126
To my understanding, str_contains() isn't available in php 7.4 yet but only in PHP 8, might that be the problem?
$arraytest = array( 'price' => '412.39'); // As a string
ray($arraytest);
Works fine btw.
Versions
Ray version 2.0.1.0
PHP version 7.4.28
To Reproduce
Just create a simple php script and try the above 2 different options.
Expected behavior
Expected to see the array in Ray ;)
Desktop (please complete the following information):
I'm using Laravel Herd locally with spatie/global-ray
installed via composer global require
and it was working fine - until this morning.
When I open any page on my PHP 8.2 test sites at the moment, I'm getting these errors output at the top of the page:
Warning: file_get_contents(/Users/mike/.config/valet/config.json): Failed to open stream: No such file or directory in /Users/mike/.composer/vendor/spatie/global-ray/src/scripts/global-ray-loader.php on line 45
Warning: Attempt to read property "paths" on null in /Users/mike/.composer/vendor/spatie/global-ray/src/scripts/global-ray-loader.php on line 47
Warning: foreach() argument must be of type array|object, null given in /Users/mike/.composer/vendor/spatie/global-ray/src/scripts/global-ray-loader.php on line 47
Warning: file_get_contents(/Users/mike/.config/valet/config.json): Failed to open stream: No such file or directory in /Users/mike/.composer/vendor/spatie/global-ray/src/scripts/global-ray-loader.php on line 45
Warning: Attempt to read property "paths" on null in /Users/mike/.composer/vendor/spatie/global-ray/src/scripts/global-ray-loader.php on line 47
Warning: foreach() argument must be of type array|object, null given in /Users/mike/.composer/vendor/spatie/global-ray/src/scripts/global-ray-loader.php on line 47
...which then messes with the styling and output of the HTML page beneath it, or any other outputs that are generated via Laravel routes such as resized images etc.
I've tried a composer global reinstall
and global-ray install
again, but no luck.
I've been having some trouble with the clock on my MacBook resetting itself so I'm not sure if that's somehow related to these files apparently disappearing?
Hi, great work on the package! I think this will be really useful for me.
I happened to need some ray()
goodness on an old Drupal 7 project I was looking at, right as you tweeted about this package. So of course I immediately gave this a try on PHP7.4 to see what it would do.
I installed it like this:
php7.4 /opt/homebrew/bin/composer global require spatie/global-ray
php7.4 /Users/matt/.composer/vendor/bin/global-ray install
Now my Drupal 7 (PHP 7.4) project outputs #!/usr/bin/env php
at the start of the HTML:
#!/usr/bin/env php
<!DOCTYPE html>
<html lang="en" dir="ltr" prefix="content: http://purl.org/rss/1.0/modules/content/ dc: http://purl.org/dc/terms/ foaf: http://xmlns.com/foaf/0.1/ og: http://ogp.me/ns# rdfs: http://www.w3.org/2000/01/rdf-schema# sioc: http://rdfs.org/sioc/ns# sioct: http://rdfs.org/sioc/types# skos: http://www.w3.org/2004/02/skos/core# xsd: http://www.w3.org/2001/XMLSchema#">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
And if I try a ray()
call within the code:
#!/usr/bin/env php
Array
(
[20] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => /Users/matt/Sites/example.com/public/index.php
[lineNumber] => 20
[arguments] => Array
(
)
[applicationFrame] =>
[method] => [top]
[class] =>
)
[19] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => /Users/matt/Sites/example.com/public/includes/bootstrap.inc
[lineNumber] => 2602
[arguments] =>
[applicationFrame] => 1
[method] => drupal_bootstrap
[class] =>
)
[18] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => /Users/matt/Sites/example.com/public/includes/common.inc
[lineNumber] => 5403
[arguments] =>
[applicationFrame] => 1
[method] => _drupal_bootstrap_full
[class] =>
)
[17] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => /Users/matt/Sites/example.com/public/includes/theme.inc
[lineNumber] => 100
[arguments] =>
[applicationFrame] => 1
[method] => drupal_theme_initialize
[class] =>
)
[16] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => /Users/matt/Sites/example.com/public/includes/theme.inc
[lineNumber] => 216
[arguments] =>
[applicationFrame] => 1
[method] => _drupal_theme_initialize
[class] =>
)
[15] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => /Users/matt/Sites/example.com/public/themes/engines/phptemplate/phptemplate.engine
[lineNumber] => 14
[arguments] =>
[applicationFrame] => 1
[method] => phptemplate_init
[class] =>
)
[14] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => /Users/matt/Sites/example.com/public/sites/all/themes/woodcraft/template.php
[lineNumber] => 8
[arguments] => Array
(
[0] => /Users/matt/Sites/example.com/public/sites/all/themes/woodcraft/template.php
)
[applicationFrame] => 1
[method] => include_once
[class] =>
)
[13] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/autoload.php
[lineNumber] => 15
[arguments] =>
[applicationFrame] => 1
[method] => ray
[class] =>
)
[12] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/spatie/ray/src/helpers.php
[lineNumber] => 44
[arguments] =>
[applicationFrame] => 1
[method] => GlobalRay\ray
[class] =>
)
[11] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/composer/../spatie/ray/src/Ray.php
[lineNumber] => 503
[arguments] =>
[applicationFrame] => 1
[method] => send
[class] => GlobalRay\Spatie\Ray\Ray
)
[10] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/composer/../spatie/ray/src/Ray.php
[lineNumber] => 569
[arguments] =>
[applicationFrame] => 1
[method] => sendRequest
[class] => GlobalRay\Spatie\Ray\Ray
)
[9] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/composer/../spatie/ray/src/Client.php
[lineNumber] => 58
[arguments] =>
[applicationFrame] => 1
[method] => send
[class] => GlobalRay\Spatie\Ray\Client
)
[8] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/composer/../spatie/ray/src/Request.php
[lineNumber] => 29
[arguments] =>
[applicationFrame] => 1
[method] => toJson
[class] => GlobalRay\Spatie\Ray\Request
)
[7] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/composer/../spatie/ray/src/Request.php
[lineNumber] => 24
[arguments] =>
[applicationFrame] => 1
[method] => toArray
[class] => GlobalRay\Spatie\Ray\Request
)
[6] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => unknown
[lineNumber] => 0
[arguments] =>
[applicationFrame] => 1
[method] => array_map
[class] =>
)
[5] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/composer/../spatie/ray/src/Request.php
[lineNumber] => 23
[arguments] =>
[applicationFrame] => 1
[method] => GlobalRay\Spatie\Ray\{closure}
[class] => GlobalRay\Spatie\Ray\Request
)
[4] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/composer/../spatie/ray/src/Payloads/Payload.php
[lineNumber] => 30
[arguments] =>
[applicationFrame] => 1
[method] => toArray
[class] => GlobalRay\Spatie\Ray\Payloads\Payload
)
[3] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/composer/../spatie/ray/src/Payloads/Payload.php
[lineNumber] => 40
[arguments] =>
[applicationFrame] => 1
[method] => getOrigin
[class] => GlobalRay\Spatie\Ray\Payloads\Payload
)
[2] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/composer/../spatie/ray/src/Origin/DefaultOriginFactory.php
[lineNumber] => 12
[arguments] =>
[applicationFrame] => 1
[method] => getOrigin
[class] => GlobalRay\Spatie\Ray\Origin\DefaultOriginFactory
)
[1] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/composer/../spatie/ray/src/Origin/DefaultOriginFactory.php
[lineNumber] => 20
[arguments] =>
[applicationFrame] => 1
[method] => getFrame
[class] => GlobalRay\Spatie\Ray\Origin\DefaultOriginFactory
)
[0] => GlobalRay\Spatie\Backtrace\Frame Object
(
[file] => phar:///Users/matt/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/composer/../spatie/ray/src/Origin/DefaultOriginFactory.php
[lineNumber] => 27
[arguments] =>
[applicationFrame] => 1
[method] => getAllFrames
[class] => GlobalRay\Spatie\Ray\Origin\DefaultOriginFactory
)
)
<!DOCTYPE html>
...
(but I do get the logs appearing in Ray.app)
Hello,
I was debugging an older app and installed Global Ray to ease it. Apparently, there is a line in the PHAR for 7.4 that belongs to Symfony's VarDumper:
Uncaught Error: Call to undefined function str_contains() in phar:///Users/filipac/.composer/vendor/spatie/global-ray/ray-phars/ray_php_7.4.phar/vendor/symfony/var-dumper/Dumper/CliDumper.php:126
str_contains
is only available in PHP 8.0+.
I am not sure this is the right repository to report it, it might belong to ray repo itself. I've been trying to fix it but I am not sure yet how to build the PHAR.
Later edit: I saw that a polyfill is used and the function should be available. This is weird.
Ubuntu 20.04
I'm user registered for ray.
If try install with sudo get same problem. Is normal, file php.ini are files of system with onwer root
composer global require spatie/global-ray
Changed current directory to /home/abkrim/.composer
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^1.0 for spatie/global-ray
./composer.json has been updated
Running composer update spatie/global-ray
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
- Locking spatie/global-ray (1.0.2)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Downloading spatie/global-ray (1.0.2)
- Installing spatie/global-ray (1.0.2): Extracting archive
Generating autoload files
13 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
❯ global-ray install
⚡️
debug your applications faster.
🌎 For more info visit: https://myray.app
💪 By installing global-ray you will be able to use
these functions in any PHP script: ray(), rd(), dump(), dd()
You can chain a lot of useful functions on ray()
- ray()->green(): colorize the output in Ray
- ray()->pause(): pause your code
- ray()->measure(): quickly measure runtime and memory
- ray()->trace(): see where your function is being called
- ray()->charles(): Let's dance!
📗 You can see more Ray functions in the docs:
https://spatie.be/docs/ray/v1/usage/framework-agnostic-php-project
🤙 Do you wish to install Ray globally? (Y/n) > Y
Updating PHP ini: /etc/php/8.1/cli/php.ini...
PHP Warning: file_put_contents(/etc/php/8.1/cli/php.ini): Failed to open stream: Permission denied in /home/abkrim/.composer/vendor/spatie/global-ray/src/Support/PhpIni.php on line 36
❌ Unable to update PHP ini.
``
sudo global-ray install
sudo: global-ray: orden no encontrada
I put here beacuse thre're some issues wiyh links on "Ask a question"
![Castris_20220309_160459](https://user-images.githubusercontent.com/1238625/157469832-05e05073-6dfb-4a26-817c-ebd4989367f6.jpg)
Creating this issue as a reminder to update the build-phars
GitHub workflow to build for PHP 8.2 when it is released in the coming days.
Since i installed the global-ray i got PHP errors at every "composer" command i do.
The first one is:
Warning: Undefined array key "HTTP_HOST" in /Users/***/.composer/vendor/spatie/global-ray/src/scripts/global-ray-loader.php on line 48
Which would be understandable since HTTP_HOST isn't set on cli.
The second one is:
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /Users/***/.composer/vendor/spatie/global-ray/src/scripts/global-ray-loader.php on line 48
Also understandable since the HTTP_HOST will be null if not set.
So did i do some setting wrong or is this a bug?
Also isn't it best practice to check if a server variable isset and has the expected format before using it?
when run global-ray install:
PHP Warning: file_put_contents(/etc/php/8.1/cli/php.ini): Failed to open stream: Permission denied in /home/hasta/.config/composer/vendor/spatie/global-ray/src/Support/PhpIni.php on line 36 PHP Stack trace: PHP 1. {main}() /home/hasta/.config/composer/vendor/spatie/global-ray/bin/global-ray:0 PHP 2. Symfony\Component\Console\Application->run($input = *uninitialized*, $output = *uninitialized*) /home/hasta/.config/composer/vendor/spatie/global-ray/bin/global-ray:20 PHP 3. Symfony\Component\Console\Application->doRun($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'install']; protected $interactive = TRUE; private $tokens = [0 => 'install']; private $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private $stderr = class Symfony\Component\Console\Output\StreamOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private $consoleSectionOutputs = [] }) /home/hasta/.config/composer/vendor/symfony/console/Application.php:171 PHP 4. Symfony\Component\Console\Application->doRunCommand($command = class Spatie\GlobalRay\Commands\InstallCommand { private ${Symfony\Component\Console\Command\Command}application = class Symfony\Component\Console\Application { private $commands = [...]; private $wantHelps = FALSE; private $runningCommand = ...; private $name = 'Spatie Global Ray Installer'; private $version = '1.0.0'; private $commandLoader = NULL; private $catchExceptions = TRUE; private $autoExit = TRUE; private $definition = class Symfony\Component\Console\Input\InputDefinition { ... }; private $helperSet = class Symfony\Component\Console\Helper\HelperSet { ... }; private $dispatcher = NULL; private $terminal = class Symfony\Component\Console\Terminal { ... }; private $defaultCommand = 'list'; private $singleCommand = FALSE; private $initialized = TRUE; private $signalRegistry = class Symfony\Component\Console\SignalRegistry\SignalRegistry { ... }; private $signalsToDispatchEvent = [...] }; private ${Symfony\Component\Console\Command\Command}name = 'install'; private ${Symfony\Component\Console\Command\Command}processTitle = NULL; private ${Symfony\Component\Console\Command\Command}aliases = []; private ${Symfony\Component\Console\Command\Command}definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 0; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; private ${Symfony\Component\Console\Command\Command}hidden = FALSE; private ${Symfony\Component\Console\Command\Command}help = ''; private ${Symfony\Component\Console\Command\Command}description = 'Install Spatie Ray globally.'; private ${Symfony\Component\Console\Command\Command}fullDefinition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; private ${Symfony\Component\Console\Command\Command}ignoreValidationErrors = FALSE; private ${Symfony\Component\Console\Command\Command}code = NULL; private ${Symfony\Component\Console\Command\Command}synopsis = []; private ${Symfony\Component\Console\Command\Command}usages = []; private ${Symfony\Component\Console\Command\Command}helperSet = class Symfony\Component\Console\Helper\HelperSet { private $helpers = [...]; private $command = NULL } }, $input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'install']; protected $interactive = TRUE; private $tokens = [0 => 'install']; private $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private $stderr = class Symfony\Component\Console\Output\StreamOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private $consoleSectionOutputs = [] }) /home/hasta/.config/composer/vendor/symfony/console/Application.php:299 PHP 5. Symfony\Component\Console\Command\Command->run($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'install']; protected $interactive = TRUE; private $tokens = [0 => 'install']; private $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private $stderr = class Symfony\Component\Console\Output\StreamOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private $consoleSectionOutputs = [] }) /home/hasta/.config/composer/vendor/symfony/console/Application.php:1015 PHP 6. Spatie\GlobalRay\Commands\InstallCommand->execute($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'install']; protected $interactive = TRUE; private $tokens = [0 => 'install']; private $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private $stderr = class Symfony\Component\Console\Output\StreamOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private $consoleSectionOutputs = [] }) /home/hasta/.config/composer/vendor/symfony/console/Command/Command.php:298 PHP 7. Spatie\GlobalRay\Support\PhpIni->update($optionName = 'auto_prepend_file', $value = '/home/hasta/.config/composer/vendor/spatie/global-ray/src/scripts/global-ray-loader.php') /home/hasta/.config/composer/vendor/spatie/global-ray/src/Commands/InstallCommand.php:64 PHP 8. file_put_contents($filename = '/etc/php/8.1/cli/php.ini', $data = '[PHP]\n\n;;;;;;;;;;;;;;;;;;;\n; About php.ini ;\n;;;;;;;;;;;;;;;;;;;\n; PHP\'s initialization file, generally called php.ini, is responsible for\n; configuring many of the aspects of PHP\'s behavior.\n\n; PHP attempts to find and load this configuration from a number of locations.\n; The following is a summary of its search order:\n; 1. SAPI module specific location.\n; 2. The PHPRC environment variable. (As of PHP 5.2.0)\n; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0)\n; 4. Curren') /home/hasta/.config/composer/vendor/spatie/global-ray/src/Support/PhpIni.php:36 ❌ Unable to update PHP ini.
Re-opening #17 because this still is happening it seems
For some bizar reason, Global Ray has stopped working for me. Every time I try to use ray
, dd
or dump
nothing happens for me and nothing appears in Ray. I have no idea how this happened or where to begin to troubleshoot...
I've tried:
auto_prepend_file
config is correct in php.iniAny help is greatly appreciated.
Hey there
first of all: thanks a ton for providing Ray and this package which makes debugging easy breezy! 🙌🏻
The ray command (and dd) would not load as expected in my environment causing a "Call to undefined function ray()" error.
macOS Monterey (pretty fresh install), MAMP Pro, PHP 8.0.8, Wordpress PHP website
I have MAMP configured to publish it's PHP version to the command line:
It seems like ray added itself to the wrong PHP ini file:
🤙 Do you wish to install Ray globally? (Y/n) > Y
Updating PHP ini: /Applications/MAMP/bin/php/php8.0.8/conf/php.ini...
If I check which php.ini is used on my command line:
➜ ~ php -i | grep "Configuration File"
Configuration File (php.ini) Path => /Applications/MAMP/bin/php/php8.0.8/conf
Loaded Configuration File => /Library/Application Support/appsolute/MAMP PRO/conf/php8.0.8.ini
I've copied the followingline that Global ray added also to the "/Library/Application Support/appsolute/MAMP PRO/conf/php8.0.8.ini" file:
auto_prepend_file = /Users/aaron/.composer/vendor/spatie/global-ray/src/scripts/global-ray-loader.php
After that it works like a charm.
Please reply if I can provide any other information.
Aaron
On my Windows 10, I use WampServer and Laragon, and on both Ray works fine with PHP 8.2
When I switch to PHP 8.3, with the php.ini identical, I'm getting error:
Error: Error: Call to undefined function ray() in file xxx.php line xxx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.