Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
23f0333f
Commit
23f0333f
authored
Nov 06, 2019
by
Carsten Rose
Browse files
Add '@' to various IO function to suppress OS exception - now QFQ will report customized messages.
parent
07b73555
Pipeline
#2629
passed with stages
in 3 minutes and 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Classes/Core/Helper/HelperFile.php
View file @
23f0333f
...
...
@@ -247,9 +247,9 @@ class HelperFile {
public
static
function
chmod
(
$pathFileName
,
$mode
=
false
)
{
if
(
$mode
!==
false
)
{
if
(
false
===
chmod
(
$pathFileName
,
$mode
))
{
if
(
false
===
@
chmod
(
$pathFileName
,
$mode
))
{
throw
new
\
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'Failed: chmod'
,
ERROR_MESSAGE_TO_DEVELOPER
=>
"Failed: chmod
$mode
'
$pathFileName
'"
]),
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'Failed: chmod'
,
ERROR_MESSAGE_TO_DEVELOPER
=>
self
::
errorGetLastAsString
()
]),
ERROR_IO_CHMOD
);
}
}
...
...
@@ -277,7 +277,7 @@ class HelperFile {
*/
public
static
function
chdir
(
$cwd
)
{
if
(
false
===
chdir
(
$cwd
))
{
if
(
false
===
@
chdir
(
$cwd
))
{
$msg
=
self
::
errorGetLastAsString
()
.
" - chdir(
$cwd
)"
;
throw
new
\
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'chdir failed'
,
ERROR_MESSAGE_TO_DEVELOPER
=>
$msg
]),
ERROR_IO_CHDIR
);
}
...
...
@@ -300,7 +300,7 @@ class HelperFile {
Logger
::
logMessageWithPrefix
(
"Unlink:
$filename
"
,
$logFilename
);
}
if
(
false
===
unlink
(
$filename
))
{
if
(
false
===
@
unlink
(
$filename
))
{
$msg
=
self
::
errorGetLastAsString
()
.
" - unlink(
$filename
)"
;
throw
new
\
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'unlink failed'
,
ERROR_MESSAGE_TO_DEVELOPER
=>
$msg
]),
ERROR_IO_UNLINK
);
}
...
...
@@ -317,7 +317,7 @@ class HelperFile {
*/
public
static
function
rmdir
(
$tempDir
)
{
if
(
false
===
rmdir
(
$tempDir
))
{
if
(
false
===
@
rmdir
(
$tempDir
))
{
$msg
=
self
::
errorGetLastAsString
()
.
" - rmdir(
$tempDir
)"
;
throw
new
\
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'rmdir failed'
,
ERROR_MESSAGE_TO_DEVELOPER
=>
$msg
]),
ERROR_IO_RMDIR
);
}
...
...
@@ -335,7 +335,7 @@ class HelperFile {
*/
public
static
function
rename
(
$oldname
,
$newname
)
{
if
(
false
===
rename
(
$oldname
,
$newname
))
{
if
(
false
===
@
rename
(
$oldname
,
$newname
))
{
$msg
=
self
::
errorGetLastAsString
()
.
" - rename(
$oldname
,
$newname
)"
;
throw
new
\
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'unlink failed'
,
ERROR_MESSAGE_TO_DEVELOPER
=>
$msg
]),
ERROR_IO_RENAME
);
}
...
...
@@ -358,7 +358,7 @@ class HelperFile {
touch
(
$dest
);
}
if
(
false
===
copy
(
$source
,
$dest
))
{
if
(
false
===
@
copy
(
$source
,
$dest
))
{
if
(
!
is_readable
(
$source
))
{
throw
new
\
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
'copy failed'
,
ERROR_MESSAGE_TO_DEVELOPER
=>
"Can't read file '
$source
'"
]),
ERROR_IO_READ_FILE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment