Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--config/global.ini.php2
-rw-r--r--core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php1
-rw-r--r--core/DataAccess/ArchiveWriter.php23
-rw-r--r--core/DataAccess/Model.php70
-rw-r--r--core/DataFiles/SearchEngines.php3
-rw-r--r--core/DataTable/Filter/Truncate.php4
-rw-r--r--core/Db/Schema/Mysql.php27
-rw-r--r--core/Db/Settings.php43
-rw-r--r--core/Plugin/Visualization.php2
-rw-r--r--core/Sequence.php108
-rw-r--r--core/Session.php2
-rw-r--r--core/Updates/2.9.0-b1.php9
-rw-r--r--core/Updates/2.9.0-b7.php90
-rw-r--r--core/Version.php3
-rw-r--r--plugins/CoreHome/CoreHome.php6
-rw-r--r--plugins/CoreHome/tests/Integration/CoreHomeTest.php39
-rw-r--r--plugins/CoreHome/tests/Unit/CoreHomeTest.php105
-rw-r--r--plugins/CoreUpdater/Commands/Update.php35
-rw-r--r--plugins/Referrers/images/searchEngines/videa.seznam.cz.pngbin0 -> 553 bytes
-rw-r--r--plugins/TestRunner/Commands/TestsSetupFixture.php2
-rwxr-xr-xplugins/UserCountry/GeoIPAutoUpdater.php2
-rw-r--r--tests/PHPUnit/Framework/TestRequest/Response.php2
-rw-r--r--tests/PHPUnit/Integration/DataAccess/ModelTest.php16
-rw-r--r--tests/PHPUnit/Integration/SequenceTest.php112
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml2
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml2
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml2
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml2
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml2
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml2
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml4
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml4
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml24
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml2
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml2
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml6
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCity_day.xml4
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getContinent_day.xml4
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCountry_day.xml4
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getRegion_day.xml4
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerServerTime_day.xml8
-rw-r--r--tests/resources/OmniFixture-dump.sql.gzbin651784 -> 650895 bytes
43 files changed, 637 insertions, 148 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c2d56776b5..03ea44224a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API'
### Breaking Changes
* Development related [console commands](http://developer.piwik.org/guides/piwik-on-the-command-line) are only available if the development mode is enabled. To enable the development mode execute `./console development:enable`.
+* The command `php console core:update` does no longer have a parameter `--dry-run`. A dry run is now executed by default followed by a question whether one actually wants to execute the updates. To skip this confirmation step one can use the `--yes` option.
### Deprecations
* Most methods of `Piwik\IP` have been deprecated in favor of the new [piwik/network](https://github.com/piwik/component-network) component.
diff --git a/config/global.ini.php b/config/global.ini.php
index bc14fce1e4..7c9d9e1bc0 100644
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -58,7 +58,7 @@ log_writers[] = screen
; log level, everything logged w/ this level or one of greater severity
; will be logged. everything else will be ignored. possible values are:
; NONE, ERROR, WARN, INFO, DEBUG, VERBOSE
-log_level = WARN
+log_level = ERROR
; if set to 1, only requests done in CLI mode (eg. the ./console core:archive cron run) will be logged
; NOTE: log_only_when_debug_parameter will also be checked for
diff --git a/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php b/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php
index 64f8e0506f..f916772e2f 100644
--- a/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php
+++ b/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php
@@ -10,7 +10,6 @@ namespace Piwik\AssetManager\UIAssetFetcher;
use Piwik\AssetManager\UIAssetFetcher;
use Piwik\Piwik;
-use string;
class JScriptUIAssetFetcher extends UIAssetFetcher
{
diff --git a/core/DataAccess/ArchiveWriter.php b/core/DataAccess/ArchiveWriter.php
index 1ea6b0d08c..7e0086d795 100644
--- a/core/DataAccess/ArchiveWriter.php
+++ b/core/DataAccess/ArchiveWriter.php
@@ -11,7 +11,6 @@ namespace Piwik\DataAccess;
use Exception;
use Piwik\ArchiveProcessor\Rules;
use Piwik\ArchiveProcessor;
-use Piwik\Common;
use Piwik\Db;
use Piwik\Db\BatchInsert;
use Piwik\Period;
@@ -139,28 +138,10 @@ class ArchiveWriter
protected function allocateNewArchiveId()
{
- $this->idArchive = $this->insertNewArchiveId();
- return $this->idArchive;
- }
-
- /**
- * Locks the archive table to generate a new archive ID.
- *
- * We lock to make sure that
- * if several archiving processes are running at the same time (for different websites and/or periods)
- * then they will each use a unique archive ID.
- *
- * @return int
- */
- protected function insertNewArchiveId()
- {
$numericTable = $this->getTableNumeric();
- $idSite = $this->idSite;
- $date = date("Y-m-d H:i:s");
- $id = $this->getModel()->insertNewArchiveId($numericTable, $idSite, $date);
-
- return $id;
+ $this->idArchive = $this->getModel()->allocateNewArchiveId($numericTable);
+ return $this->idArchive;
}
private function getModel()
diff --git a/core/DataAccess/Model.php b/core/DataAccess/Model.php
index 5cc25635af..dd020af083 100644
--- a/core/DataAccess/Model.php
+++ b/core/DataAccess/Model.php
@@ -12,6 +12,7 @@ use Exception;
use Piwik\Common;
use Piwik\Db;
use Piwik\DbHelper;
+use Piwik\Sequence;
/**
* Cleans up outdated archives
@@ -20,7 +21,6 @@ use Piwik\DbHelper;
*/
class Model
{
- const PREFIX_SQL_LOCK = "locked_";
/**
* Returns the archives IDs that have already been invalidated and have been since re-processed.
@@ -181,53 +181,37 @@ class Model
throw $e;
}
}
+
+ try {
+ if (ArchiveTableCreator::NUMERIC_TABLE === ArchiveTableCreator::getTypeFromTableName($tableName)) {
+ $sequence = new Sequence($tableName);
+ $sequence->create();
+ }
+ } catch (Exception $e) {
+
+ }
}
- /**
- * Locks the archive table to generate a new archive ID.
- *
- * We lock to make sure that
- * if several archiving processes are running at the same time (for different websites and/or periods)
- * then they will each use a unique archive ID.
- *
- * @return int
- */
- public function insertNewArchiveId($numericTable, $idSite, $date)
+ public function allocateNewArchiveId($numericTable)
{
- $this->acquireArchiveTableLock($numericTable);
-
- $locked = self::PREFIX_SQL_LOCK . Common::generateUniqId();
-
- $insertSql = "INSERT INTO $numericTable "
- . " SELECT IFNULL( MAX(idarchive), 0 ) + 1,
- '" . $locked . "',
- " . (int)$idSite . ",
- '" . $date . "',
- '" . $date . "',
- 0,
- '" . $date . "',
- 0 "
- . " FROM $numericTable as tb1";
- Db::get()->exec($insertSql);
-
- $this->releaseArchiveTableLock($numericTable);
-
- $selectIdSql = "SELECT idarchive FROM $numericTable WHERE name = ? LIMIT 1";
- $id = Db::get()->fetchOne($selectIdSql, $locked);
- return $id;
+ $sequence = new Sequence($numericTable);
+ $idarchive = $sequence->getNextId();
+
+ return $idarchive;
}
public function deletePreviousArchiveStatus($numericTable, $archiveId, $doneFlag)
{
+ $dbLockName = "deletePreviousArchiveStatus.$numericTable.$archiveId";
+
// without advisory lock here, the DELETE would acquire Exclusive Lock
- $this->acquireArchiveTableLock($numericTable);
+ $this->acquireArchiveTableLock($dbLockName);
- Db::query("DELETE FROM $numericTable WHERE idarchive = ? AND (name = '" . $doneFlag
- . "' OR name LIKE '" . self::PREFIX_SQL_LOCK . "%')",
+ Db::query("DELETE FROM $numericTable WHERE idarchive = ? AND (name = '" . $doneFlag . "')",
array($archiveId)
);
- $this->releaseArchiveTableLock($numericTable);
+ $this->releaseArchiveTableLock($dbLockName);
}
public function insertRecord($tableName, $fields, $record, $name, $value)
@@ -257,24 +241,16 @@ class Model
return "((name IN ($allDoneFlags)) AND (value IN (" . implode(',', $possibleValues) . ")))";
}
- protected function acquireArchiveTableLock($numericTable)
+ protected function acquireArchiveTableLock($dbLockName)
{
- $dbLockName = $this->getArchiveLockName($numericTable);
-
if (Db::getDbLock($dbLockName, $maxRetries = 30) === false) {
- throw new Exception("allocateNewArchiveId: Cannot get named lock $dbLockName.");
+ throw new Exception("Cannot get named lock $dbLockName.");
}
}
- protected function releaseArchiveTableLock($numericTable)
+ protected function releaseArchiveTableLock($dbLockName)
{
- $dbLockName = $this->getArchiveLockName($numericTable);
Db::releaseDbLock($dbLockName);
}
- protected function getArchiveLockName($numericTable)
- {
- return "allocateNewArchiveId.$numericTable";
- }
-
}
diff --git a/core/DataFiles/SearchEngines.php b/core/DataFiles/SearchEngines.php
index 243c6c5be1..c44836eb2c 100644
--- a/core/DataFiles/SearchEngines.php
+++ b/core/DataFiles/SearchEngines.php
@@ -818,6 +818,9 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) {
// Seznam
'search.seznam.cz' => array('Seznam', 'q', '?q={k}'),
+
+ // Seznam Videa (Video)
+ 'videa.seznam.cz' => array('Seznam Videa', 'q', '?q={k}'),
// Sharelook
'www.sharelook.fr' => array('Sharelook', 'keyword'),
diff --git a/core/DataTable/Filter/Truncate.php b/core/DataTable/Filter/Truncate.php
index 120fc37760..df0cf7509e 100644
--- a/core/DataTable/Filter/Truncate.php
+++ b/core/DataTable/Filter/Truncate.php
@@ -69,6 +69,10 @@ class Truncate extends BaseFilter
*/
public function filter($table)
{
+ if ($this->truncateAfter < 0) {
+ return;
+ }
+
$this->addSummaryRow($table);
$table->queueFilter('ReplaceSummaryRowLabel', array($this->labelSummaryRow));
diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php
index eb8c1f71f1..8f0eea8a26 100644
--- a/core/Db/Schema/Mysql.php
+++ b/core/Db/Schema/Mysql.php
@@ -265,6 +265,13 @@ class Mysql implements SchemaInterface
INDEX index_period_archived(period, ts_archived)
) ENGINE=$engine DEFAULT CHARSET=utf8
",
+
+ 'sequence' => "CREATE TABLE {$prefixTables}sequence (
+ `name` VARCHAR(120) NOT NULL,
+ `value` BIGINT(20) UNSIGNED NOT NULL ,
+ PRIMARY KEY(`name`)
+ ) ENGINE=$engine DEFAULT CHARSET=utf8
+ ",
);
return $tables;
@@ -468,30 +475,26 @@ class Mysql implements SchemaInterface
private function getTablePrefix()
{
- $dbInfos = Db::getDatabaseConfig();
- $prefixTables = $dbInfos['tables_prefix'];
-
- return $prefixTables;
+ return $this->getDbSettings()->getTablePrefix();
}
private function getTableEngine()
{
- $dbInfos = Db::getDatabaseConfig();
- $engine = $dbInfos['type'];
-
- return $engine;
+ return $this->getDbSettings()->getEngine();
}
private function getDb(){
return Db::get();
}
- private function getDbName()
+ private function getDbSettings()
{
- $dbInfos = Db::getDatabaseConfig();
- $dbName = $dbInfos['dbname'];
+ return new Db\Settings();
+ }
- return $dbName;
+ private function getDbName()
+ {
+ return $this->getDbSettings()->getDbName();
}
private function getAllExistingTables($prefixTables = false)
diff --git a/core/Db/Settings.php b/core/Db/Settings.php
new file mode 100644
index 0000000000..afb06abc2f
--- /dev/null
+++ b/core/Db/Settings.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Db;
+use Piwik\Db;
+
+/**
+ * Schema abstraction
+ *
+ * Note: no relation to the ZF proposals for Zend_Db_Schema_Manager
+ *
+ * @method static \Piwik\Db\Schema getInstance()
+ */
+class Settings
+{
+ public function getEngine()
+ {
+ return $this->getDbSetting('type');
+ }
+
+ public function getTablePrefix()
+ {
+ return $this->getDbSetting('tables_prefix');
+ }
+
+ public function getDbName()
+ {
+ return $this->getDbSetting('dbname');
+ }
+
+ private function getDbSetting($key)
+ {
+ $dbInfos = Db::getDatabaseConfig();
+ $engine = $dbInfos[$key];
+
+ return $engine;
+ }
+}
diff --git a/core/Plugin/Visualization.php b/core/Plugin/Visualization.php
index e7e79c62e2..938bcb7a4d 100644
--- a/core/Plugin/Visualization.php
+++ b/core/Plugin/Visualization.php
@@ -177,7 +177,7 @@ class Visualization extends ViewDataTable
} catch (NoAccessException $e) {
throw $e;
} catch (\Exception $e) {
- Log::warning("Failed to get data from API: " . $e->getMessage() . "\n" . $e->getTraceAsString());
+ Log::error("Failed to get data from API: " . $e->getMessage() . "\n" . $e->getTraceAsString());
$message = $e->getMessage();
if (\Piwik_ShouldPrintBackTraceWithMessage()) {
diff --git a/core/Sequence.php b/core/Sequence.php
new file mode 100644
index 0000000000..655332dced
--- /dev/null
+++ b/core/Sequence.php
@@ -0,0 +1,108 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik;
+
+use Exception;
+
+/**
+ * Used for generating auto increment ids.
+ *
+ * Example:
+ *
+ * $sequence = new Sequence('my_sequence_name');
+ * $id = $sequence->getNextId();
+ * $db->insert('anytable', array('id' => $id, '...' => '...'));
+ */
+class Sequence
+{
+ private $name;
+
+ /**
+ * The name of the table or sequence you want to get an id for.
+ *
+ * @param string $name eg 'archive_numeric_2014_11'
+ */
+ public function __construct($name)
+ {
+ $this->name = $name;
+ }
+
+ private function getTableName()
+ {
+ return Common::prefixTable('sequence');
+ }
+
+ /**
+ * Creates / initializes a new sequence.
+ *
+ * @param int $initialValue
+ * @return int The actually used value to initialize the table.
+ *
+ * @throws \Exception in case a sequence having this name already exists.
+ */
+ public function create($initialValue = 0)
+ {
+ $initialValue = (int) $initialValue;
+
+ $table = $this->getTableName();
+ $db = $this->getDb();
+
+ $db->insert($table, array('name' => $this->name, 'value' => $initialValue));
+
+ return $initialValue;
+ }
+
+ /**
+ * Get / allocate / reserve a new id for the current sequence. Important: Getting the next id will fail in case
+ * no such sequence exists. Make sure to create one if needed, see {@link create()}.
+ *
+ * @return int
+ * @throws Exception
+ */
+ public function getNextId()
+ {
+ $table = $this->getTableName();
+ $sql = 'UPDATE ' . $table . ' SET value = LAST_INSERT_ID(value + 1) WHERE name = ?';
+
+ $db = $this->getDb();
+ $result = $db->query($sql, array($this->name));
+ $rowCount = $result->rowCount();
+
+ if (1 !== $rowCount) {
+ throw new Exception("Sequence '" . $this->name . "' not found.");
+ }
+
+ $createdId = $db->lastInsertId();
+
+ return (int) $createdId;
+ }
+
+ /**
+ * Returns the current max id.
+ * @return int
+ * @internal
+ */
+ public function getCurrentId()
+ {
+ $table = $this->getTableName();
+ $sql = 'SELECT value FROM ' . $table . ' WHERE name = ?';
+
+ $db = $this->getDb();
+ $id = $db->fetchOne($sql, array($this->name));
+
+ if (!empty($id) || '0' === $id || 0 === $id) {
+ return (int) $id;
+ }
+ }
+
+ private function getDb()
+ {
+ return Db::get();
+ }
+}
diff --git a/core/Session.php b/core/Session.php
index 24595cd764..d8fa47b4d2 100644
--- a/core/Session.php
+++ b/core/Session.php
@@ -115,7 +115,7 @@ class Session extends Zend_Session
parent::start();
register_shutdown_function(array('Zend_Session', 'writeClose'), true);
} catch (Exception $e) {
- Log::warning('Unable to start session: ' . $e->getMessage());
+ Log::error('Unable to start session: ' . $e->getMessage());
$enableDbSessions = '';
if (DbHelper::isInstalled()) {
diff --git a/core/Updates/2.9.0-b1.php b/core/Updates/2.9.0-b1.php
index f36f52a6bd..5720bf076e 100644
--- a/core/Updates/2.9.0-b1.php
+++ b/core/Updates/2.9.0-b1.php
@@ -20,7 +20,6 @@ class Updates_2_9_0_b1 extends Updates
static function getSql()
{
$sql = array();
-
$sql = self::updateBrowserEngine($sql);
return $sql;
@@ -45,10 +44,10 @@ class Updates_2_9_0_b1 extends Updates
$browserEngineMatch = array(
'Trident' => array('IE'),
- 'Gecko' => array('NS', 'PX', 'FF', 'FB', 'CA', 'GA', 'KM', 'MO', 'SM', 'CO', 'FE', 'KP', 'KZ', 'TB'),
- 'KHTML' => array('KO'),
- 'WebKit' => array('SF', 'CH', 'OW', 'AR', 'EP', 'FL', 'WO', 'AB', 'IR', 'CS', 'FD', 'HA', 'MI', 'GE', 'DF', 'BB', 'BP', 'TI', 'CF', 'RK', 'B2', 'NF'),
- 'Presto' => array('OP'),
+ 'Gecko' => array('NS', 'PX', 'FF', 'FB', 'CA', 'GA', 'KM', 'MO', 'SM', 'CO', 'FE', 'KP', 'KZ', 'TB'),
+ 'KHTML' => array('KO'),
+ 'WebKit' => array('SF', 'CH', 'OW', 'AR', 'EP', 'FL', 'WO', 'AB', 'IR', 'CS', 'FD', 'HA', 'MI', 'GE', 'DF', 'BB', 'BP', 'TI', 'CF', 'RK', 'B2', 'NF'),
+ 'Presto' => array('OP'),
);
// Update visits, fill in now missing engine
diff --git a/core/Updates/2.9.0-b7.php b/core/Updates/2.9.0-b7.php
new file mode 100644
index 0000000000..1efcf8360c
--- /dev/null
+++ b/core/Updates/2.9.0-b7.php
@@ -0,0 +1,90 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Updates;
+
+use Piwik\Common;
+use Piwik\DataAccess\ArchiveTableCreator;
+use Piwik\Db;
+use Piwik\Updater;
+use Piwik\Updates;
+
+class Updates_2_9_0_b7 extends Updates
+{
+ static function getSql()
+ {
+ $sql = array();
+ $sql = self::addCreateSequenceTableQuery($sql);
+ $sql = self::addArchivingIdMigrationQueries($sql);
+
+ return $sql;
+ }
+
+ static function update()
+ {
+ Updater::updateDatabase(__FILE__, self::getSql());
+ }
+
+ private static function addArchivingIdMigrationQueries($sql)
+ {
+ $tables = ArchiveTableCreator::getTablesArchivesInstalled();
+
+ foreach ($tables as $table) {
+ $type = ArchiveTableCreator::getTypeFromTableName($table);
+
+ if ($type === ArchiveTableCreator::NUMERIC_TABLE) {
+ $maxId = Db::fetchOne('SELECT MAX(idarchive) FROM ' . $table);
+
+ if (!empty($maxId)) {
+ $maxId = (int) $maxId + 500;
+ } else {
+ $maxId = 1;
+ }
+
+ $query = self::getQueryToCreateSequence($table, $maxId);
+ $sql[$query] = false;
+ }
+ }
+
+ return $sql;
+ }
+
+ private static function getQueryToCreateSequence($name, $initialValue)
+ {
+ $table = self::getSequenceTableName();
+ $query = sprintf("INSERT INTO %s (name, value) VALUES ('%s', %d)", $table, $name, $initialValue);
+
+ return $query;
+ }
+
+ /**
+ * @return string
+ */
+ private static function addCreateSequenceTableQuery($sql)
+ {
+ $dbSettings = new Db\Settings();
+ $engine = $dbSettings->getEngine();
+ $table = self::getSequenceTableName();
+
+ $query = "CREATE TABLE `$table` (
+ `name` VARCHAR(120) NOT NULL,
+ `value` BIGINT(20) UNSIGNED NOT NULL,
+ PRIMARY KEY(`name`)
+ ) ENGINE=$engine DEFAULT CHARSET=utf8";
+
+ $sql[$query] = 1050;
+
+ return $sql;
+ }
+
+ private static function getSequenceTableName()
+ {
+ return Common::prefixTable('sequence');
+ }
+
+}
diff --git a/core/Version.php b/core/Version.php
index 789d7d29d3..ba95441792 100644
--- a/core/Version.php
+++ b/core/Version.php
@@ -12,7 +12,6 @@ namespace Piwik;
/**
* Piwik version information.
*
- *
* @api
*/
final class Version
@@ -21,5 +20,5 @@ final class Version
* The current Piwik version.
* @var string
*/
- const VERSION = '2.9.0-b6';
+ const VERSION = '2.9.0-b7';
}
diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php
index 62ef2a935c..ea692d7ba8 100644
--- a/plugins/CoreHome/CoreHome.php
+++ b/plugins/CoreHome/CoreHome.php
@@ -21,11 +21,17 @@ class CoreHome extends \Piwik\Plugin
return array(
'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
'AssetManager.getJavaScriptFiles' => 'getJsFiles',
+ 'AssetManager.filterMergedJavaScripts' => 'filterMergedJavaScripts',
'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys',
'Live.getAllVisitorDetails' => 'extendVisitorDetails',
);
}
+ public function filterMergedJavaScripts(&$mergedContent)
+ {
+ $mergedContent = preg_replace('/(sourceMappingURL=(.*?).map)/', '', $mergedContent);
+ }
+
public function extendVisitorDetails(&$visitor, $details)
{
$instance = new Visitor($details);
diff --git a/plugins/CoreHome/tests/Integration/CoreHomeTest.php b/plugins/CoreHome/tests/Integration/CoreHomeTest.php
new file mode 100644
index 0000000000..b04c98df64
--- /dev/null
+++ b/plugins/CoreHome/tests/Integration/CoreHomeTest.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\CoreHome\tests\Integration;
+
+use Piwik\Piwik;
+use Piwik\Plugins\CoreHome\CoreHome;
+use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+
+/**
+ * @group CoreHome
+ * @group CoreHomeTest
+ * @group Plugins
+ */
+class CoreHomeTest extends IntegrationTestCase
+{
+ public function test_CoreHomePlugin_ShouldListenToFilterJavaScriptEvent_AndOnlyChangeIfContainsSourceMap()
+ {
+ $content = 'var x = 5;';
+ $expectedContent = $content;
+ Piwik::postEvent('AssetManager.filterMergedJavaScripts', array(&$content));
+
+ $this->assertEquals($expectedContent, $content);
+ }
+
+ public function test_CoreHomePlugin_ShouldListenToFilterJavaScriptEvent_AndRemoveSourceMapDefinition()
+ {
+ $content = '//# sourceMappingURL=55.map';
+ Piwik::postEvent('AssetManager.filterMergedJavaScripts', array(&$content));
+
+ $this->assertEquals('//# ', $content);
+ }
+
+}
diff --git a/plugins/CoreHome/tests/Unit/CoreHomeTest.php b/plugins/CoreHome/tests/Unit/CoreHomeTest.php
new file mode 100644
index 0000000000..e40f7bf5d3
--- /dev/null
+++ b/plugins/CoreHome/tests/Unit/CoreHomeTest.php
@@ -0,0 +1,105 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\CoreHome\tests\Unit;
+
+use Piwik\Piwik;
+use Piwik\Plugins\CoreHome\CoreHome;
+
+/**
+ * @group CoreHome
+ * @group CoreHomeTest
+ * @group Plugins
+ */
+class CoreHomeTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var CoreHome
+ */
+ private $coreHome;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->coreHome = new CoreHome();
+ }
+
+ /**
+ * @dataProvider getJavaScriptsContainingNoSourceMapDefinition
+ */
+ public function testFilterMergedJavaScripts_shouldNotChangeAnything_IfJsDoesNotContainAnySourceMap($content)
+ {
+ $expectedContent = $content;
+
+ $this->coreHome->filterMergedJavaScripts($content);
+
+ $this->assertSame($expectedContent, $content);
+ }
+
+ /**
+ * @dataProvider getJavaScriptsContainingSourceMapDefinition
+ */
+ public function testFilterMergedJavaScripts_shouldRemoveSourceMap_IfDefinedInJs($content, $expectedContent)
+ {
+ $this->coreHome->filterMergedJavaScripts($content);
+
+ $this->assertSame($expectedContent, $content);
+ }
+
+ public function testFilterMergedJavaScripts_shouldRemoveMultipleSourceMapDefinitionsInOneContent()
+ {
+ $content = 'var x = 5;
+//# sourceMappingURL=whatever.js.map .map
+init();
+x = 6;
+//# sourceMappingURL=js.map
+foo("bar");
+';
+ $expected = 'var x = 5;
+//# .map
+init();
+x = 6;
+//#
+foo("bar");
+';
+ $this->coreHome->filterMergedJavaScripts($content);
+
+ $this->assertSame($expected, $content);
+ }
+
+ public function getJavaScriptsContainingNoSourceMapDefinition()
+ {
+ $js = array();
+
+ $js[] = array('');
+ $js[] = array('var x = 5; init();');
+ $js[] = array('//# sourceMappingURL');
+ $js[] = array('//# sourceMappingURL=');
+ $js[] = array('//# sourceMappingURL.map');
+ $js[] = array('sourceMappingURL=
+cc.map');
+
+ return $js;
+ }
+
+ public function getJavaScriptsContainingSourceMapDefinition()
+ {
+ $js = array();
+
+ $js[] = array('//# sourceMappingURL=55.map', '//# ');
+ $js[] = array('//# sourceMappingURL=.map', '//# ');
+ $js[] = array('sourceMappingURL=whatever.js.map', '');
+ $js[] = array('sourceMappingURL=whatever.js.map .map', ' .map');
+ $js[] = array('var x = 5;
+//# sourceMappingURL=whatever.js.map .map', 'var x = 5;
+//# .map');
+
+ return $js;
+ }
+}
diff --git a/plugins/CoreUpdater/Commands/Update.php b/plugins/CoreUpdater/Commands/Update.php
index 900de31a3d..02f774ec44 100644
--- a/plugins/CoreUpdater/Commands/Update.php
+++ b/plugins/CoreUpdater/Commands/Update.php
@@ -16,6 +16,7 @@ use Piwik\Plugins\UserCountry\LocationProvider;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Question\ConfirmationQuestion;
/**
* @package CloudAdmin
@@ -28,28 +29,38 @@ class Update extends ConsoleCommand
$this->setDescription('Triggers upgrades. Use it after Piwik core or any plugin files have been updated.');
- $this->addOption('dry-run', null, InputOption::VALUE_NONE, 'Only prints out the SQL requests that would be executed during the upgrade');
+ $this->addOption('yes', null, InputOption::VALUE_NONE, 'Directly execute the update without asking for confirmation');
}
/**
- * Execute command like: ./console core:update --dry-run
+ * Execute command like: ./console core:update --yes
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->executeClearCaches();
- $doDryRun = (bool) $input->getOption('dry-run');
+ $yes = $input->getOption('yes');
try {
- $this->makeUpdate($input, $output, $doDryRun);
+ $this->makeUpdate($input, $output, true);
+
+ if (!$yes) {
+ $yes = $this->askForUpdateConfirmation($input, $output);
+ }
+
+ if ($yes) {
+ $output->writeln("\nStarting the database upgrade process now. This may take a while, so please be patient.");
+
+ $this->makeUpdate($input, $output, false);
- if (!$doDryRun) {
$this->writeSuccessMessage($output, array("Piwik has been successfully updated!"));
+ } else {
+ $this->writeSuccessMessage($output, array('Database upgrade not executed.'));
}
} catch(NoUpdatesFoundException $e) {
// Do not fail if no updates were found
- $output->writeln("<info>".$e->getMessage()."</info>");
+ $this->writeSuccessMessage($output, array($e->getMessage()));
} catch (\Exception $e) {
// Fail in case of any other error during upgrade
$output->writeln("<error>" . $e->getMessage() . "</error>");
@@ -57,6 +68,14 @@ class Update extends ConsoleCommand
}
}
+ private function askForUpdateConfirmation(InputInterface $input, OutputInterface $output)
+ {
+ $helper = $this->getHelper('question');
+ $question = new ConfirmationQuestion('<comment>A database upgrade is required. Execute update? (y/N) </comment>', false);
+
+ return $helper->ask($input, $output, $question);
+ }
+
protected function executeClearCaches()
{
Filesystem::deleteAllCacheOnUpdate();
@@ -67,6 +86,8 @@ class Update extends ConsoleCommand
$this->checkAllRequiredOptionsAreNotEmpty($input);
$updateController = new Controller();
- echo $updateController->runUpdaterAndExit($doDryRun);
+ $content = $updateController->runUpdaterAndExit($doDryRun);
+
+ $output->writeln($content);
}
} \ No newline at end of file
diff --git a/plugins/Referrers/images/searchEngines/videa.seznam.cz.png b/plugins/Referrers/images/searchEngines/videa.seznam.cz.png
new file mode 100644
index 0000000000..7764196ea7
--- /dev/null
+++ b/plugins/Referrers/images/searchEngines/videa.seznam.cz.png
Binary files differ
diff --git a/plugins/TestRunner/Commands/TestsSetupFixture.php b/plugins/TestRunner/Commands/TestsSetupFixture.php
index 8c053b1711..cda1a5c585 100644
--- a/plugins/TestRunner/Commands/TestsSetupFixture.php
+++ b/plugins/TestRunner/Commands/TestsSetupFixture.php
@@ -237,10 +237,12 @@ class TestsSetupFixture extends ConsoleCommand
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/IntegrationTestCase.php';
$fixturesToLoad = array(
+ '/tests/PHPUnit/Fixtures/*.php',
'/tests/PHPUnit/UI/Fixtures/*.php',
'/plugins/*/tests/Fixtures/*.php',
'/plugins/*/Test/Fixtures/*.php',
);
+
foreach($fixturesToLoad as $fixturePath) {
foreach (glob(PIWIK_INCLUDE_PATH . $fixturePath) as $file) {
require_once $file;
diff --git a/plugins/UserCountry/GeoIPAutoUpdater.php b/plugins/UserCountry/GeoIPAutoUpdater.php
index d12be6aace..64b69be435 100755
--- a/plugins/UserCountry/GeoIPAutoUpdater.php
+++ b/plugins/UserCountry/GeoIPAutoUpdater.php
@@ -538,7 +538,7 @@ class GeoIPAutoUpdater extends ScheduledTask
self::getTestLocationCatchPhpErrors($provider);
if (self::$unzipPhpError !== null) {
list($errno, $errstr, $errfile, $errline) = self::$unzipPhpError;
- Log::warning("GeoIPAutoUpdater: Encountered PHP error when performing redundant tests on GeoIP "
+ Log::error("GeoIPAutoUpdater: Encountered PHP error when performing redundant tests on GeoIP "
. "%s database: %s: %s on line %s of %s.", $type, $errno, $errstr, $errline, $errfile);
// get the current filename for the DB and an available new one to rename it to
diff --git a/tests/PHPUnit/Framework/TestRequest/Response.php b/tests/PHPUnit/Framework/TestRequest/Response.php
index 0d73a3f0f4..7c740dd2c6 100644
--- a/tests/PHPUnit/Framework/TestRequest/Response.php
+++ b/tests/PHPUnit/Framework/TestRequest/Response.php
@@ -251,8 +251,6 @@ class Response
// http://bugs.php.net/bug.php?id=54508
$response = str_replace('.000000</l', '</l', $response); //lat/long
$response = str_replace('.00</revenue>', '</revenue>', $response);
- $response = str_replace('.1</revenue>', '</revenue>', $response);
- $response = str_replace('.11</revenue>', '</revenue>', $response);
return $response;
}
diff --git a/tests/PHPUnit/Integration/DataAccess/ModelTest.php b/tests/PHPUnit/Integration/DataAccess/ModelTest.php
index 62ccaeaade..270253b82a 100644
--- a/tests/PHPUnit/Integration/DataAccess/ModelTest.php
+++ b/tests/PHPUnit/Integration/DataAccess/ModelTest.php
@@ -31,17 +31,17 @@ class Core_DataAccess_ModelTest extends IntegrationTestCase
public function test_insertNewArchiveId()
{
- $this->assertCreatedArchiveId(1);
- $this->assertCreatedArchiveId(2);
- $this->assertCreatedArchiveId(3);
- $this->assertCreatedArchiveId(4);
- $this->assertCreatedArchiveId(5, 2);
- $this->assertCreatedArchiveId(6, 2);
+ $this->assertAllocatedArchiveId(1);
+ $this->assertAllocatedArchiveId(2);
+ $this->assertAllocatedArchiveId(3);
+ $this->assertAllocatedArchiveId(4);
+ $this->assertAllocatedArchiveId(5);
+ $this->assertAllocatedArchiveId(6);
}
- private function assertCreatedArchiveId($expectedId, $siteId = 1)
+ private function assertAllocatedArchiveId($expectedId)
{
- $id = $this->model->insertNewArchiveId($this->tableName, $siteId, '2014-01-01 00:01:02');
+ $id = $this->model->allocateNewArchiveId($this->tableName);
$this->assertEquals($expectedId, $id);
}
diff --git a/tests/PHPUnit/Integration/SequenceTest.php b/tests/PHPUnit/Integration/SequenceTest.php
new file mode 100644
index 0000000000..f42617cf06
--- /dev/null
+++ b/tests/PHPUnit/Integration/SequenceTest.php
@@ -0,0 +1,112 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+use Piwik\Db;
+use Piwik\Sequence;
+use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+
+/**
+ * Class Core_SequenceTest
+ *
+ * @group Core
+ * @group Sequence
+ */
+class Core_SequenceTest extends IntegrationTestCase
+{
+ /**
+ * @var Sequence
+ */
+ private $sequence;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->sequence = new Sequence('mySequence0815');
+ $this->sequence->create();
+ }
+
+ public function test_create_shouldAddNewSequenceWithInitalId1()
+ {
+ $sequence = $this->getEmptySequence();
+
+ $id = $sequence->create();
+ $this->assertSame(0, $id);
+
+ // verify
+ $id = $sequence->getCurrentId();
+ $this->assertSame(0, $id);
+ }
+
+ public function test_create_WithCustomInitialValue()
+ {
+ $sequence = $this->getEmptySequence();
+
+ $id = $sequence->create(11);
+ $this->assertSame(11, $id);
+
+ // verify
+ $id = $sequence->getCurrentId();
+ $this->assertSame(11, $id);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Duplicate entry
+ */
+ public function test_create_shouldFailIfSequenceAlreadyExists()
+ {
+ $this->sequence->create();
+ }
+
+ public function test_getNextId_shouldGenerateNextId()
+ {
+ $this->assertNextIdGenerated(1);
+ $this->assertNextIdGenerated(2);
+ $this->assertNextIdGenerated(3);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Sequence 'notCreatedSequence' not found
+ */
+ public function test_getNextId_shouldFailIfThereIsNoSequenceHavingThisName()
+ {
+ $sequence = $this->getEmptySequence();
+ $sequence->getNextId();
+ }
+
+ private function assertNextIdGenerated($expectedId)
+ {
+ $id = $this->sequence->getNextId();
+ $this->assertSame($expectedId, $id);
+
+ // verify
+ $id = $this->sequence->getCurrentId();
+ $this->assertSame($expectedId, $id);
+ }
+
+ public function test_getCurrentId_shouldReturnTheCurrentIdAsInt()
+ {
+ $id = $this->sequence->getCurrentId();
+ $this->assertSame(0, $id);
+ }
+
+ public function test_getCurrentId_shouldReturnNullIfSequenceDoesNotExist()
+ {
+ $sequence = $this->getEmptySequence();
+ $id = $sequence->getCurrentId();
+ $this->assertNull($id);
+ }
+
+ private function getEmptySequence()
+ {
+ return new Sequence('notCreatedSequence');
+ }
+
+
+} \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml
index 698b353eab..ebcd365223 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml
@@ -3,7 +3,7 @@
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
<conversion_rate>33.33</conversion_rate>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml
index 1daeb97961..ea6729364c 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml
@@ -3,7 +3,7 @@
<nb_conversions>4</nb_conversions>
<nb_visits_converted>2</nb_visits_converted>
<conversion_rate>40</conversion_rate>
- <revenue>13351</revenue>
+ <revenue>13351.11</revenue>
<revenue_subtotal>2700</revenue_subtotal>
<revenue_tax>531</revenue_tax>
<revenue_shipping>120.11</revenue_shipping>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml
index c2cd462325..fc23e7158e 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml
@@ -3,5 +3,5 @@
<nb_conversions>3</nb_conversions>
<nb_visits_converted>2</nb_visits_converted>
<conversion_rate>66.67</conversion_rate>
- <revenue>3121</revenue>
+ <revenue>3121.11</revenue>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml
index 8190aee36f..221f89f826 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml
@@ -3,5 +3,5 @@
<nb_conversions>5</nb_conversions>
<nb_visits_converted>4</nb_visits_converted>
<conversion_rate>80</conversion_rate>
- <revenue>13361</revenue>
+ <revenue>13361.11</revenue>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml
index 42b55ed358..46d72dcf04 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml
@@ -224,7 +224,7 @@
</row>
<row>
<type>ecommerceAbandonedCart</type>
- <revenue>2510</revenue>
+ <revenue>2510.11</revenue>
<items>4</items>
<itemDetails>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml
index 795e631e81..65ca5686e1 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml
@@ -45,7 +45,7 @@
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
<conversion_rate>33.33%</conversion_rate>
- <revenue>$ 3111</revenue>
+ <revenue>$ 3111.11</revenue>
<revenue_subtotal>$ 2500</revenue_subtotal>
<revenue_tax>$ 511</revenue_tax>
<revenue_shipping>$ 100.11</revenue_shipping>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
index 71282d9145..dda3bec0a8 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
@@ -77,7 +77,7 @@
<nb_visits>1</nb_visits>
<nb_actions>6</nb_actions>
<nb_users>0</nb_users>
- <revenue>$ 3111</revenue>
+ <revenue>$ 3111.11</revenue>
<nb_actions_per_visit>6</nb_actions_per_visit>
<avg_time_on_site>01:06:01</avg_time_on_site>
<bounce_rate>0%</bounce_rate>
@@ -321,6 +321,6 @@
<nb_actions>13</nb_actions>
<nb_conversions>3</nb_conversions>
<bounce_count>0</bounce_count>
- <revenue>3121</revenue>
+ <revenue>3121.11</revenue>
</reportTotal>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml
index 79289ce2d7..2b07701c01 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml
@@ -51,7 +51,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_visits>2</nb_visits>
<nb_actions>9</nb_actions>
- <revenue>$ 3111</revenue>
+ <revenue>$ 3111.11</revenue>
<nb_actions_per_visit>4.5</nb_actions_per_visit>
<avg_time_on_site>00:39:01</avg_time_on_site>
<bounce_rate>0%</bounce_rate>
@@ -87,6 +87,6 @@
<nb_actions>13</nb_actions>
<nb_conversions>3</nb_conversions>
<bounce_count>0</bounce_count>
- <revenue>3121</revenue>
+ <revenue>3121.11</revenue>
</reportTotal>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml
index 8056021220..8dd490bdb3 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml
@@ -18,7 +18,7 @@
<row idgoal='ecommerceOrder'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
@@ -32,7 +32,7 @@
</row>
</goals>
<nb_conversions>3</nb_conversions>
- <revenue>3121</revenue>
+ <revenue>3121.11</revenue>
<subtable>
<row>
<label>0</label>
@@ -52,7 +52,7 @@
<row idgoal='ecommerceOrder'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
@@ -66,7 +66,7 @@
</row>
</goals>
<nb_conversions>3</nb_conversions>
- <revenue>3121</revenue>
+ <revenue>3121.11</revenue>
</row>
</subtable>
</row>
@@ -88,7 +88,7 @@
<row idgoal='ecommerceOrder'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
@@ -102,7 +102,7 @@
</row>
</goals>
<nb_conversions>3</nb_conversions>
- <revenue>3121</revenue>
+ <revenue>3121.11</revenue>
<subtable>
<row>
<label>NewLoggedOut</label>
@@ -122,7 +122,7 @@
<row idgoal='ecommerceOrder'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
@@ -136,7 +136,7 @@
</row>
</goals>
<nb_conversions>3</nb_conversions>
- <revenue>3121</revenue>
+ <revenue>3121.11</revenue>
</row>
</subtable>
</row>
@@ -250,7 +250,7 @@
<row idgoal='ecommerceOrder'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
@@ -259,7 +259,7 @@
</row>
</goals>
<nb_conversions>2</nb_conversions>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<subtable>
<row>
<label>Great name!</label>
@@ -279,7 +279,7 @@
<row idgoal='ecommerceOrder'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
@@ -288,7 +288,7 @@
</row>
</goals>
<nb_conversions>2</nb_conversions>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
</row>
</subtable>
</row>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml
index c2cd462325..fc23e7158e 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml
@@ -3,5 +3,5 @@
<nb_conversions>3</nb_conversions>
<nb_visits_converted>2</nb_visits_converted>
<conversion_rate>66.67</conversion_rate>
- <revenue>3121</revenue>
+ <revenue>3121.11</revenue>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml
index 8190aee36f..221f89f826 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml
@@ -3,5 +3,5 @@
<nb_conversions>5</nb_conversions>
<nb_visits_converted>4</nb_visits_converted>
<conversion_rate>80</conversion_rate>
- <revenue>13361</revenue>
+ <revenue>13361.11</revenue>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml
index 2d178e632d..9d33118b4c 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml
@@ -89,7 +89,7 @@
</row>
<row>
<type>ecommerceAbandonedCart</type>
- <revenue>2510</revenue>
+ <revenue>2510.11</revenue>
<items>4</items>
<itemDetails>
@@ -283,7 +283,7 @@
<row>
<type>ecommerceOrder</type>
<orderId>937nsjusu 3894</orderId>
- <revenue>1111</revenue>
+ <revenue>1111.11</revenue>
<revenueSubTotal>1000</revenueSubTotal>
<revenueTax>111</revenueTax>
<revenueShipping>0.11</revenueShipping>
@@ -419,7 +419,7 @@
</row>
<row>
<type>ecommerceAbandonedCart</type>
- <revenue>2510</revenue>
+ <revenue>2510.11</revenue>
<items>4</items>
<itemDetails>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCity_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCity_day.xml
index 99fad8ffbf..995d52a578 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCity_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCity_day.xml
@@ -19,7 +19,7 @@
<row idgoal='ecommerceOrder'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
@@ -33,7 +33,7 @@
</row>
</goals>
<nb_conversions>3</nb_conversions>
- <revenue>3121</revenue>
+ <revenue>3121.11</revenue>
<city_name>Unknown</city_name>
<city>xx</city>
<region>xx</region>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getContinent_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getContinent_day.xml
index 152f156767..fe2b91b546 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getContinent_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getContinent_day.xml
@@ -19,7 +19,7 @@
<row idgoal='ecommerceOrder'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
@@ -33,7 +33,7 @@
</row>
</goals>
<nb_conversions>3</nb_conversions>
- <revenue>3121</revenue>
+ <revenue>3121.11</revenue>
<code>Europe</code>
</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCountry_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCountry_day.xml
index a61fe0658f..1f4ae42832 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCountry_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCountry_day.xml
@@ -19,7 +19,7 @@
<row idgoal='ecommerceOrder'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
@@ -28,7 +28,7 @@
</row>
</goals>
<nb_conversions>2</nb_conversions>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<code>pl</code>
<logo>plugins/UserCountry/images/flags/pl.png</logo>
<logoWidth>16</logoWidth>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getRegion_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getRegion_day.xml
index 7a0583f3a4..6f6499cc36 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getRegion_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getRegion_day.xml
@@ -19,7 +19,7 @@
<row idgoal='ecommerceOrder'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
@@ -33,7 +33,7 @@
</row>
</goals>
<nb_conversions>3</nb_conversions>
- <revenue>3121</revenue>
+ <revenue>3121.11</revenue>
<region>xx</region>
<country>xx</country>
<country_name>Unknown</country_name>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerServerTime_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerServerTime_day.xml
index ac8065dbb1..09cede1477 100644..100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerServerTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerServerTime_day.xml
@@ -43,13 +43,13 @@
<row idgoal='ecommerceAbandonedCart'>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>2510</revenue>
+ <revenue>2510.11</revenue>
<items>4</items>
</row>
<row idgoal='ecommerceOrder'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
<revenue_shipping>100.11</revenue_shipping>
@@ -58,7 +58,7 @@
</row>
</goals>
<nb_conversions>2</nb_conversions>
- <revenue>3111</revenue>
+ <revenue>3111.11</revenue>
</row>
<row>
<label>3h</label>
@@ -117,7 +117,7 @@
<row idgoal='ecommerceAbandonedCart'>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>2510</revenue>
+ <revenue>2510.11</revenue>
<items>4</items>
</row>
</goals>
diff --git a/tests/resources/OmniFixture-dump.sql.gz b/tests/resources/OmniFixture-dump.sql.gz
index f1f56e6d9b..a7151a5d6b 100644
--- a/tests/resources/OmniFixture-dump.sql.gz
+++ b/tests/resources/OmniFixture-dump.sql.gz
Binary files differ