Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sarun Mungthanya
SpnPatch-Laravel
Commits
3ffd7e89
Commit
3ffd7e89
authored
Dec 09, 2024
by
Thidaporn Laisan
Browse files
update file create patch
parent
4bcd8562
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Livewire/Pages/Exchangerate/ExchangerateUpload.php
View file @
3ffd7e89
...
...
@@ -27,30 +27,12 @@ class ExchangerateUpload extends Component
$temporaryFilePath
=
'livewire-tmp/'
.
$this
->
file
->
getFilename
();
try
{
if
(
Storage
::
disk
(
'public'
)
->
exists
(
$temporaryFilePath
))
{
$absolutePath
=
Storage
::
disk
(
'public'
)
->
path
(
$temporaryFilePath
);
$absolutePath
=
str_replace
(
'/'
,
'\\'
,
$absolutePath
);
$this
->
processFileForPatch
(
$absolutePath
);
session
()
->
flash
(
'message'
,
'File processed successfully.'
);
}
else
{
session
()
->
flash
(
'message'
,
'Temporary file not found.'
);
}
}
catch
(
\
Exception
$e
)
{
session
()
->
flash
(
'message'
,
'Error during file processing: '
.
$e
->
getMessage
());
}
if
(
$this
->
sendToEec
)
{
$absolutePath
=
Storage
::
disk
(
'public'
)
->
path
(
$temporaryFilePath
);
$absolutePath
=
str_replace
(
'/'
,
'\\'
,
$absolutePath
);
$resultEEC
=
$this
->
sendMasterFileToEcc
(
$absolutePath
);
if
(
$resultEEC
[
'http_code'
]
==
200
)
{
session
()
->
flash
(
'message'
,
'Send MasterFile To EEC successfully!'
);
}
else
{
session
()
->
flash
(
'message'
,
'Failed to send MasterFile To EEC.'
);
}
}
if
(
$this
->
createPatch
&&
$this
->
updatePatch
)
{
...
...
@@ -156,7 +138,7 @@ class ExchangerateUpload extends Component
if
(
$chk
===
true
)
{
session
()
->
flash
(
'message'
,
'ไม่สามารถเพิ่ม Patch เดือน '
.
$m2
.
' ปี '
.
$y2
.
' ได้เนื่องจากได้มีการเพิ่มข้อมูลไว้ในระบบเรียบร้อยแล้ว.'
);
return
;
return
false
;
}
// session()->forget('message');
...
...
@@ -306,15 +288,15 @@ class ExchangerateUpload extends Component
$MAJOR_VERSION
=
'All'
;
$POWNER
=
auth
()
->
user
()
->
id
;
$PATCHCODE
=
Storage
::
get
(
$this
->
findHTX
(
'patchcode_new.txt'
)
)
;
$PATCHCODE
=
Storage
::
get
(
'patchcode_new.txt'
);
$PATCHCODE
=
str_replace
(
"'"
,
"''"
,
$PATCHCODE
);
$UNINSTALL
=
Storage
::
get
(
$this
->
findHTX
(
'uninstall_new.txt'
)
)
;
$UNINSTALL
=
Storage
::
get
(
'uninstall_new.txt'
);
$UNINSTALL
=
str_replace
(
"'"
,
"''"
,
$UNINSTALL
);
$i
=
0
;
$PATCHCODE_SERVER
=
''
;
$filePath
=
$this
->
findHTX
(
'patchcode_server_new.txt'
)
;
$filePath
=
'patchcode_server_new.txt'
;
$fileContent
=
Storage
::
get
(
$filePath
);
foreach
(
explode
(
"
\n
"
,
$fileContent
)
as
$tmp
)
{
if
(
$i
==
0
)
{
...
...
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