Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Integrate PsySH in dev mode #10094

Closed
vicb opened this issue Jan 21, 2014 · 20 comments
Closed

[Feature] Integrate PsySH in dev mode #10094

vicb opened this issue Jan 21, 2014 · 20 comments

Comments

@vicb
Copy link
Contributor

vicb commented Jan 21, 2014

It would be great to be able to debug exception in dev mode with PsySH.

I've not yet look at the details and how hard this could be but using a REPL to debug misbehaved code is something really useful - This is something avaiable in the Python Pylons framework.

/cc @bobthecow

@sstok
Copy link
Contributor

sstok commented Jan 21, 2014

👍

@lyrixx
Copy link
Member

lyrixx commented Jan 21, 2014

There is this one too: https://github.com/d11wtq/boris

@hason
Copy link
Contributor

hason commented Jan 22, 2014

👍
We can use websocket as in experimental implementation for the Tracy nette/tracy@59d9c81 - see in action http://vimeo.com/72138480

@lyrixx PsySH also works on windows

@vicb
Copy link
Contributor Author

vicb commented Jan 22, 2014

@hason The video shows exactly what I was thinking about, would be great to investigate more.

@hacfi
Copy link
Contributor

hacfi commented Jan 22, 2014

@vicb Great idea..really cool stuff :)

@benglass
Copy link

👍 great idea

@lyrixx
Copy link
Member

lyrixx commented Jan 24, 2014

We are on it ;)

@HelloGrayson
Copy link

huge ass 👍

@HelloGrayson
Copy link

Not completely positive, but isn't PHPDGB going to be included in PHP 5.6? Perhaps we should look in that direction...

@lmammino
Copy link

seems cool 👌

@hason
Copy link
Contributor

hason commented Feb 25, 2014

An another example of using websockets https://github.com/Hywan/PHP-live-execution

@lyrixx
Copy link
Member

lyrixx commented Feb 25, 2014

So I have tried lot of things:

  • Open a debugger (REPL) when an error occurs. It is nice, but does not work with exceptions and fatal error => not so useful
  • Add a kind on breakpoint function: When the user call it, the execution is stopped. Then it is possible to view / edit current scope. But this is not easy to setup because it need 2 tabs or 2 browser. I also tried to inline the form (text-area) in the first page, but it is not so easy because of different buffers of php / nginx / ...

@hason hason mentioned this issue Feb 25, 2014
@varas
Copy link

varas commented May 11, 2014

I use both PsySh and Symfony. PsySH is based upon Symfony/Command and i usually get conflicts when the component version that uses is different than the one on PsySh. It would be great to integrate both and solve this.

Even more funnier if a repl is open as a debug option. @lyrixx you could capture exceptions changing the handler, and even some errors. I made a proof of concept here https://github.com/varas/errepl

@bobthecow
Copy link
Contributor

@varas If you add PsySH to your symfony project's composer.json then do composer update, it'll figure out a version of symfony and psysh that work together and you won't have any conflicts :)

@lyrixx
Copy link
Member

lyrixx commented May 12, 2014

Sorry, I did not take time to comment this topic.
We have tried to add a REPL when an exception is found but it's not so nice:

  • PHP context is available only when a PHP error occur (not an exception)
  • the worflow to maintain a REPL while PHP is dying is hard to understand and very hard to maintain because there is lot of edge case.
  • acutally, the REPL is not so useful when an exception happen.

@varas
Copy link

varas commented May 12, 2014

Thanks @bobthecow i'm used to include require-dev's from global, but that seems to be more convenient.

@Markcial
Copy link

ping! any code samples, updates or a project started on this, should i work from scratch?

@lyrixx
Copy link
Member

lyrixx commented Feb 2, 2015

All my code is a very quick & dirty code.

But you can have a look to: https://github.com/dpb587/ti-debug which is a good start.

@fabpot
Copy link
Member

fabpot commented Oct 5, 2015

Looks like it's not that easy. If anyone can create a PR, that would be great; closing this issue in the meantime.

@fabpot fabpot closed this as completed Oct 5, 2015
@aar0nr
Copy link

aar0nr commented Mar 30, 2016

If you're looking for a simple CLI for the container, kernel, and parameters, check out https://github.com/theofidry/PsyshBundle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests