piwik/piwik — pull request #34 by clearcode (2013-02-25 14:27:27+00:00)
Title: Fixed replay-tracking option to parse different sites ID.

Includes changes needed to properly run the script with `replay_tracking` option enabled, when log files contain data from different websites (with different site ID).

When we consider only logs from piwik.php requests, we don't need host in log format to be able to import them, because we always have `idsite` value parsed from query string (unless we force `idsite` with `--idsite` parameter). `DynamicResolver` class checks whether there is a suitable website in the DB for every hit. Normally this check is based on `hit.host`, in our case on the `hit.args['idsite']`. We wanted to keep this checking in Resolver, because this option seemed the most clear. We added `_resolve_when_replay_tracking` method. We couldn't use the existing `resolve` method, because we can't add websites with random site ID.

Changes from L1432 prevent adding hits with empty args.

Please review and send suggestions.