Extended data structure with branch field
This commit is contained in:
parent
f0c7c5fae0
commit
2a83cbf9c1
3 changed files with 10 additions and 4 deletions
|
|
@ -62,7 +62,7 @@ class Database {
|
|||
array_push($this->data, $patch);
|
||||
}
|
||||
private function cmp(PatchObject $a, PatchObject $b) : int {
|
||||
return strcasecmp($a->getProduct(), $b->getProduct());
|
||||
return strcasecmp($a->getProduct() . $a->getBranch(), $b->getProduct() . $b->getBranch());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ class PatchObject {
|
|||
private $id = '';
|
||||
private $vendor = '';
|
||||
private $product = '';
|
||||
private $branch = '';
|
||||
private $version = '';
|
||||
private $url = '';
|
||||
private $timestamp = 0;
|
||||
|
|
@ -14,10 +15,10 @@ class PatchObject {
|
|||
}
|
||||
}
|
||||
function __toString() : string {
|
||||
return $this->vendor . ' ' . $this->product . ' ' . $this->version;
|
||||
return $this->vendor . ' ' . $this->product . ' ' . $this->branch . ' ' . $this->version;
|
||||
}
|
||||
function toArray() : array {
|
||||
return array('id' => $this->id, 'vendor' => $this->vendor, 'product' => $this->product, 'version' => $this->version, 'url' => $this->url, 'timestamp' => $this->timestamp);
|
||||
return array('id' => $this->id, 'vendor' => $this->vendor, 'product' => $this->product, 'branch' => $this->branch, 'version' => $this->version, 'url' => $this->url, 'timestamp' => $this->timestamp);
|
||||
}
|
||||
function getId() : string {
|
||||
return $this->id;
|
||||
|
|
@ -28,6 +29,9 @@ class PatchObject {
|
|||
function getProduct() : string {
|
||||
return $this->product;
|
||||
}
|
||||
function getBranch() : string {
|
||||
return $this->branch;
|
||||
}
|
||||
function getVersion() : string {
|
||||
return $this->version;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,11 +31,12 @@ $db->sort();
|
|||
<h2 class="mb-4">Patch Notification Robot</h2>
|
||||
<p class="text-center"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WYQZCVJPVSS5L&source=url"><img src="btn_donateCC_LG.gif" alt="Donate" /></a></p>
|
||||
<p><a href="https://twitter.com/Patchbot_de"><img src="twitter.png" height="32" alt="Follow me" /></a> Providing you the latest update notifications.</p>
|
||||
<table id="list" class="table table-bordered table-hover table-sm">
|
||||
<table id="list" class="table table-bordered table-hover table-sm" data-order='[[ 4, "desc" ]]' data-page-length='25'>
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Vendor</th>
|
||||
<th>Product</th>
|
||||
<th>Branch</th>
|
||||
<th>Version</th>
|
||||
<th title="*) or first discovery time">Release Date*</th>
|
||||
</tr>
|
||||
|
|
@ -48,6 +49,7 @@ $db->sort();
|
|||
echo '<tr>';
|
||||
echo '<td>' . $patch->getVendor() . '</td>';
|
||||
echo '<td><a href="' . $patch->getURL() . '">' . $patch->getProduct() . '</a></td>';
|
||||
echo '<td>' . $patch->getBranch() . '</td>';
|
||||
echo '<td>' . $patch->getVersion() . '</td>';
|
||||
echo '<td>' . date('Y-m-d', $patch->getTimestamp()) . '</td>';
|
||||
echo '</tr>' . "\r\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue