Enable ray(), dd() and dump() in all PHP files on your system

Overview

Enable ray(), dd() and dump() in all PHP files on your system

Latest Version on Packagist Tests Total Downloads

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 ray() function.

By installing 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 dd and dump functions will be made available globally too.

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 the functions provided by this package.

Usage

You can use ray() and all Ray's framework agnostic functions in any PHP file.

The rd(), dump() and dd() will also be available in any PHP project or script.

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() and related functions.

After that, you can uninstall 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.

Comments
  • Global Ray doesn't work with artisan serve

    Global Ray doesn't work with artisan serve

    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:

    • Restarting and reinstalling Ray
    • Restarting PHP 8.1 & 8.0
    • Checked if the auto_prepend_file config is correct in php.ini
    • Restarting and upgrading PHP Monitor

    Any help is greatly appreciated.

    opened by driesvints 31
  • Can't instal on linux because permissions

    Can't instal on linux because permissions

    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)
    
    
    opened by abkrim 8
  • Global ray outputting to screen on php7.4

    Global ray outputting to screen on php7.4

    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)

    opened by Muffinman 6
  • Implement Windows retrying as administrator to update PHP ini

    Implement Windows retrying as administrator to update PHP ini

    This PR implements the Windows retrying as an administrator functionality as seen in the video below:

    Let me know if you'd like any adjustments or changes to anything, thanks! 🙏

    https://user-images.githubusercontent.com/6421846/156000838-0024e348-3957-45c1-9e3c-741ea7948462.mov

    opened by stevebauman 6
  • Anyone managed to get this working on linux based systems?

    Anyone managed to get this working on linux based systems?

    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
    
    opened by sunscreem 5
  • MacOS: global-ray not found

    MacOS: global-ray not found

    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!

    opened by ArselMuginov 4
  • Problem with float

    Problem with float

    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):

    • OS: WIN 10
    • Version 21H2
    opened by the-ard 3
  • Global ray didn't load in MAMP environment

    Global ray didn't load in MAMP environment

    Hey there

    first of all: thanks a ton for providing Ray and this package which makes debugging easy breezy! 🙌🏻

    Problem encountered

    The ray command (and dd) would not load as expected in my environment causing a "Call to undefined function ray()" error.

    Environment

    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: Screenshot 2022-03-08 at 16 55 16

    Source of problem

    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
    

    Solution to problem

    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

    opened by aaronmeder 3
  • can not add global ray

    can not add global ray

    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.

    opened by HAstaShakiba 3
  • Global Ray doesn't work with artisan serve

    Global Ray doesn't work with artisan serve

    Re-opening https://github.com/spatie/global-ray/issues/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:

    • Restarting and reinstalling Ray
    • Restarting PHP 8.1 & 8.0
    • Checked if the auto_prepend_file config is correct in php.ini
    • Restarting and upgrading PHP Monitor

    Any help is greatly appreciated.

    opened by driesvints 2
  • Fix global dd and dump

    Fix global dd and dump

    This PR fixes loading the global dd() and dump() methods. There was a couple things I discovered:

    • The order of phar registration matters. When I register the ray.phar first, it appears to override the dump.phar dd() and dump() methods. I think this may be due to some internal collisions due to ray depending on the Symfony var dumper.
    • Clearing the __composer_autoload_files from $GLOBALS was required to fix dd() and dump() issues with Tinkerwell and scripts that have the dd() and dump() global functions available. Previously, Tinkerwell would fail calling dd() due to naming collisions with with its internal composer autoloader.

    I've also disabled loading the dump.phar when a Tinkerwell environment has been detected. I think we can expand on this detection for other use-cases in the future.

    Let me know your thoughts!

    opened by stevebauman 2
Releases(1.0.5)
Owner
Spatie
We create open source, digital products and courses for the developer community
Spatie
Use Ray in any PHP script without requiring it in your projects.

Global Ray Use Ray in any PHP script without requiring it in your projects. Require this package globally with Composer: composer global require cuyz/

Team CuyZ 26 Jun 5, 2022
Talkino allows you to integrate multi social messengers and contact into your website and enable your users to contact you using multi social messengers' accounts.

Talkino Welcome to our GitHub Repository Talkino is a click to chat plugin to show your agents’ multiple social messengers, phone and emails on the ch

Traxconn 2 Sep 21, 2022
Dump masked information from your database

Laravel Masked DB Dump A database dumping package that allows you to replace and mask columns while dumping your database. Installation You can instal

Beyond Code 95 Jan 2, 2023
Debug with Ray to fix problems faster

Debug with Ray to fix problems faster This package can be installed in any PHP application to send messages to the Ray app. The desktop app: can be us

Spatie 458 Dec 27, 2022
🖤Run Laravel artisan tinker from a Vim buffer with output in Ray

Tinkeray Heavily inspired by the absolutely awesome Tinkerwell, run Laravel artisan tinker from a Vim buffer with output in Ray ?? Installation Usage

Jesse Leite 22 Jan 2, 2023
Find forgotten variables dump in PHP source code.

PHP VarDump Check This repository is abandoned. Suggested alternative: https://github.com/php-parallel-lint/PHP-Var-Dump-Check PHP console application

Jakub Onderka 27 Jul 13, 2022
Find forgotten variables dump in PHP source code.

PHP VarDump Check PHP console application for find forgotten variable dump. Support PHP build in method print_r, var_dump and var_export method and al

PHP Parallel lint 13 Jul 13, 2022
Enable Facebook Instant Articles on your WordPress site.

Instant Articles for WP Enable Instant Articles for Facebook on your WordPress site. Plugin activity Description This plugin adds support for Instant

Automattic 633 Nov 21, 2022
Enable method chaining or fluent expressions for any value and method.

PHP Pipe Operator A (hopefully) temporary solution to implement the pipe operator in PHP. Table of contents Requirements How to install How to use The

Sebastiaan Luca 268 Dec 26, 2022
The Laravel eCommerce USPS Shipping module allows the store owners to enable United States Postal Servies for the shipment of orders.

Introduction Bagisto Usps Shipping add-on provides Usps Shipping methods for shipping the product. By using this, you can provide Usps (United States

Bagisto 2 May 31, 2022
An online system to keep digitized form of employee personal files (staff personal files)

An online system to keep digitized form of employee personal files (staff personal files).

p r o c e s s o r 2 Jun 18, 2022
Greyhole uses Samba to create a storage pool of all your available hard drives, and allows you to create redundant copies of the files you store.

Greyhole Greyhole is an application that uses Samba to create a storage pool of all your available hard drives (whatever their size, however they're c

Guillaume Boudreau 245 Dec 18, 2022
:globe_with_meridians: List of all countries with names and ISO 3166-1 codes in all languages and data formats.

symfony upgrade fixer • twig gettext extractor • wisdom • centipede • permissions handler • extraload • gravatar • locurro • country list • transliter

Saša Stamenković 5k Dec 22, 2022
Provide CSV, JSON, XML and YAML files as an Import Source for the Icinga Director and optionally ship hand-crafted additional Icinga2 config files

Icinga Web 2 Fileshipper module The main purpose of this module is to extend Icinga Director using some of it's exported hooks. Based on them it offer

Icinga 25 Sep 18, 2022
Optimizes class loading performance by generating a single PHP file containing all of the autoloaded files.

Class Preloader for PHP This tool is used to generate a single PHP script containing all of the classes required for a specific use case. Using a sing

Class Preloader 356 Nov 26, 2022
Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files

toKirby Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files. You can easily install and test it in a few steps.

R. Banus 4 Jan 15, 2022
Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.

Admidio Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it

Admidio 212 Dec 30, 2022