Git Product home page Git Product logo

Comments (12)

dg avatar dg commented on May 20, 2024

Is syntax error in file, where is also Debugger::enable()?

from tracy.

DaneEveritt avatar DaneEveritt commented on May 20, 2024

The syntax error is in a different file, but the debugger code is included on the pages.

from tracy.

dg avatar dg commented on May 20, 2024

The point is: are you sure that Debugger::enable() is called?

from tracy.

DaneEveritt avatar DaneEveritt commented on May 20, 2024

Yeah, the code is here: https://github.com/DaneEveritt/PufferPanel/blob/master/src/framework/framework.core.php#L40

It works fine if an exception is thrown, but for syntax errors and stuff it doesn't do anything.

from tracy.

JanTvrdik avatar JanTvrdik commented on May 20, 2024

@DaneEveritt The problem is that you include framework.core.php (which contains Debugger::enable()) from a file which contains a syntax error, therefore the file is never executed, therefore the include is never executed and finally therefore Debugger::enable() is not called.

from tracy.

DaneEveritt avatar DaneEveritt commented on May 20, 2024

@JanTvrdik I tried to get tracy to work correctly with an error, this is the code from my test file:

<?php 

require_once('../vendor/autoload.php');

use Tracy\Debugger;
Debugger::enable(Debugger::DETECT);
Debugger::$strictMode = TRUE;


echo "hello"
echo "something else"
?>

This error was thrown:

[06-May-2014 12:04:37 America/New_York] PHP Parse error:  syntax error, unexpected 'echo' (T_ECHO), expecting ',' or ';' in test.php on line 11

However, tracy did not display any error page or do anything.

from tracy.

dg avatar dg commented on May 20, 2024

Again:

  • file contains a syntax error
  • therefore the file is never executed
  • therefore Debugger::enable() is not called

Tracy shows parse errors, but in your example Tracy was not enabled.

from tracy.

DaneEveritt avatar DaneEveritt commented on May 20, 2024

Oh I understand now, sorry about that.

So if I include a file with a syntax error into a file that has tracy enabled it will work, just not the other way around.

from tracy.

fprochazka avatar fprochazka commented on May 20, 2024

@DaneEveritt exactly.

from tracy.

DaneEveritt avatar DaneEveritt commented on May 20, 2024

Time to figure out how to implement this in a way that can catch those in my code then. At least it works fine for exceptions which are the bigger problem, syntax errors don't usually make it past local development.

from tracy.

dg avatar dg commented on May 20, 2024

Try to run Tracy as soon as possible, in first script.

from tracy.

DaneEveritt avatar DaneEveritt commented on May 20, 2024

The problem is that the way I am running it won't catch the syntax errors because I included it in the core file which is then included on all the pages. Based on the above responses I would need to be including all of the pages onto the core file for it to catch the errors, which isn't feasible.

from tracy.

Related Issues (20)

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.