Skip to content

Commit

Permalink
Removing refreshParsedUserAgents function. This could be done in a pl…
Browse files Browse the repository at this point in the history
…ugin maybe.
  • Loading branch information
mattab committed Jan 7, 2014
1 parent b570b06 commit 50fb660
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions plugins/DevicesDetection/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,33 +66,6 @@ public function getBrowserVersions()
return $this->renderReport(__FUNCTION__);
}

/**
* You may manually call this controller action to force re-processing of past user agents
*/
public function refreshParsedUserAgents()
{
Piwik::checkUserIsSuperUser();
$q = "SELECT idvisit, config_debug_ua FROM " . Common::prefixTable("log_visit");
$res = Db::fetchAll($q);

$output = '';

foreach ($res as $rec) {
$UAParser = new UserAgentParserEnhanced($rec['config_debug_ua']);
$UAParser->parse();
$output .= "Processing idvisit = " . $rec['idvisit'] . "<br/>";
$output .= "UserAgent string: " . $rec['config_debug_ua'] . "<br/> Decoded values:";
$uaDetails = $this->getArray($UAParser);
var_export($uaDetails);
$output .= "<hr/>";
$this->updateVisit($rec['idvisit'], $uaDetails);
unset($UAParser);
}
$output .= "Please remember to truncate your archives !";

return $output;
}

private function getArray(UserAgentParserEnhanced $UAParser)
{
$UADetails['config_browser_name'] = $UAParser->getBrowser("short_name");
Expand Down

0 comments on commit 50fb660

Please sign in to comment.