diff --git a/UPGRADE-3.1.md b/UPGRADE-3.1.md index bdaa959b6be47..a2c495b40001a 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 cc5d789a313ad..d5e2dcd0fa04b 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 b011f9e6cc783..4c272a3b2342f 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 9c9a8eeb57783..4228741270ddf 100644 --- a/src/Symfony/Component/Translation/Dumper/FileDumper.php +++ b/src/Symfony/Component/Translation/Dumper/FileDumper.php @@ -73,6 +73,7 @@ public function dump(MessageCatalogue $messages, $options = array()) $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 ed58546dd3f24..eb733df9456f7 100644 --- a/src/Symfony/Component/Translation/Tests/Dumper/FileDumperTest.php +++ b/src/Symfony/Component/Translation/Tests/Dumper/FileDumperTest.php @@ -29,6 +29,9 @@ public function testDump() $this->assertTrue(file_exists($tempDir.'/messages.en.concrete')); } + /** + * @group legacy + */ public function testDumpBackupsFileIfExisting() { $tempDir = sys_get_temp_dir();