function __construct($brow = 'ie', $config = array('empty_cache' => true))
{
$apipath = HTTPWatch::$apipath;
if (!$apipath) {
$apipath = dirname(__FILE__) . '/HTTPWatchAPI.php';
}
// populate API
if (file_exists($apipath)) {
require $apipath;
$this->api = $api;
$this->paidproperties = $paidproperties;
}
$this->controller = new COM("HttpWatch.Controller");
if (!method_exists($this->controller, 'IE')) {
throw new Exception('failed to start HTTPWatch');
}
$plug =& $this->watch;
if ($brow === 'ie') {
// start IE
$browser = new COM("InternetExplorer.Application");
if (!method_exists($browser, 'Navigate')) {
throw new Exception('didn\'t create IE obj');
}
$browser->Visible = true;
$plug = $this->controller->IE->Attach($browser);
} else {
$plug = $this->controller->Firefox->New();
}
// no filtering
$plug->Log->EnableFilter(false);
// clear log and cache
$plug->Clear();
if ($config['empty_cache']) {
$plug->ClearCache();
}
}