composer update
This commit is contained in:
@@ -28,7 +28,7 @@ class CsvFileDumper extends FileDumper
|
||||
*/
|
||||
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
||||
{
|
||||
$handle = fopen('php://memory', 'rb+');
|
||||
$handle = fopen('php://memory', 'r+b');
|
||||
|
||||
foreach ($messages->all($domain) as $source => $target) {
|
||||
fputcsv($handle, array($source, $target), $this->delimiter, $this->enclosure);
|
||||
|
23
vendor/symfony/translation/Dumper/FileDumper.php
vendored
23
vendor/symfony/translation/Dumper/FileDumper.php
vendored
@@ -45,7 +45,7 @@ abstract class FileDumper implements DumperInterface
|
||||
/**
|
||||
* Sets backup flag.
|
||||
*
|
||||
* @param bool
|
||||
* @param bool $backup
|
||||
*
|
||||
* @deprecated since Symfony 4.1
|
||||
*/
|
||||
@@ -76,7 +76,26 @@ abstract class FileDumper implements DumperInterface
|
||||
throw new RuntimeException(sprintf('Unable to create directory "%s".', $directory));
|
||||
}
|
||||
}
|
||||
// save file
|
||||
|
||||
$intlDomain = $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX;
|
||||
$intlMessages = $messages->all($intlDomain);
|
||||
|
||||
if ($intlMessages) {
|
||||
$intlPath = $options['path'].'/'.$this->getRelativePath($intlDomain, $messages->getLocale());
|
||||
file_put_contents($intlPath, $this->formatCatalogue($messages, $intlDomain, $options));
|
||||
|
||||
$messages->replace(array(), $intlDomain);
|
||||
|
||||
try {
|
||||
if ($messages->all($domain)) {
|
||||
file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options));
|
||||
}
|
||||
continue;
|
||||
} finally {
|
||||
$messages->replace($intlMessages, $intlDomain);
|
||||
}
|
||||
}
|
||||
|
||||
file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options));
|
||||
}
|
||||
}
|
||||
|
@@ -25,11 +25,7 @@ class JsonFileDumper extends FileDumper
|
||||
*/
|
||||
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
||||
{
|
||||
if (isset($options['json_encoding'])) {
|
||||
$flags = $options['json_encoding'];
|
||||
} else {
|
||||
$flags = JSON_PRETTY_PRINT;
|
||||
}
|
||||
$flags = $options['json_encoding'] ?? JSON_PRETTY_PRINT;
|
||||
|
||||
return json_encode($messages->all($domain), $flags);
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ class MoFileDumper extends FileDumper
|
||||
.$this->writeLong($offset[2] + $sourcesStart + $sourcesSize);
|
||||
}
|
||||
|
||||
$output = implode(array_map(array($this, 'writeLong'), $header))
|
||||
$output = implode('', array_map(array($this, 'writeLong'), $header))
|
||||
.$sourceOffsets
|
||||
.$targetOffsets
|
||||
.$sources
|
||||
|
Reference in New Issue
Block a user