Use Ray in any PHP script without requiring it in your projects.

Overview

Global Ray

Use Ray in any PHP script without requiring it in your projects.

  1. Require this package globally with Composer:

    composer global require cuyz/global-ray

  2. Adapt this directive in your PHP configuration:

    # php.ini
    auto_prepend_file=${HOME}/.composer/vendor/cuyz/global-ray/prepend_ray.php
    
  3. Use Ray inside any PHP script:

    ray('Hello world!')->blue();

Build the project

$ git clone https://github.com/CuyZ/Global-Ray
$ cd Global-Ray
$ composer install --no-dev
$ composer refresh
You might also like...
Allow any Discord user to sign in to your website and save their discord user information for later use.
Allow any Discord user to sign in to your website and save their discord user information for later use.

Simple Discord SSO ( Single Sign-On ) Requires at least: 5.0 Tested up to: 5.8.3 Stable tag: 1.0.2 Requires PHP: 7.4 License: GPLv2 or later License U

Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP

Lodash-PHP Lodash-PHP is a port of the Lodash JS library to PHP. It is a set of easy to use utility functions for everyday PHP projects. Lodash-PHP tr

This composer plugin allows you to share your selected packages between your projects by creating symlinks
This composer plugin allows you to share your selected packages between your projects by creating symlinks

Composer - Shared Package Plugin This composer plugin allows you to share your selected packages between your projects by creating symlinks. All share

This PHP script optimizes the speed of your RAM memory

██████╗░██╗░░██╗██████╗░░█████╗░██╗░░░░░███████╗░█████╗░███╗░░██╗███████╗██████╗░ ██╔══██╗██║░░██║██╔══██╗██╔══██╗██║░░░░░██╔════╝██╔══██╗████╗░██║██╔

A PHP library that can be used manually as well as a CLI script that you can just run on your file

Run phpcs on files and only report new warnings/errors compared to the previous version. This is both a PHP library that can be used manually as well

A small PHP Script to protect your site against DDoS attack .

Anti-DDoS A small PHP Script to protect your site against DDoS attack. Description Most of bots can't execute JavaScript code or can execute code part

Moodle ReactJS - gives you ability to use ReactJS inside any moodle page.

moodle-local_reactjs Moodle ReactJS - gives you ability to use ReactJS inside any moodle page. Note for devs: You'll need to set up npm dependencies d

This script allows to bypass Oracle Cloud Infrastructure 'Out of host capacity' error immediately when additional OCI capacity will appear in your Home Region / Availability domain.
This script allows to bypass Oracle Cloud Infrastructure 'Out of host capacity' error immediately when additional OCI capacity will appear in your Home Region / Availability domain.

Resolving Oracle Cloud "Out of Capacity" issue and getting free VPS with 4 ARM cores / 24GB of memory Very neat and useful configuration was recently

