// public function getGeckoDate()
// returns the Gecko date for Gecko-based browsers, null for others
//
+ // public function getGeckoTime()
+ // returns the Gecko build date/time as a unix epoch time number for Gecko-based browsers, null for others
+ //
// *** functions for compat to older versions of this class ***
//
// public function isns()
$this->version = $regs[1];
$this->bot = false;
}
+ elseif (preg_match('|Tablet browser ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
+ $this->brand = 'microB';
+ $this->version = $regs[1];
+ $this->bot = false;
+ }
elseif (preg_match('|Opera\/([^\(]+) \(.*; Opera Mini; |', $this->uastring, $regs)) {
$this->brand = 'Opera Mini';
$this->version = $regs[1];
$this->version = $regs[1];
$this->bot = false;
}
+ elseif (preg_match('|Chrome/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
+ $this->brand = 'Chrome';
+ $this->version = $regs[1];
+ $this->bot = false;
+ }
elseif (preg_match('|Safari/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
$this->brand = 'Safari';
if (preg_match('|Version/([0-9a-zA-Z\.+]+)|', $this->uastring, $vregs)) {
}
}
elseif ((strpos($this->brand, 'Konqueror') !== false) || (strpos($this->brand, 'Safari') !== false) ||
- (strpos($this->brand, 'Shiira') !== false) ||
+ (strpos($this->brand, 'Shiira') !== false) || (strpos($this->brand, 'Chrome') !== false) ||
(strpos($this->brand, 'AppleWebKit') !== false) || (strpos($this->brand, 'OmniWeb') !== false)) {
$this->uadata['engine'] = 'khtml';
}
return $this->uadata['geckodate'];
}
+ public function getGeckoTime() {
+ if (!isset($this->uadata['geckotime'])) {
+ $this->uadata['geckotime'] = null;
+ if (!is_null($this->getGeckoDate())) {
+ $use_time = (strlen($this->getGeckoDate()) > 8);
+ $gd_str = substr($this->getGeckoDate(),0,4).'-'.substr($this->getGeckoDate(),4,2).'-'.substr($this->getGeckoDate(),6,2);
+ if ($use_time) {
+ $gd_str .= substr($this->getGeckoDate(),8,2).':00';
+ $old_tz = date_default_timezone_get();
+ date_default_timezone_set("America/Los_Angeles");
+ }
+ $this->uadata['geckotime'] = strtotime($gd_str);
+ if ($use_time) { date_default_timezone_set($old_tz); }
+ }
+ }
+ return $this->uadata['geckotime'];
+ }
+
public function isBot() { return $this->bot; }
public function isns() {