Newer
Older
<?php
/**
* Proxy to normal piwik.php, but in testing mode
* - Use the tests database to record Tracking data
* - Allows to overwrite the Visitor IP, and Server datetime
*
use Piwik\DataTable\Manager;
mattab
a validé
use Piwik\Option;
mattab
a validé
use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
use Piwik\Tracker\Cache;
// Wrapping the request inside ob_start() calls to ensure that the Test
// calling us waits for the full request to process before unblocking
try {
Piwik_TestingEnvironment::addHooks();
diosmosis
a validé
GeoIp::$geoIPDatabaseDir = 'tests/lib/geoip-files';
Tracker::setTestEnvironment();
Manager::getInstance()->deleteAll();
Option::clearCache();
Site::clearCache();
include PIWIK_INCLUDE_PATH . '/piwik.php';
} catch (Exception $ex) {
echo "Unexpected error during tracking: " . $ex->getMessage() . "\n" . $ex->getTraceAsString() . "\n";
}