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

TracyExtension: Don't dispatch Debugger in a CLI #200

Merged
merged 1 commit into from Jun 20, 2016

Conversation

@hranicka
Copy link
Contributor

hranicka commented Jun 20, 2016

See #198

I've disabled Session/Debugger dispatching in for CLI SAPI.

It's needed only for Ajax.

@hranicka hranicka mentioned this pull request Jun 20, 2016
@dg

This comment has been minimized.

Copy link
Member

dg commented Jun 20, 2016

Thanks!

@hranicka

This comment has been minimized.

Copy link
Contributor Author

hranicka commented Jun 20, 2016

This is the simplest possible solution, thanks @dg for your mentoring.

@JanTvrdik

This comment has been minimized.

Copy link
Contributor

JanTvrdik commented Jun 20, 2016

PHP_SAPI is not part of DI container cache key. The condition should IMHO be evaluated in runtime.

@dg

This comment has been minimized.

Copy link
Member

dg commented Jun 20, 2016

It is "coincidentally" part of cache key, the question is whether make it official part of key, or modify implementation of extensions or leave it as is.

@hranicka

This comment has been minimized.

Copy link
Contributor Author

hranicka commented Jun 20, 2016

There is also a parameter consoleMode here.

Does it have any impact on it? It's a part part of DIC cache key.


I can change this PR something like:

$initialize->addBody('if (PHP_SAPI !== 'cli' && $tmp = $this->getByType("Nette\Http\Session", FALSE)) { $tmp->start(); Tracy\Debugger::dispatch(); };');

But it seems unclear to me, I'm not sure with it.

@JanTvrdik

This comment has been minimized.

Copy link
Contributor

JanTvrdik commented Jun 20, 2016

@dg I think that it should be possible to generate DI container for application from CLI.

@dg

This comment has been minimized.

Copy link
Member

dg commented Jun 20, 2016

It would actually be parameter for TracyExtension, like $debugMode .

@dg

This comment has been minimized.

Copy link
Member

dg commented Jun 20, 2016

@hranicka

This comment has been minimized.

Copy link
Contributor Author

hranicka commented Jun 20, 2016

Ok, I edit it.

I've tried use config parameters with %consoleMode% but I must add more code because of this magic.

Constructor parameters seems better.


And what about Nette\Http packages? There is also PHP_SAPI constant. Ah, you edited this right now. Thanks :)

@hranicka hranicka force-pushed the hranicka:hotfix/session-cli branch from 3bf9b11 to 916acb3 Jun 20, 2016
@dg

This comment has been minimized.

Copy link
Member

dg commented Jun 20, 2016

👍

@dg dg merged commit 6f89b71 into nette:master Jun 20, 2016
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@hranicka

This comment has been minimized.

Copy link
Contributor Author

hranicka commented Jun 20, 2016

I can prepare you PR into nette/bootstrap for your changes in nette/http and tracy. Give me a few minutes.

@dg

This comment has been minimized.

Copy link
Member

dg commented Jun 20, 2016

I have it finished.

@hranicka

This comment has been minimized.

Copy link
Contributor Author

hranicka commented Jun 20, 2016

Ok, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.