Skip to content
Extraits de code Groupes Projets
Valider 0ef69457 rédigé par mattpiwik's avatar mattpiwik
Parcourir les fichiers

Refs #2633 - revert previous commits since they are temporary solution (final...

Refs #2633 - revert previous commits since they are temporary solution (final patch in the works by Timo)

git-svn-id: http://dev.piwik.org/svn/trunk@5129 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 5c237b63
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
<?php
/**
* Piwik - Open source web analytics
*
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
* @version $Id$
*
*
*
*
* @category Piwik
* @package Piwik
*/
/**
* Piwik_Archive_Single is used to store the data of a single archive,
* for example the statistics for the 'day' '2008-02-21' for the website idSite '2'
* Piwik_Archive_Single is used to store the data of a single archive,
* for example the statistics for the 'day' '2008-02-21' for the website idSite '2'
*
* @package Piwik
* @subpackage Piwik_Archive
......@@ -23,7 +23,7 @@ class Piwik_Archive_Single extends Piwik_Archive
/**
* The Piwik_ArchiveProcessing object used to check that the archive is available
* and launch the processing if the archive was not yet processed
*
*
* @var Piwik_ArchiveProcessing
*/
public $archiveProcessing = null;
......@@ -48,7 +48,7 @@ class Piwik_Archive_Single extends Piwik_Archive
protected $cacheEnabledForNumeric = true;
/**
* Array of cached numeric values, used to make requests faster
* Array of cached numeric values, used to make requests faster
* when requesting the same value again and again
*
* @var array of numeric
......@@ -69,20 +69,6 @@ class Piwik_Archive_Single extends Piwik_Archive
*/
protected $idArchive = null;
/**
* name of requested report
*
* @var string
*/
protected $requestedReport = null;
/**
* scope of requested report (e.g. page)
*
* @var string
*/
protected $requestedReportScope = null;
/**
* Flag set to true once the archive has been checked (when we make sure it is archived)
*
......@@ -129,7 +115,7 @@ class Piwik_Archive_Single extends Piwik_Archive
}
/**
* Set the period
* Set the period
*
* @param Piwik_Period $period
*/
......@@ -164,7 +150,7 @@ class Piwik_Archive_Single extends Piwik_Archive
/**
* Prepares the archive. Gets the idarchive from the ArchiveProcessing.
*
*
* This will possibly launch the archiving process if the archive was not available.
*/
public function prepareArchive()
......@@ -211,8 +197,7 @@ class Piwik_Archive_Single extends Piwik_Archive
$this->archiveProcessing->init();
$this->archiveProcessing->setRequestedReport(
$this->getRequestedReport(), $this->getRequestedReportScope());
$this->archiveProcessing->setRequestedReport( $this->getRequestedReport() );
$archivingDisabledArchiveNotProcessed = false;
$idArchive = $this->archiveProcessing->loadArchive();
......@@ -248,7 +233,7 @@ class Piwik_Archive_Single extends Piwik_Archive
}
/**
* Returns a value from the current archive with the name = $name
* Returns a value from the current archive with the name = $name
* Method used by getNumeric or getBlob
*
* @param string $name
......@@ -287,7 +272,7 @@ class Piwik_Archive_Single extends Piwik_Archive
return false;
}
// select the table to use depending on the type of the data requested
// select the table to use depending on the type of the data requested
switch($typeValue)
{
case 'blob':
......@@ -301,20 +286,20 @@ class Piwik_Archive_Single extends Piwik_Archive
}
$db = Zend_Registry::get('db');
$value = $db->fetchOne("SELECT value
$value = $db->fetchOne("SELECT value
FROM $table
WHERE idarchive = ?
AND name = ?",
array( $this->idArchive , $name)
AND name = ?",
array( $this->idArchive , $name)
);
if($value === false)
{
if($typeValue == 'numeric'
if($typeValue == 'numeric'
&& $this->cacheEnabledForNumeric)
{
$this->numericCached[$name] = false;
}
}
return $value;
}
......@@ -324,7 +309,7 @@ class Piwik_Archive_Single extends Piwik_Archive
$value = $this->uncompress($value);
}
if($typeValue == 'numeric'
if($typeValue == 'numeric'
&& $this->cacheEnabledForNumeric)
{
$this->numericCached[$name] = $value;
......@@ -336,8 +321,8 @@ class Piwik_Archive_Single extends Piwik_Archive
/**
* This method loads in memory all the subtables for the main table called $name.
* You have to give it the parent table $dataTableToLoad so we can lookup the sub tables ids to load.
*
* If $addMetadataSubtableId set to true, it will add for each row a 'metadata' called 'databaseSubtableId'
*
* If $addMetadataSubtableId set to true, it will add for each row a 'metadata' called 'databaseSubtableId'
* containing the child ID of the subtable associated to this row.
*
* @param string $name
......@@ -347,7 +332,7 @@ class Piwik_Archive_Single extends Piwik_Archive
public function loadSubDataTables($name, Piwik_DataTable $dataTableToLoad, $addMetadataSubtableId = false)
{
// we have to recursively load all the subtables associated to this table's rows
// and update the subtableID so that it matches the newly instanciated table
// and update the subtableID so that it matches the newly instanciated table
foreach($dataTableToLoad->getRows() as $row)
{
$subTableID = $row->getIdSubDataTable();
......@@ -376,7 +361,7 @@ class Piwik_Archive_Single extends Piwik_Archive
*/
public function freeBlob( $name )
{
$this->blobCached[$name] = null;
$this->blobCached[$name] = null;
unset($this->blobCached[$name]);
}
......@@ -387,14 +372,14 @@ class Piwik_Archive_Single extends Piwik_Archive
/**
* Fetches all blob fields name_* at once for the current archive for performance reasons.
*
*
* @return false if no visits
*/
public function preFetchBlob( $name )
{
$this->setRequestedReport($name);
$this->prepareArchive();
if(!$this->isThereSomeVisits) { return; }
if(!$this->isThereSomeVisits) { return; }
$tableBlob = $this->archiveProcessing->getTableArchiveBlobName();
......@@ -403,8 +388,8 @@ class Piwik_Archive_Single extends Piwik_Archive
$query = $db->query("SELECT value, name
FROM $tableBlob
WHERE idarchive = ?
AND name LIKE '$name%'",
array( $this->idArchive )
AND name LIKE '$name%'",
array( $this->idArchive )
);
while($row = $query->fetch())
......@@ -449,24 +434,24 @@ class Piwik_Archive_Single extends Piwik_Archive
*/
public function getBlob( $name )
{
return $this->get($name, 'blob');
return $this->get($name, 'blob');
}
/**
* Given a list of fields defining numeric values, it will return a Piwik_DataTable_Simple
* Given a list of fields defining numeric values, it will return a Piwik_DataTable_Simple
* containing one row per field name.
*
*
* For example $fields = array( 'max_actions',
* 'nb_uniq_visitors',
* 'nb_uniq_visitors',
* 'nb_visits',
* 'nb_actions',
* 'nb_actions',
* 'sum_visit_length',
* 'bounce_count',
* 'nb_visits_converted'
* );
*
* @param string|array $fields Name or array of names of Archive fields
* );
*
* @param string|array $fields Name or array of names of Archive fields
*
* @return Piwik_DataTable_Simple
*/
public function getDataTableFromNumeric( $fields )
......@@ -512,7 +497,7 @@ class Piwik_Archive_Single extends Piwik_Archive
{
$table->addRowsFromSerializedArray($data);
}
if($data === false
if($data === false
&& $idSubTable !== null)
{
// This is not expected, but somehow happens in some unknown cases and very rarely.
......@@ -524,14 +509,9 @@ class Piwik_Archive_Single extends Piwik_Archive
return $table;
}
public function setRequestedReport($requestedReport, $scope=null)
public function setRequestedReport($requestedReport )
{
$this->requestedReport = $requestedReport;
if ($scope != null)
{
$this->requestedReportScope = $scope;
}
}
protected function getRequestedReport()
......@@ -542,9 +522,9 @@ class Piwik_Archive_Single extends Piwik_Archive
{
return 'VisitsSummary_CoreMetrics';
}
// VisitFrequency metrics don't follow the same naming convention (HACK)
// VisitFrequency metrics don't follow the same naming convention (HACK)
if(strpos($this->requestedReport, '_returning') > 0
// ignore Goal_visitor_returning_1_1_nb_conversions
// ignore Goal_visitor_returning_1_1_nb_conversions
&& strpos($this->requestedReport, 'Goal_') === false)
{
return 'VisitFrequency_Metrics';
......@@ -557,23 +537,18 @@ class Piwik_Archive_Single extends Piwik_Archive
return $this->requestedReport;
}
protected function getRequestedReportScope()
{
return $this->requestedReportScope;
}
/**
* Returns a DataTable that has the name '$name' from the current Archive.
* Also loads in memory all subDataTable for this DataTable.
*
*
* For example, if $name = 'Referers_keywordBySearchEngine' it will load all DataTable
* named 'Referers_keywordBySearchEngine_*' and they will be set as subDataTable to the
* rows. You can then go through the rows
* rows. You can then go through the rows
* $rows = DataTable->getRows();
* and for each row request the subDataTable (in this case the DataTable of the keywords for each search engines)
* $idSubTable = $row->getIdSubDataTable();
* $subTable = Piwik_DataTable_Manager::getInstance()->getTable($idSubTable);
*
*
* @param string $name
* @param int $idSubTable Optional subDataTable to load instead of loading the parent DataTable
* @return Piwik_DataTable
......@@ -585,6 +560,6 @@ class Piwik_Archive_Single extends Piwik_Archive
$this->loadSubDataTables($name, $dataTableToLoad, $addMetadataSubtableId = true);
$dataTableToLoad->enableRecursiveFilters();
$this->freeBlob($name);
return $dataTableToLoad;
return $dataTableToLoad;
}
}
<?php
/**
* Piwik - Open source web analytics
*
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
* @version $Id$
*
*
* @category Piwik
* @package Piwik
*/
......@@ -13,19 +13,19 @@
/**
* The ArchiveProcessing module is a module that reads the Piwik logs from the DB and
* compute all the reports, which are then stored in the database.
*
*
* The ArchiveProcessing class is used by the Archive object to make sure the given Archive is processed and available in the DB.
*
*
* A record in the Database for a given report is defined by
* - idarchive = unique ID that is associated to all the data of this archive (idsite+period+date)
* - idsite = the ID of the website
* - idsite = the ID of the website
* - date1 = starting day of the period
* - date2 = ending day of the period
* - period = integer that defines the period (day/week/etc.). @see period::getId()
* - ts_archived = timestamp when the archive was processed (UTC)
* - name = the name of the report (ex: uniq_visitors or search_keywords_by_search_engines)
* - value = the actual data
*
*
* @package Piwik
* @subpackage Piwik_ArchiveProcessing
*/
......@@ -49,7 +49,7 @@ abstract class Piwik_ArchiveProcessing
/**
* Flag indicates the archive is over a period that is not finished, eg. the current day, current week, etc.
* Archives flagged will be regularly purged from the DB.
*
*
* @var int
*/
const DONE_OK_TEMPORARY = 3;
......@@ -77,34 +77,34 @@ abstract class Piwik_ArchiveProcessing
/**
* Starting date of the archive
*
*
* @var Piwik_Date
*/
protected $dateStart;
/**
* Ending date of the archive
*
*
* @var Piwik_Date
*/
protected $dateEnd;
/**
* Object used to generate (depending on the $dateStart) the name of the DB table to use to store numeric values
*
*
* @var Piwik_TablePartitioning
*/
protected $tableArchiveNumeric;
/**
* Object used to generate (depending on the $dateStart) the name of the DB table to use to store numeric values
*
*
* @var Piwik_TablePartitioning
*/
protected $tableArchiveBlob;
/**
* Minimum timestamp looked at for processed archives
* Minimum timestamp looked at for processed archives
*
* @var int
*/
......@@ -119,7 +119,7 @@ abstract class Piwik_ArchiveProcessing
/**
* Is the current archive temporary. ie.
* - today
* - today
* - current week / month / year
*/
protected $temporaryArchive;
......@@ -127,7 +127,7 @@ abstract class Piwik_ArchiveProcessing
/**
* Id of the current site
* Can be accessed by plugins (that is why it's public)
*
*
* @var int
*/
public $idsite = null;
......@@ -135,7 +135,7 @@ abstract class Piwik_ArchiveProcessing
/**
* Period of the current archive
* Can be accessed by plugins (that is why it's public)
*
*
* @var Piwik_Period
*/
public $period = null;
......@@ -143,7 +143,7 @@ abstract class Piwik_ArchiveProcessing
/**
* Site of the current archive
* Can be accessed by plugins (that is why it's public)
*
*
* @var Piwik_Site
*/
public $site = null;
......@@ -220,7 +220,7 @@ abstract class Piwik_ArchiveProcessing
switch($name)
{
case 'day':
$process = new Piwik_ArchiveProcessing_Day();
$process = new Piwik_ArchiveProcessing_Day();
$process->debugAlwaysArchive = Zend_Registry::get('config')->Debug->always_archive_data_day;
break;
......@@ -249,9 +249,9 @@ abstract class Piwik_ArchiveProcessing
static public function getCoreMetrics()
{
return array(
'nb_uniq_visitors',
'nb_uniq_visitors',
'nb_visits',
'nb_actions',
'nb_actions',
'sum_visit_length',
'bounce_count',
'nb_visits_converted',
......@@ -317,7 +317,7 @@ abstract class Piwik_ArchiveProcessing
$this->tableArchiveNumeric->setIdSite($this->idsite);
$this->tableArchiveNumeric->setTimestamp($dateStartLocalTimezone->getTimestamp());
$this->tableArchiveBlob = new Piwik_TablePartitioning_Monthly('archive_blob');
$this->tableArchiveBlob->setIdSite($this->idsite);
$this->tableArchiveBlob->setIdSite($this->idsite);
$this->tableArchiveBlob->setTimestamp($dateStartLocalTimezone->getTimestamp());
$dateStartUTC = $dateStartLocalTimezone->setTimezone($this->site->getTimezone());
......@@ -349,7 +349,7 @@ abstract class Piwik_ArchiveProcessing
/**
* Returns the minimum archive processed datetime to look at
*
*
* @return string Datetime string, or false if must look at any archive available
*/
public function getMinTimeArchivedProcessed()
......@@ -363,15 +363,15 @@ abstract class Piwik_ArchiveProcessing
{
$this->temporaryArchive = true;
$minDatetimeArchiveProcessedUTC = $this->time - self::getTodayArchiveTimeToLive();
// see #1150; if new archives are not triggered from the browser,
// see #1150; if new archives are not triggered from the browser,
// we still want to try and return the latest archive available for today (rather than return nothing)
if($this->isArchivingDisabled())
{
return false;
}
}
// - if the period we are looking for is finished, we look for a ts_archived that
// is greater than the last day of the archive
// - if the period we are looking for is finished, we look for a ts_archived that
// is greater than the last day of the archive
elseif($this->endTimestampUTC <= $this->time)
{
$minDatetimeArchiveProcessedUTC = $this->endTimestampUTC+1;
......@@ -384,7 +384,7 @@ abstract class Piwik_ArchiveProcessing
// We choose to only look at archives that are newer than the specified timeout
$minDatetimeArchiveProcessedUTC = $this->time - self::getTodayArchiveTimeToLive();
// However, if archiving is disabled for this request, we shall
// However, if archiving is disabled for this request, we shall
// accept any archive that was processed today after 00:00:01 this morning
if($this->isArchivingDisabled())
{
......@@ -397,7 +397,7 @@ abstract class Piwik_ArchiveProcessing
/**
* This method returns the idArchive ; if necessary, it triggers the archiving process.
*
*
* If the archive was not processed yet, it will launch the archiving process.
* If the current archive needs sub-archives (eg. a month archive needs all the days archive)
* it will recursively launch the archiving (using this loadArchive() on the sub-periods)
......@@ -443,7 +443,7 @@ abstract class Piwik_ArchiveProcessing
}
/**
* This methods reads the subperiods if necessary,
* This methods reads the subperiods if necessary,
* and computes the archive of the current period.
*/
abstract protected function compute();
......@@ -458,7 +458,7 @@ abstract class Piwik_ArchiveProcessing
$pluginProcessed = self::getPluginBeingProcessed($this->getRequestedReport());
// Piwik::log("Plugin processed: $pluginProcessed");
if(!Piwik_PluginsManager::getInstance()->isPluginLoaded($pluginProcessed)
|| $flagArchiveAsAllPlugins
|| $flagArchiveAsAllPlugins
)
{
$pluginProcessed = 'all';
......@@ -477,7 +477,7 @@ abstract class Piwik_ArchiveProcessing
* When a segment is set, we shall only process the requested report (no more).
* The requested data set will return a lot faster if we only process these reports rather than all plugins.
* Similarly, when a period=range is requested, we shall only process the requested report for the range itself.
*
*
* @param string $pluginName
* @return bool
*/
......@@ -494,7 +494,7 @@ abstract class Piwik_ArchiveProcessing
$pluginBeingProcessed = self::getPluginBeingProcessed($this->getRequestedReport());
return $pluginBeingProcessed == $pluginName
|| !Piwik_PluginsManager::getInstance()->isPluginLoaded($pluginBeingProcessed)
;
;
}
/**
......@@ -514,24 +514,24 @@ abstract class Piwik_ArchiveProcessing
{
$temporary = 'temporary archive';
}
Piwik::log("'" . $this->period->getLabel() . "'"
.", idSite = ". $this->idsite." ($temporary)"
Piwik::log("'" . $this->period->getLabel() . "'"
.", idSite = ". $this->idsite." ($temporary)"
.", segment = '". $this->getSegment()->getString()."'"
.", report = '". $this->getRequestedReport()."'"
.", report = '". $this->getRequestedReport()."'"
.", UTC datetime [".$this->startDatetimeUTC." -> ".$this->endDatetimeUTC." ]...");
}
/**
* Post processing called at the end of the main archive processing.
* Makes sure the new archive is marked as "successful" in the DB
*
*
* We also try to delete some stuff from memory but really there is still a lot...
*/
protected function postCompute()
{
// delete the first done = ERROR
// delete the first done = ERROR
$done = $this->getDoneStringFlag();
Piwik_Query("DELETE FROM ".$this->tableArchiveNumeric->getTableName()."
Piwik_Query("DELETE FROM ".$this->tableArchiveNumeric->getTableName()."
WHERE idarchive = ? AND name = '".$done."'",
array($this->idArchive)
);
......@@ -547,7 +547,7 @@ abstract class Piwik_ArchiveProcessing
/**
* Returns the name of the numeric table where the archive numeric values are stored
*
* @return string
* @return string
*/
public function getTableArchiveNumericName()
{
......@@ -557,7 +557,7 @@ abstract class Piwik_ArchiveProcessing
/**
* Returns the name of the blob table where the archive blob values are stored
*
* @return string
* @return string
*/
public function getTableArchiveBlobName()
{
......@@ -569,12 +569,12 @@ abstract class Piwik_ArchiveProcessing
*
* @param Piwik_Period $period
*/
public function setPeriod( Piwik_Period $period )
public function setPeriod( Piwik_Period $period )
{
$this->period = $period;
}
public function setSegment( Piwik_Segment $segment)
public function setSegment( Piwik_Segment $segment)
{
$this->segment = $segment;
}
......@@ -593,21 +593,15 @@ abstract class Piwik_ArchiveProcessing
$this->site = $site;
}
public function setRequestedReport($requestedReport, $scope=null)
public function setRequestedReport($requestedReport)
{
$this->requestedReport = $requestedReport;
$this->requestedReportScope = $scope;
}
protected function getRequestedReport()
{
return $this->requestedReport;
}
protected function getRequestedReportScope()
{
return $this->requestedReportScope;
}
static public function getPluginBeingProcessed( $requestedReport )
{
......@@ -653,7 +647,7 @@ abstract class Piwik_ArchiveProcessing
protected function loadNextIdarchive()
{
$db = Zend_Registry::get('db');
$id = $db->fetchOne("SELECT max(idarchive)
$id = $db->fetchOne("SELECT max(idarchive)
FROM ".$this->tableArchiveNumeric->getTableName());
if(empty($id))
{
......@@ -676,7 +670,7 @@ abstract class Piwik_ArchiveProcessing
/**
* @param string $name
* @param string|array of string $aValues
* @return true
* @return true
*/
public function insertBlobRecord($name, $values)
{
......@@ -761,10 +755,10 @@ abstract class Piwik_ArchiveProcessing
protected function getBindArray()
{
return array( $this->idArchive,
$this->idsite,
$this->period->getDateStart()->toString('Y-m-d'),
$this->period->getDateEnd()->toString('Y-m-d'),
$this->periodId,
$this->idsite,
$this->period->getDateStart()->toString('Y-m-d'),
$this->period->getDateEnd()->toString('Y-m-d'),
$this->periodId,
date("Y-m-d H:i:s"));
}
......@@ -782,7 +776,7 @@ abstract class Piwik_ArchiveProcessing
// table to use to save the data
if(is_numeric($value))
{
// We choose not to record records with a value of 0
// We choose not to record records with a value of 0
if($value == 0)
{
return;
......@@ -796,7 +790,7 @@ abstract class Piwik_ArchiveProcessing
// duplicate idarchives are Ignored, see http://dev.piwik.org/trac/ticket/987
$query = "INSERT IGNORE INTO ".$table->getTableName()."
$query = "INSERT IGNORE INTO ".$table->getTableName()."
(". implode(", ", $this->getInsertFields()).")
VALUES (?,?,?,?,?,?,?,?)";
$bindSql = $this->getBindArray();
......@@ -809,7 +803,7 @@ abstract class Piwik_ArchiveProcessing
/**
* Returns the idArchive if the archive is available in the database.
* Returns false if the archive needs to be computed.
*
*
* An archive is available if
* - for today, the archive was computed less than minDatetimeArchiveProcessedUTC seconds ago
* - for any other day, if the archive was computed once this day was finished
......@@ -819,10 +813,10 @@ abstract class Piwik_ArchiveProcessing
*/
protected function isArchived()
{
$bindSQL = array( $this->idsite,
$this->period->getDateStart()->toString('Y-m-d'),
$this->period->getDateEnd()->toString('Y-m-d'),
$this->periodId,
$bindSQL = array( $this->idsite,
$this->period->getDateStart()->toString('Y-m-d'),
$this->period->getDateEnd()->toString('Y-m-d'),
$this->periodId,
);
$timeStampWhere = '';
......@@ -893,7 +887,7 @@ abstract class Piwik_ArchiveProcessing
// we look for the nb_visits result for this most recent archive
foreach($results as $result)
{
if($result['name'] == 'nb_visits'
if($result['name'] == 'nb_visits'
&& $result['idarchive'] == $idarchive)
{
$this->isThereSomeVisits = ($result['value'] > 0);
......@@ -906,7 +900,7 @@ abstract class Piwik_ArchiveProcessing
/**
* Returns true if, for some reasons, triggering the archiving is disabled.
* Note that when a segment is passed to the function, archiving will always occur
* Note that when a segment is passed to the function, archiving will always occur
* (since segments are by default not pre-processed)
*
* @return bool
......@@ -925,7 +919,7 @@ abstract class Piwik_ArchiveProcessing
{
return self::isBrowserTriggerArchivingEnabled()
|| Piwik_Common::isPhpCliMode()
|| (Piwik::isUserIsSuperUser()
|| (Piwik::isUserIsSuperUser()
&& Piwik_Common::isArchivePhpTriggered())
;
}
......
Ce diff est replié.
<?php
/**
* Piwik - Open source web analytics
*
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
* @version $Id$
*
*
* @category Piwik
* @package Piwik
*/
......@@ -22,7 +22,7 @@ class Piwik_Segment
protected $segment = null;
/**
* Truncate the Segments to 4k
* Truncate the Segments to 4k
*/
const SEGMENT_TRUNCATE_LIMIT = 4096;
......@@ -30,10 +30,10 @@ class Piwik_Segment
{
$string = Piwik_Common::unsanitizeInputValue($string);
$string = trim($string);
if( !Piwik_Archive::isSegmentationEnabled()
if( !Piwik_Archive::isSegmentationEnabled()
&& !empty($string))
{
throw new Exception("The Super User has disabled the use of 'segments' for the anonymous user.
throw new Exception("The Super User has disabled the use of 'segments' for the anonymous user.
Please log in to use Segmentation in the API.");
}
// As a preventive measure, we restrict the filter size to a safe limit
......@@ -77,7 +77,7 @@ class Piwik_Segment
{
$expressions = $this->segment->parsedSubExpressions;
$uniqueFields = array();
foreach($expressions as $expression)
foreach($expressions as $expression)
{
$uniqueFields[] = $expression[Piwik_SegmentExpression::INDEX_OPERAND][0];
}
......@@ -112,8 +112,8 @@ class Piwik_Segment
throw new Exception("You do not have enough permission to access the segment ".$name);
}
// $this->segmentsHumanReadable[] = $segment['name'] . " " .
// $this->getNameForMatchType($matchType) .
// $this->segmentsHumanReadable[] = $segment['name'] . " " .
// $this->getNameForMatchType($matchType) .
// $value;
// apply presentation filter
......@@ -166,7 +166,7 @@ class Piwik_Segment
return $return;
}
public function isSegmentAvailable($allowedSegments)
protected function isSegmentAvailable($allowedSegments)
{
$segments = $this->getUniqueSqlFields();
foreach($segments as $segment)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter