-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle][Translation] moved cache to Translation component #11197
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
Conversation
aitboudad
commented
Jun 21, 2014
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #10628 |
License | MIT |
@@ -75,68 +63,10 @@ public function getLocale() | |||
/** | |||
* {@inheritdoc} | |||
*/ | |||
protected function loadCatalogue($locale) | |||
protected function initializeCatalogue($locale) |
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.
as this method is protected, and not private, this should be considered as a BC break
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.
@romainneutron loadCatalogue
still exists in the parent class. The change here is simply which method gets extended in FrameworkBundle. So it is not a BC break
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.
that's right
This is nice, it would solve the issue I had in Silex silexphp/Silex#875 |
@@ -54,17 +55,24 @@ class Translator implements TranslatorInterface | |||
private $selector; | |||
|
|||
/** | |||
* @var array | |||
*/ | |||
private $options = array(); |
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.
these should be protected for BC (they are protected in the FrameworkBundle translator currently)
👍 |
Awesome 👍 could this be introduced in |
@rvanlaak If this PR is merged, it would be in master (2.6-dev), as new features are not added in stable banches (see http://symfony.com/doc/current/contributing/code/patches.html#choose-the-right-branch). |
* | ||
* @api | ||
*/ | ||
public function __construct($locale, MessageSelector $selector = null) | ||
public function __construct($locale, MessageSelector $selector = null, array $options = array()) |
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.
Passing an array of options looks wrong to me.
Closing in favor of #11373 |
…ion component (new PR) (aitboudad, OwlyCode) This PR was merged into the 2.6-dev branch. Discussion ---------- [FrameworkBundle][Translation] moved cache to Translation component (new PR) | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #10628 | License | MIT | Doc PR | This supersedes the PR #11197 (while including the changes made by it). I removed the `$options` argument for `Symfony\Component\Translation\Translator` and replaced it by a public method `enableCache($cacheDir, $debug = false)`. It aims to solve what @fabpot said about passing an array of options in #11197 <s>while not modifying the existing constructors</s>. Commits ------- 30fed6a [Translation][Cache] Removed the options from the arguments of Translator 8b2d9a8 [FrameworkBundle][Translation] moved cache to Translation component