[FrameworkBundle] config:dump-reference command can now dump current configuration#10165
[FrameworkBundle] config:dump-reference command can now dump current configuration#10165fabpot merged 1 commit intosymfony:masterfrom
Conversation
|
I'm -1 for such reflection-based hack. and I don't think it should be done by |
|
I implemented this feature in another command, but since 90% of the code is similar, I have merged it with the existing one. But I'm totally fine to create a new command. For the hack, I don't know how to achieve that without... I will look at. |
|
@lyrixx extracting the code retrieving the extension to a reusable place would be a better way to limit duplication than having the Regarding the hack, I don't think there is a non-hacky way to achieve this actually. You are trying to access to some temporary internal state of the builder, at a point where this state has already been lost |
|
Yes, there is no problem, I will create a new command. But for the hack part ... I'm open to suggestion. |
|
Adding XML support for this requires a lot more work than Yaml. I even think it'll be to complicated to put in the command, you should create an XML dumper. Maybe, you can reuse the XML reference dumper and convert that to a dumper that dumps the given configuration. Then the reference dumper just needs to build the default configuration and pass them to the XML dumper. If you don't want to do it, I'll create a PR for it after this get merged :) |
|
@wouterj the difference is that a reference dumper does not dump configuration, it dumps a node tree. So its input is totally different. I don't even think it makes sense to dump the configuration as XML. The processed configuration may not even be something which can be represented as XML in the format supported by the DI extension (because of all the transformation logic). And even if it could, it would involve reversing the normalizations done on the config, which cannot be done (have you ever tried to have an arbitrary callable and its output, and to find the input producing it again ? this is not something you want to do to dump the config). |
|
Any advice for the command name? |
|
config:debug ? (it's consistent with container:debug, router:debug, ...) |
|
done |
|
👍 |
There was a problem hiding this comment.
[...] does not have it's -> does not have its
|
@wouterj I fixed some issues. But, you know, almost all code you commented is code that I moved... |
Well, I didn't review the PR that introduced that code. :) And it's easier to include the fixes here, than doing it in a seperate PR. Thank you! |
|
I think it's ok now ;) |
|
I think this one is mergeable, except if someone has a way to avoid the reflection. |
|
+10 for the idea |
…w dump current configuration (lyrixx) This PR was merged into the 2.5-dev branch. Discussion ---------- [FrameworkBundle] config:dump-reference command can now dump current configuration | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | I guess | Fixed tickets | - | License | MIT | Doc PR | - I did not add `xml` support as I don't know how to do that. ping @stof sample: ```yaml framework: secret: ThisTokenIsNotSoSecretChangeIt router: resource: /home/greg/dev/labs/se/app/config/routing_dev.yml strict_requirements: true http_port: 80 https_port: 443 form: enabled: true csrf_protection: { enabled: null, field_name: null } csrf_protection: enabled: true field_name: _token validation: enable_annotations: true enabled: true translation_domain: validators templating: engines: [twig] assets_version: null assets_version_format: '%%s?%%s' hinclude_default_template: null form: { resources: ['FrameworkBundle:Form'] } assets_base_urls: { http: { }, ssl: { } } loaders: { } packages: { } default_locale: en trusted_hosts: { } trusted_proxies: { } session: storage_id: session.storage.native handler_id: session.handler.native_file save_path: /home/greg/dev/labs/se/app/cache/dev/sessions metadata_update_threshold: '0' fragments: enabled: true path: /_fragment http_method_override: true profiler: only_exceptions: false enabled: true collect: true only_master_requests: false dsn: 'file:/home/greg/dev/labs/se/app/cache/dev/profiler' username: '' password: '' lifetime: 86400 ide: null esi: enabled: false translator: enabled: false fallback: en annotations: cache: file file_cache_dir: /home/greg/dev/labs/se/app/cache/dev/annotations debug: true serializer: enabled: false ``` Commits ------- 19a368e [FramworkBundle] Added config:debug command
I did not add
xmlsupport as I don't know how to do that. ping @stofsample: