mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-01-14 14:58:40 +00:00
64 lines
1.2 KiB
PHP
64 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.1
|
|
*
|
|
* @category TBD
|
|
* @package TBD
|
|
* @author OMS Development Team <dev@oms.com>
|
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link http://orange-management.com
|
|
*/
|
|
declare(strict_types=1);
|
|
namespace Modules\Admin\Models;
|
|
|
|
use phpOMS\Utils\IO\Zip\Zip;
|
|
|
|
class Package
|
|
{
|
|
private $src = '';
|
|
private $dest = '';
|
|
|
|
public function __construct(string $src, string $dest)
|
|
{
|
|
$this->src = $src;
|
|
$this->dest = $dest;
|
|
}
|
|
|
|
public function unpack() : bool
|
|
{
|
|
if(!Zip::unpack($this->src, $this->dest)) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public function validated() : bool;
|
|
{
|
|
if(!$this->validateSignature()) {
|
|
throw new InvalidSignature();
|
|
}
|
|
|
|
if(!$this->validateVersion()) {
|
|
throw new InvalidVersion();
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
private function validateSignature() : bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
private function validateVersion() : bool
|
|
{
|
|
return true;
|
|
}
|
|
}
|