Skip to content
Snippets Groups Projects
Commit f992e5f7 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch 'synoptic-bug' into 'development'

Synoptic bug

See merge request !908
parents 48c87dbd 8f4da1fb
No related branches found
No related tags found
1 merge request!1365Resolve "Filter Options for MetaGer"
...@@ -335,22 +335,29 @@ class MailController extends Controller ...@@ -335,22 +335,29 @@ class MailController extends Controller
return redirect(url('synoptic', ['exclude' => $exclude])); return redirect(url('synoptic', ['exclude' => $exclude]));
} }
$zip = new ZipArchive();
if ($zip->open("langfiles.zip", ZipArchive::OVERWRITE)!==TRUE) { if(file_exists("langfiles.zip"))
} else if ($zip->open("langfiles.zip", ZipArchive::CREATE)!==TRUE) { unlink("langfiles.zip");
exit("Cannot open".$filename);
} $zip = new ZipArchive();
if ($zip->open("langfiles.zip", ZipArchive::CREATE) !== TRUE) {
exit("Cannot open ".$filename);
}
try{
#Erstelle Ausgabedateien #Erstelle Ausgabedateien
foreach($data as $lang => $entries) { foreach($data as $lang => $entries) {
$output = json_encode($entries, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $output = json_encode($entries, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
$output = preg_replace("/\{/si", "[", $output); $output = preg_replace("/\{/si", "[", $output);
$output = preg_replace("/\}/si", "]", $output); $output = preg_replace("/\}/si", "]", $output);
$output = preg_replace("/\": ([\"\[])/si", "\"\t=>\t$1", $output); $output = preg_replace("/\": ([\"\[])/si", "\"\t=>\t$1", $output);
$output = "<?php\n\nreturn $output;\n"; $output = "<?php\n\nreturn $output;\n";
$zip->addEmptyDir($lang); $zip->addEmptyDir($lang);
$zip->addFromString($lang."/".$filename, $output); $zip->addFromString($lang."/".$filename, $output);
}
} catch(ErrorException $e) {
exit("Failed to write ".$filename);
} }
$zip->close(); $zip->close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment