Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] Deprecate the Kernel name#28809

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

Merged
fabpot merged 1 commit intosymfony:masterfromfabpot:kernel-name
Oct 15, 2018

Conversation

@fabpot
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets#26904
LicenseMIT
Doc PRn/a

ro0NL reacted with thumbs up emoji
protectedfunctiongetContainerClass()
{
return$this->name.ucfirst($this->environment).($this->debug ?'Debug' :'').'ProjectContainer';
return'app'.ucfirst($this->environment).($this->debug ?'Debug' :'').'ProjectContainer';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

shouldn't we keep using it for now, for BC ? Otherwise, it would be a BC break for people using multiple kernels (with different names) and expecting to have the container classes not clashing together.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You mean when a multi-kernel app share the same cache?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think this is worth it. As of Symfony 4.x, we are only supporting Flex (so, doing it in 3.4 was not possible, but I think this is totally legitimate now).

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ok, is it better now?

@fabpotfabpotforce-pushed thekernel-name branch 3 times, most recently fromce81b5b to59048e2CompareOctober 10, 2018 16:20
protectedfunctiongetContainerClass()
{
return$this->name.ucfirst($this->environment).($this->debug ?'Debug' :'').'ProjectContainer';
return'app'.md5(get_class($this)).ucfirst($this->environment).($this->debug ?'Debug' :'').'ProjectContainer';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Could this potentially break existing applications with multiple kernels?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

How? Each Kernel class must have a different FQCN anyway, so it's still unique.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Having additional arguments in the application kernel class that are different for each instance does work too, doesn't it?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It can work, but this won't break with my change as in this case, the cache cannot be shared between apps (today already).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This will break apps rely on the kernel name to create "virtual" kernels. For example, I've some projects based on this ideahttps://github.com/yceruto/symfony-skeleton-vkernel.

I don't know whether this practice is right or not, but it simplify our projects sharing vendors, config and src. It work well thank to the kernel name and just one Kernel class.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Then, you need to override thegetContainerClass().

@xabbuh
Copy link
Member

tests are failing

@fabpot
Copy link
MemberAuthor

Tests fixed

@fabpotfabpot merged commit98ff750 intosymfony:masterOct 15, 2018
fabpot added a commit that referenced this pull requestOct 15, 2018
This PR was merged into the 4.2-dev branch.Discussion----------[HttpKernel] Deprecate the Kernel name| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets |#26904| License       | MIT| Doc PR        | n/a<!--Write a short README entry for your feature/bugfix here (replace this comment block.)This will help people understand your PR and can be used as a start of the Doc PR.Additionally: - Bug fixes must be submitted against the lowest branch where they apply   (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch.-->Commits-------98ff750 [HttpKernel] deprecated the Kernel name
protectedfunctiongetContainerClass()
{
return$this->name.ucfirst($this->environment).($this->debug ?'Debug' :'').'ProjectContainer';
returnstr_replace('\\','_',\get_class($this)).ucfirst($this->environment).($this->debug ?'Debug' :'').'Container';
Copy link
Member

@nicolas-grekasnicolas-grekasOct 16, 2018
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This change breaks BC by removing the "name" (the basename of the project_dir really) from the dimensions that compose separate namespaces.
This is why the CI is red (and was also caught before merging ;) )
Side note: the container class is also a legacy concept; its real name is random (it's the hash of its contents actually.)
The only real remaining use case of the container class is for generating thename of the file that serves as entry point for loading the container.

fabpot added a commit that referenced this pull requestOct 16, 2018
This PR was merged into the 4.2-dev branch.Discussion----------[HttpKernel] fix kernel.name deprecation| Q             | A| ------------- | ---| Branch?       | 4.2| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -Finishes#28809 and makes tests green again.Commits-------4964ffc [HttpKernel] fix kernel.name deprecation
nicolas-grekas added a commit that referenced this pull requestOct 23, 2018
This PR was squashed before being merged into the 4.2-dev branch (closes#28939).Discussion----------[WebProfilerBundle] Remove application name| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | yes| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | yes| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->This fixes a regression in master, i think after#28809 (or something related)There's still a "application name" concept out there today, and it's `ConfigDataCollector::getApplicationName()` 🤔In my case the service resolved to```php$e = new \Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector(\basename('/app'));```Causing the app name to be, well, `app` (again :P). It was really confusing.Before:![image](https://user-images.githubusercontent.com/1047696/47264761-fcb01980-d51c-11e8-9a3b-14a43d18b179.png)(the "a" is from "app" here)After:![image](https://user-images.githubusercontent.com/1047696/47264767-16516100-d51d-11e8-8a5d-4c20d4911861.png)or![image](https://user-images.githubusercontent.com/1047696/47264774-28cb9a80-d51d-11e8-8fe6-de0f46b06a1d.png)I think we need to deprecate the argument for real?cc@fabpotCommits-------f5c355e [WebProfilerBundle] Remove application name
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
This was referencedNov 3, 2018
@fabpotfabpot deleted the kernel-name branchJanuary 14, 2019 11:01
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@stofstofstof left review comments

@xabbuhxabbuhxabbuh left review comments

@ycerutoycerutoyceruto left review comments

@OskarStarkOskarStarkOskarStark approved these changes

+1 more reviewer

@TobionTobionTobion approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

9 participants

@fabpot@xabbuh@javiereguiluz@nicolas-grekas@stof@Tobion@OskarStark@yceruto@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp