Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d177747

Browse files
committed
feature #18290 [Translation] deprecate the backup feature (xabbuh)
This PR was merged into the 3.1-dev branch. Discussion ---------- [Translation] deprecate the backup feature | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #16912 (comment) | License | MIT | Doc PR | Commits ------- 6c3ddf1 [Translation] deprecate the backup feature
2 parents b03d370 + 6c3ddf1 commit d177747

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

UPGRADE-3.1.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ Serializer
7272
deprecated and will not be supported in Symfony 4.0. You should use the
7373
`CacheClassMetadataFactory` class instead.
7474

75+
Translation
76+
-----------
77+
78+
* Deprecated the backup feature of the file dumper classes. It will be removed
79+
in Symfony 4.0.
80+
7581
Yaml
7682
----
7783

UPGRADE-4.0.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ Serializer
6868
class has been removed. You should use the `CacheClassMetadataFactory` class
6969
instead.
7070

71+
Translation
72+
-----------
73+
74+
* Removed the backup feature from the file dumper classes.
75+
7176
Yaml
7277
----
7378

src/Symfony/Component/Translation/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
3.1.0
5+
-----
6+
7+
* Deprecated the backup feature of the file dumper classes.
8+
49
3.0.0
510
-----
611

src/Symfony/Component/Translation/Dumper/FileDumper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function dump(MessageCatalogue $messages, $options = array())
7373
$fullpath = $options['path'].'/'.$this->getRelativePath($domain, $messages->getLocale());
7474
if (file_exists($fullpath)) {
7575
if ($this->backup) {
76+
@trigger_error('Creating a backup while dumping a message catalogue is deprecated since version 3.1 and will be removed in 4.0. Use TranslationWriter::disableBackup() to disable the backup.', E_USER_DEPRECATED);
7677
copy($fullpath, $fullpath.'~');
7778
}
7879
} else {

src/Symfony/Component/Translation/Tests/Dumper/FileDumperTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public function testDump()
2929
$this->assertTrue(file_exists($tempDir.'/messages.en.concrete'));
3030
}
3131

32+
/**
33+
* @group legacy
34+
*/
3235
public function testDumpBackupsFileIfExisting()
3336
{
3437
$tempDir = sys_get_temp_dir();

0 commit comments

Comments
 (0)