createMetric(ArchivedMetric::AGGREGATION_UNIQUE); $metric->setTranslatedName(Piwik::translate('General_ColumnNbUniqVisitors')); $metric->setName('nb_uniq_visitors'); $metricsList->addMetric($metric); } public function configureSegments(SegmentsList $segmentsList, DimensionSegmentFactory $dimensionSegmentFactory) { try { $visitorProfileEnabled = Live::isVisitorProfileEnabled(); } catch (\Zend_Db_Exception $e) { // when running tests the db might not yet be set up when fetching available segments if (!defined('PIWIK_TEST_MODE') || !PIWIK_TEST_MODE) { throw $e; } $visitorProfileEnabled = true; } if ($visitorProfileEnabled) { parent::configureSegments($segmentsList, $dimensionSegmentFactory); } } }