mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-10 05:58:42 +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
|
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)) {
|
if (!Tar::pack($source, $destination . '.tmp', $overwrite)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -46,6 +50,10 @@ class TarGz implements ArchiveInterface
|
||||||
*/
|
*/
|
||||||
public static function unpack(string $source, string $destination) : bool
|
public static function unpack(string $source, string $destination) : bool
|
||||||
{
|
{
|
||||||
|
if (!\file_exists($source)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Gz::unpack($source, $destination . '.tmp')) {
|
if (!Gz::unpack($source, $destination . '.tmp')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user