oms-Admin/Models/Package.php
2017-07-12 11:06:31 +02:00

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;
}
}