composer update

This commit is contained in:
Manish Verma
2018-12-05 10:50:52 +05:30
parent 9eabcacfa7
commit 4addd1e9c6
3328 changed files with 156676 additions and 138988 deletions

View File

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

View File

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

View File

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

View File

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