Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Commits
b7db2094
Commit
b7db2094
authored
7 years ago
by
Aria Givi
Browse files
Options
Downloads
Patches
Plain Diff
Fehler beim Öffnen der Zip, Ursache unbekannt
parent
29ca3d0d
No related branches found
Branches containing commit
No related tags found
2 merge requests
!912
Development
,
!908
Synoptic bug
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/Http/Controllers/MailController.php
+20
-13
20 additions, 13 deletions
app/Http/Controllers/MailController.php
with
20 additions
and
13 deletions
app/Http/Controllers/MailController.php
+
20
−
13
View file @
b7db2094
...
...
@@ -335,22 +335,29 @@ class MailController extends Controller
return
redirect
(
url
(
'synoptic'
,
[
'exclude'
=>
$exclude
]));
}
$zip
=
new
ZipArchive
();
if
(
$zip
->
open
(
"langfiles.zip"
,
ZipArchive
::
OVERWRITE
)
!==
TRUE
)
{
}
else
if
(
$zip
->
open
(
"langfiles.zip"
,
ZipArchive
::
CREATE
)
!==
TRUE
)
{
exit
(
"Cannot open"
.
$filename
);
}
if
(
file_exists
(
"langfiles.zip"
))
unlink
(
"langfiles.zip"
);
$zip
=
new
ZipArchive
();
if
(
$zip
->
open
(
"langfiles.zip"
,
ZipArchive
::
CREATE
))
{
exit
(
"Cannot open "
.
$filename
);
}
try
{
#Erstelle Ausgabedateien
foreach
(
$data
as
$lang
=>
$entries
)
{
$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"
,
"
\"\t
=>
\t
$1"
,
$output
);
$output
=
"<?php
\n\n
return
$output
;
\n
"
;
$zip
->
addEmptyDir
(
$lang
);
$zip
->
addFromString
(
$lang
.
"/"
.
$filename
,
$output
);
foreach
(
$data
as
$lang
=>
$entries
)
{
$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"
,
"
\"\t
=>
\t
$1"
,
$output
);
$output
=
"<?php
\n\n
return
$output
;
\n
"
;
$zip
->
addEmptyDir
(
$lang
);
$zip
->
addFromString
(
$lang
.
"/"
.
$filename
,
$output
);
}
}
catch
(
ErrorException
$e
)
{
exit
(
"Failed to write "
.
$filename
);
}
$zip
->
close
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment