/** * Prints the contents of the API's UserAgentMatcher buckets */ public function dumpBuckets() { if (!$this->httpRequest instanceof TeraWurflHttpRequest) { $this->httpRequest = new TeraWurflHttpRequest(array('HTTP_USER_AGENT' => 'debug')); } UserAgentMatcherFactory::loadMatchers(); $matchers = WurflConstants::$matchers; sort($matchers); foreach ($matchers as $matcher_name) { $matcher_class_name = $matcher_name . 'UserAgentMatcher'; /* @var $matcher UserAgentMatcher */ $matcher = new $matcher_class_name($this); $bucket = $matcher->tableSuffix(); $bucket_data = $this->db->getFullDeviceList(TeraWurflConfig::$TABLE_PREFIX . '_' . $bucket); ksort($bucket_data); foreach ($bucket_data as $device_id => $user_agent) { printf("%s\t%s\t%s\n", $bucket, $device_id, $user_agent); } } }