mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-17 04:48:40 +00:00
Fill some more structures
This commit is contained in:
parent
36cb2cc1ad
commit
9ffff1b1e8
|
|
@ -16,30 +16,48 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace Modules\Admin\Models;
|
namespace Modules\Admin\Models;
|
||||||
|
|
||||||
|
use phpOMS\Utils\IO\Zip\Zip;
|
||||||
|
|
||||||
class UpdatePackage
|
class UpdatePackage
|
||||||
{
|
{
|
||||||
|
private $src = '';
|
||||||
|
private $dest = '';
|
||||||
|
|
||||||
public function __construct(string $src, string $dest)
|
public function __construct(string $src, string $dest)
|
||||||
{
|
{
|
||||||
|
$this->src = $src;
|
||||||
|
$this->dest = $dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function unpack()
|
public function unpack() : bool
|
||||||
{
|
{
|
||||||
|
if(!Zip::unpack($this->src, $this->dest)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function validated()
|
public function validated() : bool;
|
||||||
{
|
{
|
||||||
|
if(!$this->validateSignature()) {
|
||||||
|
throw new InvalidSignature();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$this->validateVersion()) {
|
||||||
|
throw new InvalidVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function validateSignature()
|
private function validateSignature() : bool
|
||||||
{
|
{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function validateVersion()
|
private function validateVersion() : bool
|
||||||
{
|
{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user