diff --git a/UPGRADE-3.1.md b/UPGRADE-3.1.md index bdaa959b6b..a2c495b400 100644 --- a/UPGRADE-3.1.md +++ b/UPGRADE-3.1.md @@ -72,6 +72,12 @@ Serializer deprecated and will not be supported in Symfony 4.0. You should use the `CacheClassMetadataFactory` class instead. +Translation +----------- + + * Deprecated the backup feature of the file dumper classes. It will be removed + in Symfony 4.0. + Yaml ---- diff --git a/UPGRADE-4.0.md b/UPGRADE-4.0.md index cc5d789a31..d5e2dcd0fa 100644 --- a/UPGRADE-4.0.md +++ b/UPGRADE-4.0.md @@ -68,6 +68,11 @@ Serializer class has been removed. You should use the `CacheClassMetadataFactory` class instead. +Translation +----------- + + * Removed the backup feature from the file dumper classes. + Yaml ---- diff --git a/src/Symfony/Component/Translation/CHANGELOG.md b/src/Symfony/Component/Translation/CHANGELOG.md index b011f9e6cc..4c272a3b23 100644 --- a/src/Symfony/Component/Translation/CHANGELOG.md +++ b/src/Symfony/Component/Translation/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +3.1.0 +----- + + * Deprecated the backup feature of the file dumper classes. + 3.0.0 ----- diff --git a/src/Symfony/Component/Translation/Dumper/FileDumper.php b/src/Symfony/Component/Translation/Dumper/FileDumper.php index 9c9a8eeb57..4228741270 100644 --- a/src/Symfony/Component/Translation/Dumper/FileDumper.php +++ b/src/Symfony/Component/Translation/Dumper/FileDumper.php @@ -73,6 +73,7 @@ abstract class FileDumper implements DumperInterface $fullpath = $options['path'].'/'.$this->getRelativePath($domain, $messages->getLocale()); if (file_exists($fullpath)) { if ($this->backup) { + @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); copy($fullpath, $fullpath.'~'); } } else { diff --git a/src/Symfony/Component/Translation/Tests/Dumper/FileDumperTest.php b/src/Symfony/Component/Translation/Tests/Dumper/FileDumperTest.php index ed58546dd3..eb733df945 100644 --- a/src/Symfony/Component/Translation/Tests/Dumper/FileDumperTest.php +++ b/src/Symfony/Component/Translation/Tests/Dumper/FileDumperTest.php @@ -29,6 +29,9 @@ class FileDumperTest extends \PHPUnit_Framework_TestCase $this->assertTrue(file_exists($tempDir.'/messages.en.concrete')); } + /** + * @group legacy + */ public function testDumpBackupsFileIfExisting() { $tempDir = sys_get_temp_dir();