Comments
  • Call to undefined function `ray()`

    Call to undefined function `ray()`

    First of all, thanks for your work.

    On my MacBook, I run the flow steps:

    1. install Global-Ray
    composer global require cuyz/global-ray
    
    1. change php.ini
    # php.ini
    auto_prepend_file=${HOME}/.composer/vendor/cuyz/global-ray/prepend_ray.php
    
    1. use ray() in Laravel project
    ray('Hello world!')->blue();
    

    It will throw an exception Like:

    Error Call to undefined function App\Http\Controllers\ray()

    So I use \ray('Hello world!')->blue();, then also throw: Call to undefined function ray().

    Check php.ini config:

    ➜  ~ php -i |grep prep
    auto_prepend_file => /Users/curder/.composer/vendor/cuyz/global-ray/prepend_ray.php => /Users/curder/.composer/vendor/cuyz/global-ray/prepend_ray.php
    error_prepend_string => no value => no value
    

    And try to restart php-fpm and nginx services. the error also exists.

    please give me some help, thanks again.

    opened by curder 10
  • PHP 8.1

    PHP 8.1

    Any plans to update it for PHP 8.1+ ?

    Some of the warnings I'm getting:

    Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in \vendor\cuyz\global-ray\build\vendor\spatie\ray\src\Concerns\RemovesRayFrames.php on line 18
    
    Deprecated: RayGlobalScoped\Ramsey\Uuid\Uuid implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in \vendor\cuyz\global-ray\build\vendor\ramsey\uuid\src\Uuid.php on line 36
    
    Deprecated: Return type of RayGlobalScoped\Ramsey\Collection\AbstractArray::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in \vendor\cuyz\global-ray\build\vendor\ramsey\collection\src\AbstractArray.php on line 77
    
    Deprecated: RayGlobalScoped\Ramsey\Uuid\Builder\BuilderCollection implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in \vendor\cuyz\global-ray\build\vendor\ramsey\uuid\src\Builder\BuilderCollection.php on line 28
    
    Deprecated: RayGlobalScoped\Ramsey\Uuid\Provider\Node\NodeProviderCollection implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in \vendor\cuyz\global-ray\build\vendor\ramsey\uuid\src\Provider\Node\NodeProviderCollection.php on line 22
    
    Deprecated: RayGlobalScoped\Ramsey\Uuid\Lazy\LazyUuidFromString implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in \vendor\cuyz\global-ray\build\vendor\ramsey\uuid\src\Lazy\LazyUuidFromString.php on line 49
    

    Thanks!

    opened by mambax7 3
  • Does not work in Windows. It restarts Apache when ray function is called.

    Does not work in Windows. It restarts Apache when ray function is called.

    I used this path for prepend in Windows.

    auto_prepend_file=C:\Users/Atiq/AppData/Roaming/Composer/vendor/cuyz/global-ray/prepend_ray.php
    

    the path is correct and any PHP file works file except the one which has any ray() function call.

    opened by atiqsamtia 6
  • Invalid origin displayed in Ray app

    Invalid origin displayed in Ray app

    opened by romm 0
Releases(0.1.0)
Owner
Team CuyZ
Team CuyZ
YCOM Impersonate. Login as selected YCOM user 🧙‍♂️in frontend.

YCOM Impersonate Login as selected YCOM user in frontend. Features: Backend users with admin rights or YCOM[] rights, can be automatically logged in v

Friends Of REDAXO 17 Sep 12, 2022
Enable ray(), dd() and dump() in all PHP files on your system

Enable ray(), dd() and dump() in all PHP files on your system Ray is a wonderful desktop application that can help you debug applications faster. It c

Spatie 190 Dec 13, 2022
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
A simple GitScrum plugin for Wordpress. You will be able to manage your projects without having to leave Wordpress.

GitScrum Plugin for Wordpress A simple GitScrum plugin for Wordpress. You will be able to manage your projects without having to leave Wordpress. GitS

GitScrum 4 Nov 30, 2022
A Laravel Wrapper for the Binance API. Now easily connect and consume the Binance Public & Private API in your Laravel apps without any hassle.

This package provides a Laravel Wrapper for the Binance API and allows you to easily communicate with it. Important Note This package is in early deve

Moinuddin S. Khaja 7 Dec 7, 2022
A complete solution for group projects in organizations that lets you track your work in any scenario. Working in a team is a cumbersome task, ease it using our project management system.

SE-Project-Group24 What is Evolo? Evolo is Dashboard based Project Management System. A complete solution for group projects in organizations that let

Devanshi Savla 2 Oct 7, 2022
Yclas Self Hosted is a powerful script that can transform any domain into a fully customizable classifieds site within a few seconds.

Yclas 4.4.0. Description Yclas self-hosted is a powerful script that can transform any domain into a fully customizable classifieds site within a few

Yclas 299 May 29, 2022
Laravel & MySQL, jQuery, Ajax, Bootstrap. Also, it's include email send function without any API.

Rewards-Dacor Laravel & MySQL, jQuery, Ajax, Bootstrap. Also, it's include email send function without any API. [Live site link] ( https://rewardsdaco

Professional Developer 13 Dec 26, 2022
Track any ip address with IP-Tracer. IP-Tracer is developed for Linux and Termux. you can retrieve any ip address information using IP-Tracer.

IP-Tracer is used to track an ip address. IP-Tracer is developed for Termux and Linux based systems. you can easily retrieve ip address information using IP-Tracer. IP-Tracer use ip-api to track ip address.

Rajkumar Dusad 1.2k Jan 4, 2023