public function __construct($header, &$data)
{
$this->data =& $data;
/* Make sure we do not have a duplicate concatenated useragent string */
$header = preg_replace("/^(Mozilla\\/[0-9]\\.[0-9].{20,})\\s+Mozilla\\/[0-9]\\.[0-9].*\$/iu", '$1', $header);
/* Detect the basic information */
$this->detectOperatingSystem($header)->detectDevice($header)->detectBrowser($header)->detectApplication($header)->detectUsing($header)->detectEngine($header);
/* Detect bots */
if (!isset($this->options->detectBots) || $this->options->detectBots === true) {
$this->detectBot($header);
}
/* Refine some of the information */
$this->refineBrowser($header)->refineOperatingSystem($header);
}