fix: use project_dir if available (Symfony 3+) #67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
kernel.root_diris deprecated since Symfony 4 and removed since Symfony 5.kernel.project_dirhas been introduced in Symfony 3.See also https://symfony.com/blog/new-in-symfony-3-3-a-simpler-way-to-get-the-project-root-directory.
In this PR, I tried to be compatible with Symfony 2 and Symfony 3+ by using a
phobetor_rabbitmq_supervisor.project_dirparameter set in the extension.The
phobetor_rabbitmq_supervisor.project_dirwill correspond to the path where thecomposer.jsonfile is, in all the cases.The defaults paths for the supervisor configuration will then be at the same place as the
composer.jsonfile.If you prefer to have the defaults paths in the
varfolder by default, please tell me.For information:
With Symfony 2 (not flex),
kernel.root_diris used and corresponds to theappdirectory.With Symfony 3+ (not flex),
kernel.root_diris also used and corresponds to theappdirectory.With Symfony 3+ (flex),
kernel.root_diris used and corresponds to thesrcdirectory.With Symfony 6 (flex),
kernel.project_diris used and corresponds to the directory where thecomposer.jsonfile is.