diff options
author | diosmosis <benaka@piwik.pro> | 2015-02-06 20:51:52 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-02-08 22:17:59 +0300 |
commit | 579f1e5011566027e40d89f9b79f3b83eb0ded6e (patch) | |
tree | 4db3368d54866a3b686e87347680a56bb9840fe9 /tests/PHPUnit/Fixtures/ManySitesImportedLogs.php | |
parent | 66f478f0b5aab39be308e1095185773294f0b1f5 (diff) |
Add option to map API tracking parameter to custom variable in log importer script. Includes change to ImportLogs system test and fix for import log custom variable handling (old behavior was to not set multiple custom variables if they were set already instead of simply adding custom variables).
Diffstat (limited to 'tests/PHPUnit/Fixtures/ManySitesImportedLogs.php')
-rw-r--r-- | tests/PHPUnit/Fixtures/ManySitesImportedLogs.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php index 5dbeb1e85c..853020e2e1 100644 --- a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php +++ b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php @@ -32,6 +32,7 @@ class ManySitesImportedLogs extends Fixture public $includeCloudfront = false; public $includeCloudfrontRtmp = false; public $includeNginxJson = false; + public $includeApiCustomVarMapping = false; public static function createAccessInstance() { @@ -136,6 +137,10 @@ class ManySitesImportedLogs extends Fixture if ($this->includeNginxJson) { $this->logNginxJsonLog(); } + + if ($this->includeApiCustomVarMapping) { + $this->logIisWithCustomFormat($mapToCustom = true); + } } private function setupSegments() @@ -255,7 +260,7 @@ class ManySitesImportedLogs extends Fixture self::executeLogImporter($logFile, $opts); } - private function logIisWithCustomFormat() + private function logIisWithCustomFormat($mapToCustom = false) { $logFile = PIWIK_INCLUDE_PATH . '/tests/resources/access-logs/fake_logs_custom_iis.log'; @@ -265,6 +270,11 @@ class ManySitesImportedLogs extends Fixture '--enable-http-errors' => false, '--enable-http-redirects' => false); + if ($mapToCustom) { + $opts['--api-arg-to-visit-cvar'] = 'uid=User Name'; + $opts['--api-arg-to-page-cvar'] = 'gt_ms=Generation Time'; + } + self::executeLogImporter($logFile, $opts); } |