8000 [FrameworkBundle] Remove config deprecations by alexandre-daubois · Pull Request #51428 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Remove config deprecations #51428

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

Merged

Conversation

alexandre-daubois
Copy link
Member
Q A
Branch? 7.0
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR Todo

Follow-up of:

nicolas-grekas added a commit that referenced this pull request Aug 21, 2023
…session.save_path` and `framework.session.handler_id` at the same time (alexandre-daubois)

This PR was merged into the 6.4 branch.

Discussion
----------

[FrameworkBundle] Deprecate not setting both `framework.session.save_path` and `framework.session.handler_id` at the same time

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | -

This is the follow-up of #51428 (comment)

Commits
-------

85faa69 [FrameworkBundle] Deprecate not setting both `framework.session.save_path` and `framework.session.handler_id` at the same time
@alexandre-daubois alexandre-daubois force-pushed the options-default-values branch 2 times, most recently from e98b2db to 9a05727 Compare August 21, 2023 12:44
$v['session'] += [
'cookie_samesite' => null,
'handler_id' => 'session.handler.native_file',
'save_path' => '%kernel.cache_dir%/sessions',
Copy link
Member

Choose a reason for hiding this comment

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

when handler_id is non-null, save_path should still default to %kernel.cache_dir%/sessions, how can we deal with that?

Copy link
Member Author
@alexandre-daubois alexandre-daubois Aug 21, 2023

Choose a reason for hiding this comment

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

I updated the condition:

if (!\array_key_exists('handler_id', $v['session'])) {
    $v['session']['handler_id'] = $v['session']['save_path'] ? 'session.handler.native_file' : null;
} elseif (null !== $v['session']['handler_id']) {
    $v['session']['save_path'] ??= '%kernel.cache_dir%/sessions';
}

Also updated changelog to Make the framework.session.save_path config option default to %kernel.cache_dir%/sessions if framework.session.handler_id is set or null otherwise

Copy link
Member Author

Choose a reason for hiding this comment

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

I also added a call to info() to document this behavior

@alexandre-daubois alexandre-daubois force-pushed the options-default-values branch 3 times, most recently from cfaee6f to 0106c5b Compare August 21, 2023 13:24
@nicolas-grekas nicolas-grekas force-pushed the options-default-values branch from 0106c5b to 7935e94 Compare August 23, 2023 09:12
@alexandre-daubois
Copy link
Member Author
alexandre-daubois commented Aug 23, 2023

I'd say this PR should be merged before this one to fix the errors raised by AttributeLoader.

I fixed the Configuration.php file, thank you for the edits on it about default values

@alexandre-daubois alexandre-daubois force-pushed the options-default-values branch 2 times, most recently from 5ce5bac to d9c64ff Compare August 23, 2023 09:57
@nicolas-grekas nicolas-grekas force-pushed the options-default-values branch from d9c64ff to 4fe6f5b Compare August 23, 2023 10:40
@nicolas-grekas
Copy link
Member

Thank you @alexandre-daubois.

@nicolas-grekas nicolas-grekas merged commit 9b8f1e3 into symfony:7.0 Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0