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

Application configuration in debug panel #7475

Closed
schmunk42 opened this issue Feb 26, 2015 · 16 comments
Closed

Application configuration in debug panel #7475

schmunk42 opened this issue Feb 26, 2015 · 16 comments

Comments

@schmunk42
Copy link
Contributor

Hi,

would you like to have the application configuration available in the debug module?
Similar to the screenshots below, but in the debug module...

bildschirmfoto 2015-02-26 um 18 45 05
bildschirmfoto 2015-02-26 um 18 45 18
bildschirmfoto 2015-02-26 um 18 45 36

If yes, let me know - I'd create a PR.
If not simply close this issue.

@samdark
Copy link
Member

samdark commented Feb 26, 2015

What's the use case for it?

@schmunk42
Copy link
Contributor Author

You'll know what's the app config in the end, after merging and populating with eg. ENV vars.

@samdark
Copy link
Member

samdark commented Feb 26, 2015

Hmm, makes sense. @yiisoft/core-developers thoughts?

@lynicidn
Copy link
Contributor

need validators for all components allow configure

@qiangxue
Copy link
Member

It's not always possible in case your config contains anonymous function.

@creocoder
Copy link
Contributor

@qiangxue Its rare case when config contains anonymous functions due to significant drawbacks with them. But in that case we just can write instance information.

@qiangxue
Copy link
Member

I'm just pointing out the possibility because when this happens, your app will crash.
Also, it may not be that rare especially if you want to hook up some event handlers in config.

@creocoder
Copy link
Contributor

@qiangxue I know we discussed that before about anonymous functions. But we do not touch events aspect... It probably would be interesting to look on http://laravel.com/docs/5.0/events#basic-usage. Event handlers as classes structured inside some directory. This allow to never use any anonymous inside configs since config always should be plain and support any storage formats (php, xml, yml). Also for example Laravel never require anonymous for registering any services since it use Service Providers concept for its own and any 3rd party libraries.

@qiangxue
Copy link
Member

This is nothing special. You can already use ['class', 'method'] to bind an event handler.

Anyway, I wasn't against this enhancement. I was just pointing out a possible problem that we should solve, because it is not acceptable that using debugger would affect the execution of the main app.

@schmunk42
Copy link
Contributor Author

@qiangxue This could be covered by a test case, I think.

But another thing is, how to access the application config other than using $GLOBALS['config']?

@mikehaertl
Copy link
Contributor

@schmunk42 If implemented, this should be optional. I'm not sure, how you would obtain the configuration (looping over all app components?) but it seems that it could easily break if you have some special setup in your app.

@schmunk42
Copy link
Contributor Author

There is already an application configuration section in the debug panel, but it's rather incomplete.

bildschirmfoto 2015-02-27 um 20 03 46

I'd suggest to add tabs to that view, like Request has

  • application configuration
  • installed extensions
  • PHP configuration (has a layout bug with my PHP 5.6 btw)

And for sure it should not break your application.

@samdark
Copy link
Member

samdark commented Feb 28, 2015

Great plan.

@schmunk42
Copy link
Contributor Author

Nice :)

So what's the best way to get the application config?

@samdark
Copy link
Member

samdark commented Feb 28, 2015

Probably via application constructor.

@yii-bot
Copy link

yii-bot commented Jan 24, 2016

Issue moved to yiisoft/yii2-debug#79

@yii-bot yii-bot closed this as completed Jan 24, 2016
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

8 participants