[Translation] deprecate the backup feature

This commit is contained in:
Christian Flothmann 2016-03-24 10:23:20 +01:00
parent b03d370be0
commit 6c3ddf1d88
5 changed files with 20 additions and 0 deletions

View File

@ -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
----

View File

@ -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
----

View File

@ -1,6 +1,11 @@
CHANGELOG
=========
3.1.0
-----
* Deprecated the backup feature of the file dumper classes.
3.0.0
-----

View File

@ -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 {

View File

@ -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();