Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor API.getSegmentsMetadata and Plugin\Segment so segments are a…
…ll defined through Plugin\Segment class in dimensions & make sure AutoSuggestAPITest data providers do not use database.
- Loading branch information
diosmosis
committed
Sep 2, 2015
1 parent
76adbdc
commit 173259c
Showing
10 changed files
with
204 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?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\Columns; | ||
|
||
use Piwik\Piwik; | ||
use Piwik\Plugin\Dimension\VisitDimension; | ||
use Piwik\Plugin\Segment; | ||
|
||
/** | ||
* TODO | ||
*/ | ||
class VisitId extends VisitDimension | ||
{ | ||
protected function configureSegments() | ||
{ | ||
parent::configureSegments(); | ||
|
||
$segment = new Segment(); | ||
$segment->setType('dimension'); | ||
$segment->setCategory(Piwik::translate('General_Visit')); | ||
$segment->setName(Piwik::translate('General_Visit') . " ID"); | ||
$segment->setSegment('visitId'); | ||
$segment->setAcceptedValues('Any integer.'); | ||
$segment->setSqlSegment('log_visit.idvisit'); | ||
$segment->setRequiresAtLeastViewAccess(true); | ||
$this->addSegment($segment); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?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\Columns; | ||
|
||
use Piwik\Piwik; | ||
use Piwik\Plugin\Dimension\VisitDimension; | ||
use Piwik\Plugin\Segment; | ||
|
||
/** | ||
* TODO | ||
*/ | ||
class VisitIp extends VisitDimension | ||
{ | ||
protected function configureSegments() | ||
{ | ||
parent::configureSegments(); | ||
|
||
$segment = new Segment(); | ||
$segment->setType('metric'); | ||
$segment->setCategory(Piwik::translate('General_Visit')); | ||
$segment->setName('General_VisitorIP'); | ||
$segment->setSegment('visitIp'); | ||
$segment->setAcceptedValues('13.54.122.1. </code>Select IP ranges with notation: <code>visitIp>13.54.122.0;visitIp<13.54.122.255'); | ||
$segment->setSqlSegment('log_visit.location_ip'); | ||
$segment->setSqlFilterValue(array('Piwik\Network\IPUtils', 'stringToBinaryIP')); | ||
$segment->setRequiresAtLeastViewAccess(true); | ||
$this->addSegment($segment); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?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\Columns; | ||
|
||
use Piwik\Piwik; | ||
use Piwik\Plugin\Dimension\VisitDimension; | ||
use Piwik\Plugin\Segment; | ||
|
||
/** | ||
* TODO | ||
*/ | ||
class VisitorId extends VisitDimension | ||
{ | ||
protected function configureSegments() | ||
{ | ||
parent::configureSegments(); | ||
|
||
$segment = new Segment(); | ||
$segment->setType('dimension'); | ||
$segment->setCategory(Piwik::translate('General_Visit')); | ||
$segment->setName('General_VisitorID'); | ||
$segment->setSegment('visitorId'); | ||
$segment->setAcceptedValues('34c31e04394bdc63 - any 16 Hexadecimal chars ID, which can be fetched using the Tracking API function getVisitorId()'); | ||
$segment->setSqlSegment('log_visit.idvisitor'); | ||
$segment->setSqlFilterValue(array('Piwik\Common', 'convertVisitorIdToBin')); | ||
$segment->setRequiresAtLeastViewAccess(true); | ||
$this->addSegment($segment); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.