mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
fix overwrites
This commit is contained in:
parent
04704e67cf
commit
dc53adec3c
|
|
@ -31,6 +31,10 @@ class TarGz implements ArchiveInterface
|
|||
*/
|
||||
public static function pack($source, string $destination, bool $overwrite = true) : bool
|
||||
{
|
||||
if (!$overwrite && \file_exists($destination)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Tar::pack($source, $destination . '.tmp', $overwrite)) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -46,6 +50,10 @@ class TarGz implements ArchiveInterface
|
|||
*/
|
||||
public static function unpack(string $source, string $destination) : bool
|
||||
{
|
||||
if (!\file_exists($source)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Gz::unpack($source, $destination . '.tmp')) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user