removed code of plugins update manager

refactored & improved other code
This commit is contained in:
Steffen Schröder 2014-05-02 04:03:33 +02:00
parent d89d5578dc
commit 08d52f1a18
2 changed files with 241 additions and 644 deletions

View File

@ -3,9 +3,9 @@
namespace ManiaControl\Update; namespace ManiaControl\Update;
/** /**
* UpdateStructure * Update Data Structure
* *
* @author steeffeen & kremsy * @author ManiaControl Team
* @copyright ManiaControl Copyright © 2014 ManiaControl Team * @copyright ManiaControl Copyright © 2014 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/ */
@ -13,15 +13,16 @@ class UpdateData {
/* /*
* Public Properties * Public Properties
*/ */
public $version = 0; public $version = null;
public $channel = ""; public $channel = null;
public $url = ""; public $url = null;
public $releaseDate = ""; public $releaseDate = null;
public $minDedicatedBuild = ""; public $minDedicatedBuild = null;
/** /**
* Construct new Update Data * Construct new Update Data
* *
* @param Object $updateData * @param object $updateData
*/ */
public function __construct($updateData) { public function __construct($updateData) {
$this->version = $updateData->version; $this->version = $updateData->version;
@ -30,4 +31,19 @@ class UpdateData {
$this->releaseDate = $updateData->release_date; $this->releaseDate = $updateData->release_date;
$this->minDedicatedBuild = $updateData->min_dedicated_build; $this->minDedicatedBuild = $updateData->min_dedicated_build;
} }
/**
* Check if the Update Data is newer than the given Date
*
* @param string $compareDate
* @return bool
*/
public function isNewerThan($compareDate) {
if (!$compareDate) {
return true;
}
$compareTime = strtotime($compareDate);
$releaseTime = strtotime($this->releaseDate);
return ($releaseTime > $compareTime);
}
} }

File diff suppressed because it is too large Load Diff