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

Comments

Projects
None yet
@vicb
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

This comment has been minimized.

Show comment
Hide comment
@sstok

sstok Jan 21, 2014

Contributor

👍

Contributor

sstok commented Jan 21, 2014

👍

@lyrixx

This comment has been minimized.

Show comment
Hide comment
@lyrixx

lyrixx Jan 21, 2014

Member

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

Member

lyrixx commented Jan 21, 2014

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

@hason

This comment has been minimized.

Show comment
Hide comment
@hason

hason Jan 22, 2014

Contributor

👍
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

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

This comment has been minimized.

Show comment
Hide comment
@vicb

vicb Jan 22, 2014

Contributor

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

Contributor

vicb commented Jan 22, 2014

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

@hacfi

This comment has been minimized.

Show comment
Hide comment
@hacfi

hacfi Jan 22, 2014

Contributor

@vicb Great idea..really cool stuff :)

Contributor

hacfi commented Jan 22, 2014

@vicb Great idea..really cool stuff :)

@benglass

This comment has been minimized.

Show comment
Hide comment
@benglass

benglass Jan 24, 2014

👍 great idea

benglass commented Jan 24, 2014

👍 great idea

@lyrixx

This comment has been minimized.

Show comment
Hide comment
@lyrixx

lyrixx Jan 24, 2014

Member

We are on it ;)

Member

lyrixx commented Jan 24, 2014

We are on it ;)

@breerly

This comment has been minimized.

Show comment
Hide comment
@breerly

breerly Jan 26, 2014

Contributor

huge ass 👍

Contributor

breerly commented Jan 26, 2014

huge ass 👍

@breerly

This comment has been minimized.

Show comment
Hide comment
@breerly

breerly Jan 26, 2014

Contributor

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

Contributor

breerly commented Jan 26, 2014

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

@lmammino

This comment has been minimized.

Show comment
Hide comment
@lmammino

lmammino Jan 31, 2014

Contributor

seems cool 👌

Contributor

lmammino commented Jan 31, 2014

seems cool 👌

@hason

This comment has been minimized.

Show comment
Hide comment
@hason

hason Feb 25, 2014

Contributor

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

Contributor

hason commented Feb 25, 2014

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

@lyrixx

This comment has been minimized.

Show comment
Hide comment
@lyrixx

lyrixx Feb 25, 2014

Member

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 / ...
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 referenced this issue Feb 25, 2014

Closed

REPL #42

@varas

This comment has been minimized.

Show comment
Hide comment
@varas

varas 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

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

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow May 12, 2014

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

Contributor

bobthecow commented May 12, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@lyrixx

lyrixx May 12, 2014

Member

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.
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

This comment has been minimized.

Show comment
Hide comment
@varas

varas May 12, 2014

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

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

This comment has been minimized.

Show comment
Hide comment
@Markcial

Markcial Jan 26, 2015

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

Markcial commented Jan 26, 2015

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

@lyrixx

This comment has been minimized.

Show comment
Hide comment
@lyrixx

lyrixx Feb 2, 2015

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@fabpot

fabpot Oct 5, 2015

Member

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

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 Oct 5, 2015

@aar0nr

This comment has been minimized.

Show comment
Hide comment
@aar0nr

aar0nr Mar 30, 2016

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

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