Skip to content
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

Use DI for cookie config #12699

Closed
wants to merge 2 commits into from
Closed

Use DI for cookie config #12699

wants to merge 2 commits into from

Conversation

timkelty
Copy link
Contributor

@timkelty timkelty commented Feb 18, 2023

Instead of requiring the passing around of a common cookie config, we should use Yii's DI container to load our cookie config anywhere \yii\web\Cookie is instantiated.

Related: craftcms/commerce#3091

@timkelty timkelty requested review from benjamindavid and a team as code owners February 18, 2023 04:17
@timkelty timkelty changed the base branch from develop to 4.4 February 18, 2023 04:19
@timkelty timkelty requested review from brandonkelly and removed request for benjamindavid February 18, 2023 04:19
bootstrap/bootstrap.php Show resolved Hide resolved
src/Craft.php Show resolved Hide resolved
\yii\web\Cookie::class => \Craft::cookieConfig()
]);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it can be shared between app and test bootstraps.

foreach ($cookieConfig as $property => $value) {
$this->assertEquals($cookie->$property, $value);
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea where this test should go…so I put it here for now.

@brandonkelly brandonkelly changed the base branch from 4.4 to 5.0 February 20, 2023 20:33
@brandonkelly brandonkelly deleted the use-cookie-di branch January 23, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants