Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] Deprecate usage of getRootDir() and kernel.root_dir#28810
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| * @param string $charset The charset | ||
| */ | ||
| publicfunction__construct($fileLinkFormat,string$rootDir,string$charset) | ||
| publicfunction__construct($fileLinkFormat,string$projectDir,string$charset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We already injectkernel.project_dir in the container definition.
799ef32 to086826eCompareogizanagi commentedOct 10, 2018
You meant - Remove internal usage of kernel.project_dir when possible+ Remove internal usage of kernel.root_dir when possible |
fabpot commentedOct 10, 2018
indeed, fixed |
| * @deprecated since Symfony 4.2 | ||
| */ | ||
| protected$rootDir; | ||
| protected$projectDir; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
should the new property be private instead ? I don't think it needs to be an extension point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
of course, done
| returnarray( | ||
| /** | ||
| * @deprecated since Symfony 3.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
version looks wrong (otherwise, it would already be gone in 4.0).
And for that one, being able to warn when using the parameter looks useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
version is the right one, it was deprecated in 3.3, but we did not add the deprecation notice and didn't find time/energy/way to make it before 4.0. I can change to 4.2, no big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Moved to 4.2.
d8188bc to78416adComparefabpot commentedOct 10, 2018
Ok, now with the deprecation of the |
| publicfunctiongetCacheDir() | ||
| { | ||
| return$this->rootDir.'/cache/'.$this->environment; | ||
| return$this->getProjectDir().'/var/cache/'.$this->environment; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is the default value in the Symfony Flex recipe.
| publicfunctiongetLogDir() | ||
| { | ||
| return$this->rootDir.'/logs'; | ||
| return$this->getProjectDir().'/var/log'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is the default value in the Symfony Flex recipe.
src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
ro0NL left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
fixes#24293
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
11c7519 toefffda4Compare
ro0NL left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
UPGRADE files need to be updated
given the parameters are not deprecated in code (trigger error) i suggest a mention to manually search your code base
for UPGRADE-5.0 these should be listed as BC break (preferably put on top)
Uh oh!
There was an error while loading.Please reload this page.
ro0NL commentedOct 16, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@fabpot can you clarify why deprecating Do you aim to rename KernelInterface::getRootDir() to getProjectDir() on the interface? edit: wait.. in 5.0 |
fabpot commentedOct 16, 2018
@ro0NL It's more pragmatic than that :) As we are using |
chalasr commentedOct 16, 2018
IIRC the debug component mutes deprecations from the same vendor so implementing getRootDir() should keep the core deprecation free.@nicolas-grekas am I wrong? |
ro0NL commentedOct 16, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
i was assuming the same yes :)
should we actually consider this? Does it make sense? We could benefit from it, as we cant add But then we need to decide what's the purpose of |
nicolas-grekas commentedOct 16, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I don't think so - that would prevent detecting when we use our own internal deprecated code actually.
no way, as you spotted :) in fact,
how will this be implemented in 5.0? |
fabpot commentedOct 16, 2018
The |
nicolas-grekas commentedOct 16, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This means we need to trigger a deprecation whenever these dirs contain anything that we load currently, right? |
fabpot commentedOct 16, 2018
It was not possible in 3.4, but we can definitely do it in 4.2. |
yceruto commentedOct 16, 2018
We talking about these directories |
chalasr commentedOct 16, 2018
@yceruto I already started the work for translation commands locally :) |
…() (nicolas-grekas)This PR was merged into the 4.2-dev branch.Discussion----------[HttpKernel] fix deprecating KernelInterface::getRootDir()| Q | A| ------------- | ---| Branch? | 4.2| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Follow up of#28810.Did I get it right?Commits-------819f525 [HttpKernel] fix deprecating KernelInterface::getRootDir()
…directories (yceruto)This PR was merged into the 4.2-dev branch.Discussion----------[TwigBundle] Deprecating support for legacy templates directories| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR |symfony/symfony-docs#10500go ahead with#28810 (comment)- [x] Fix testsCommits-------8b390f3 Deprecating support for legacy templates directories
…lations directory (yceruto)This PR was merged into the 4.2-dev branch.Discussion----------[FrameworkBundle] Deprecating support for legacy translations directory| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets |#28810 (comment)| License | MIT| Doc PR | TODOCommits-------acdece7 Deprecating support for legacy translations directory
This PR was merged into the 4.2-dev branch.Discussion----------[HttpKernel] Fix BC break in Kernel name| Q | A| ------------- | ---| Branch? | master| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |Fix a BC break introduced by#28810 where the name of the kernel where change form the name of the folder containing the kernel class to the name of the folder containing the project.This introduced a bug with deployment processes where the cache warmup is done before moving the application to a folder with a different name and removing the possibility to compile the container (either by moving to a read-only filesystem or by removing the config directory).Commits-------872a772 Fix BC break in Kernel name
…sys)This PR was submitted for the master branch but it was merged into the 4.2 branch instead (closes#11299).Discussion----------[Flex] Tell that `var/logs/` directory was renamedRef:symfony/symfony#28810 (comment)Commits-------2fcd9bc [Flex] Tell that `var/logs/` directory was renamed
…adzki)This PR was submitted for the 5.0 branch but it was squashed and merged into the 4.3 branch instead (closes#12719).Discussion----------[minor] remove usage of Kernel::$rootDir from docsAs persymfony/symfony#28810 $rootDir has been removed in 5.0 - use getProjectDir in docs instead - small change to be consistentCommits-------9da96e1 [minor] remove usage of Kernel::$rootDir from docs
Uh oh!
There was an error while loading.Please reload this page.