Giter Club home page Giter Club logo

kirby3-ray's People

Contributors

robertcordes avatar samzzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

robertcordes

kirby3-ray's Issues

Fatal error: Cannot redeclare dump()

Hi there,

after installing of
genxbe/kirby3-ray v1.0.5
getkirby/cms v3.7.0.2

i am getting the following error when accessing the website (localhost, localhost/panel)

Fatal error: Cannot redeclare dump() (previously declared in /var/www/vendor/symfony/var-dumper/Resources/functions/dump.php:18) in /var/www/kirby/config/helpers.php on line 114

when i deinstall genxbe/kirby3-ray with composer remove genxbe/kirby3-ray no error is shown and everything works as expected

Errors trigger error without error

Sorry for the cheeky title. PR #3 introduced an error when handling errors.

To reproduce:

  1. Put an erroneous code somewhere. Example: <?= 'test'->slug() ?> in the default.php template.
  2. You'd expect an error like "Call to a member function slug() on string" but instead you receive:
"Uncaught TypeError: Spatie\Ray\Ray::exception(): Argument #1 ($exception) must be of type Exception, Error given, called in /site/plugins/kirby3-ray/index.php on line 56

It seems like you get an Error instead of an Exception from the hook and Ray doesn't like that. Disabling the plugin or downgrading to 1.0.1 works.

Maybe add a get_class($exception) check?

php 8.2 -> mb_convert_encoding(): Handling HTML entities via mbstring is deprecated

I'm getting errors when using this plugin icw PHP 8.2:

Fatal error: Uncaught Whoops\Exception\ErrorException: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in .../starterkit.test/site/plugins/kirby3-ray/vendor/symfony/var-dumper/Dumper/HtmlDumper.php on line 963.

Probably related to symfony/symfony#44281 ?

Disable the global `ray()` function when not in debug mode

Looking at the ray docs, you can disable the ray() call as well, with ray()->disable() - https://spatie.be/docs/ray/v1/usage/framework-agnostic-php-project#enabling--disabling-ray

I think it would be nice to disable that as well with this plugin. The only question is how exactly:

  • we could add a hook after system.loadPlugins:after
  • we could just append it to the index.php file, something like:
if (!option('debug') || !option('genxne.kirby-ray.enabled')){ ray()->disable(); }

perhaps even other way (put it to your custom class?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.