id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
209,400
matomo-org/matomo
core/DataTable.php
DataTable.deleteRow
public function deleteRow($id) { if ($id === self::ID_SUMMARY_ROW) { $this->summaryRow = null; return; } if (!isset($this->rows[$id])) { throw new Exception("Trying to delete unknown row with idkey = $id"); } unset($this->rows[$id]); }
php
public function deleteRow($id) { if ($id === self::ID_SUMMARY_ROW) { $this->summaryRow = null; return; } if (!isset($this->rows[$id])) { throw new Exception("Trying to delete unknown row with idkey = $id"); } unset($this->rows[$id]); }
[ "public", "function", "deleteRow", "(", "$", "id", ")", "{", "if", "(", "$", "id", "===", "self", "::", "ID_SUMMARY_ROW", ")", "{", "$", "this", "->", "summaryRow", "=", "null", ";", "return", ";", "}", "if", "(", "!", "isset", "(", "$", "this", ...
Deletes a row by ID. @param int $id The row ID. @throws Exception If the row `$id` cannot be found.
[ "Deletes", "a", "row", "by", "ID", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1139-L1149
209,401
matomo-org/matomo
core/DataTable.php
DataTable.isEqual
public static function isEqual(DataTable $table1, DataTable $table2) { $table1->rebuildIndex(); $table2->rebuildIndex(); if ($table1->getRowsCount() != $table2->getRowsCount()) { return false; } $rows1 = $table1->getRows(); foreach ($rows1 as $row1) { ...
php
public static function isEqual(DataTable $table1, DataTable $table2) { $table1->rebuildIndex(); $table2->rebuildIndex(); if ($table1->getRowsCount() != $table2->getRowsCount()) { return false; } $rows1 = $table1->getRows(); foreach ($rows1 as $row1) { ...
[ "public", "static", "function", "isEqual", "(", "DataTable", "$", "table1", ",", "DataTable", "$", "table2", ")", "{", "$", "table1", "->", "rebuildIndex", "(", ")", ";", "$", "table2", "->", "rebuildIndex", "(", ")", ";", "if", "(", "$", "table1", "->...
Returns true if both DataTable instances are exactly the same. DataTables are equal if they have the same number of rows, if each row has a label that exists in the other table, and if each row is equal to the row in the other table with the same label. The order of rows is not important. @param \Piwik\DataTable $tab...
[ "Returns", "true", "if", "both", "DataTable", "instances", "are", "exactly", "the", "same", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1225-L1246
209,402
matomo-org/matomo
core/DataTable.php
DataTable.getSerialized
public function getSerialized($maximumRowsInDataTable = null, $maximumRowsInSubDataTable = null, $columnToSortByBeforeTruncation = null, &$aSerializedDataTable = array()) { static $depth = 0; // mak...
php
public function getSerialized($maximumRowsInDataTable = null, $maximumRowsInSubDataTable = null, $columnToSortByBeforeTruncation = null, &$aSerializedDataTable = array()) { static $depth = 0; // mak...
[ "public", "function", "getSerialized", "(", "$", "maximumRowsInDataTable", "=", "null", ",", "$", "maximumRowsInSubDataTable", "=", "null", ",", "$", "columnToSortByBeforeTruncation", "=", "null", ",", "&", "$", "aSerializedDataTable", "=", "array", "(", ")", ")",...
Serializes an entire DataTable hierarchy and returns the array of serialized DataTables. The first element in the returned array will be the serialized representation of this DataTable. Every subsequent element will be a serialized subtable. This DataTable and subtables can optionally be truncated before being serial...
[ "Serializes", "an", "entire", "DataTable", "hierarchy", "and", "returns", "the", "array", "of", "serialized", "DataTables", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1280-L1348
209,403
matomo-org/matomo
core/DataTable.php
DataTable.addRowsFromSerializedArray
public function addRowsFromSerializedArray($serialized) { $rows = $this->unserializeRows($serialized); if (array_key_exists(self::ID_SUMMARY_ROW, $rows)) { if (is_array($rows[self::ID_SUMMARY_ROW])) { $this->summaryRow = new Row($rows[self::ID_SUMMARY_ROW]); ...
php
public function addRowsFromSerializedArray($serialized) { $rows = $this->unserializeRows($serialized); if (array_key_exists(self::ID_SUMMARY_ROW, $rows)) { if (is_array($rows[self::ID_SUMMARY_ROW])) { $this->summaryRow = new Row($rows[self::ID_SUMMARY_ROW]); ...
[ "public", "function", "addRowsFromSerializedArray", "(", "$", "serialized", ")", "{", "$", "rows", "=", "$", "this", "->", "unserializeRows", "(", "$", "serialized", ")", ";", "if", "(", "array_key_exists", "(", "self", "::", "ID_SUMMARY_ROW", ",", "$", "row...
Adds a set of rows from a serialized DataTable string. See {@link serialize()}. _Note: This function will successfully load DataTables serialized by Piwik 1.X._ @param string $serialized A string with the format of a string in the array returned by {@link serialize()}. @throws Exception if `$serialized` is invalid.
[ "Adds", "a", "set", "of", "rows", "from", "a", "serialized", "DataTable", "string", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1392-L1412
209,404
matomo-org/matomo
core/DataTable.php
DataTable.addRowsFromArray
public function addRowsFromArray($array) { foreach ($array as $id => $row) { if (is_array($row)) { $row = new Row($row); } if ($id == self::ID_SUMMARY_ROW) { $this->summaryRow = $row; } else { $this->addRow($row...
php
public function addRowsFromArray($array) { foreach ($array as $id => $row) { if (is_array($row)) { $row = new Row($row); } if ($id == self::ID_SUMMARY_ROW) { $this->summaryRow = $row; } else { $this->addRow($row...
[ "public", "function", "addRowsFromArray", "(", "$", "array", ")", "{", "foreach", "(", "$", "array", "as", "$", "id", "=>", "$", "row", ")", "{", "if", "(", "is_array", "(", "$", "row", ")", ")", "{", "$", "row", "=", "new", "Row", "(", "$", "r...
Adds multiple rows from an array. You can add row metadata with this method. @param array $array Array with the following structure array( // row1 array( Row::COLUMNS => array( col1_name => value1, col2_name => value2, ...), Row::METADATA => array( metadata1_name => value1, ...), // see Row ), // row2 array( ... ),...
[ "Adds", "multiple", "rows", "from", "an", "array", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1431-L1444
209,405
matomo-org/matomo
core/DataTable.php
DataTable.addRowsFromSimpleArray
public function addRowsFromSimpleArray($array) { if (count($array) === 0) { return; } $exceptionText = " Data structure returned is not convertible in the requested format." . " Try to call this method with the parameters '&format=original&serialize=1'" . ...
php
public function addRowsFromSimpleArray($array) { if (count($array) === 0) { return; } $exceptionText = " Data structure returned is not convertible in the requested format." . " Try to call this method with the parameters '&format=original&serialize=1'" . ...
[ "public", "function", "addRowsFromSimpleArray", "(", "$", "array", ")", "{", "if", "(", "count", "(", "$", "array", ")", "===", "0", ")", "{", "return", ";", "}", "$", "exceptionText", "=", "\" Data structure returned is not convertible in the requested format.\"", ...
Adds multiple rows from an array containing arrays of column values. Row metadata cannot be added with this method. @param array $array Array with the following structure: array( array( col1_name => valueA, col2_name => valueC, ...), array( col1_name => valueB, col2_name => valueD, ...), ) @throws Exception if `$arr...
[ "Adds", "multiple", "rows", "from", "an", "array", "containing", "arrays", "of", "column", "values", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1459-L1525
209,406
matomo-org/matomo
core/DataTable.php
DataTable.setMetadataValues
public function setMetadataValues($values) { foreach ($values as $name => $value) { $this->metadata[$name] = $value; } }
php
public function setMetadataValues($values) { foreach ($values as $name => $value) { $this->metadata[$name] = $value; } }
[ "public", "function", "setMetadataValues", "(", "$", "values", ")", "{", "foreach", "(", "$", "values", "as", "$", "name", "=>", "$", "value", ")", "{", "$", "this", "->", "metadata", "[", "$", "name", "]", "=", "$", "value", ";", "}", "}" ]
Sets several metadata values by name. @param array $values Array mapping metadata names with metadata values.
[ "Sets", "several", "metadata", "values", "by", "name", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1639-L1644
209,407
matomo-org/matomo
core/DataTable.php
DataTable.walkPath
public function walkPath($path, $missingRowColumns = false, $maxSubtableRows = 0) { $pathLength = count($path); $table = $this; $next = false; for ($i = 0; $i < $pathLength; ++$i) { $segment = $path[$i]; $next = $table->getRowFromLabel($segment); ...
php
public function walkPath($path, $missingRowColumns = false, $maxSubtableRows = 0) { $pathLength = count($path); $table = $this; $next = false; for ($i = 0; $i < $pathLength; ++$i) { $segment = $path[$i]; $next = $table->getRowFromLabel($segment); ...
[ "public", "function", "walkPath", "(", "$", "path", ",", "$", "missingRowColumns", "=", "false", ",", "$", "maxSubtableRows", "=", "0", ")", "{", "$", "pathLength", "=", "count", "(", "$", "path", ")", ";", "$", "table", "=", "$", "this", ";", "$", ...
Traverses a DataTable tree using an array of labels and returns the row it finds or `false` if it cannot find one. The number of path segments that were successfully walked is also returned. If `$missingRowColumns` is supplied, the specified path is created. When a subtable is encountered w/o the required label, a new...
[ "Traverses", "a", "DataTable", "tree", "using", "an", "array", "of", "labels", "and", "returns", "the", "row", "it", "finds", "or", "false", "if", "it", "cannot", "find", "one", ".", "The", "number", "of", "path", "segments", "that", "were", "successfully"...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1693-L1746
209,408
matomo-org/matomo
core/DataTable.php
DataTable.mergeSubtables
public function mergeSubtables($labelColumn = false, $useMetadataColumn = false) { $result = new DataTable(); $result->setAllTableMetadata($this->getAllTableMetadata()); foreach ($this->getRowsWithoutSummaryRow() as $row) { $subtable = $row->getSubtable(); if ($subtab...
php
public function mergeSubtables($labelColumn = false, $useMetadataColumn = false) { $result = new DataTable(); $result->setAllTableMetadata($this->getAllTableMetadata()); foreach ($this->getRowsWithoutSummaryRow() as $row) { $subtable = $row->getSubtable(); if ($subtab...
[ "public", "function", "mergeSubtables", "(", "$", "labelColumn", "=", "false", ",", "$", "useMetadataColumn", "=", "false", ")", "{", "$", "result", "=", "new", "DataTable", "(", ")", ";", "$", "result", "->", "setAllTableMetadata", "(", "$", "this", "->",...
Returns a new DataTable in which the rows of this table are replaced with the aggregatated rows of all its subtables. @param string|bool $labelColumn If supplied the label of the parent row will be added to a new column in each subtable row. If set to, `'label'` each subtable row's label will be prepended w/ the pare...
[ "Returns", "a", "new", "DataTable", "in", "which", "the", "rows", "of", "this", "table", "are", "replaced", "with", "the", "aggregatated", "rows", "of", "all", "its", "subtables", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1761-L1806
209,409
matomo-org/matomo
core/Segment/SegmentExpression.php
SegmentExpression.checkFieldIsAvailable
private function checkFieldIsAvailable($field, &$availableTables) { $fieldParts = explode('.', $field); $table = count($fieldParts) == 2 ? $fieldParts[0] : false; // remove sql functions from field name // example: `HOUR(log_visit.visit_last_action_time)` gets `HOUR(log_visit` => r...
php
private function checkFieldIsAvailable($field, &$availableTables) { $fieldParts = explode('.', $field); $table = count($fieldParts) == 2 ? $fieldParts[0] : false; // remove sql functions from field name // example: `HOUR(log_visit.visit_last_action_time)` gets `HOUR(log_visit` => r...
[ "private", "function", "checkFieldIsAvailable", "(", "$", "field", ",", "&", "$", "availableTables", ")", "{", "$", "fieldParts", "=", "explode", "(", "'.'", ",", "$", "field", ")", ";", "$", "table", "=", "count", "(", "$", "fieldParts", ")", "==", "2...
Check whether the field is available If not, add it to the available tables @param string $field @param array $availableTables
[ "Check", "whether", "the", "field", "is", "available", "If", "not", "add", "it", "to", "the", "available", "tables" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Segment/SegmentExpression.php#L335-L363
209,410
matomo-org/matomo
core/Segment/SegmentExpression.php
SegmentExpression.escapeLikeString
private function escapeLikeString($str) { if (false !== strpos($str, '%')) { $str = str_replace("%", "\%", $str); } if (false !== strpos($str, '_')) { $str = str_replace("_", "\_", $str); } return $str; }
php
private function escapeLikeString($str) { if (false !== strpos($str, '%')) { $str = str_replace("%", "\%", $str); } if (false !== strpos($str, '_')) { $str = str_replace("_", "\_", $str); } return $str; }
[ "private", "function", "escapeLikeString", "(", "$", "str", ")", "{", "if", "(", "false", "!==", "strpos", "(", "$", "str", ",", "'%'", ")", ")", "{", "$", "str", "=", "str_replace", "(", "\"%\"", ",", "\"\\%\"", ",", "$", "str", ")", ";", "}", "...
Escape the characters % and _ in the given string @param string $str @return string
[ "Escape", "the", "characters", "%", "and", "_", "in", "the", "given", "string" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Segment/SegmentExpression.php#L370-L381
209,411
matomo-org/matomo
core/Segment/SegmentExpression.php
SegmentExpression.parseTree
protected function parseTree() { $string = $this->string; if (empty($string)) { return array(); } $tree = array(); $i = 0; $length = strlen($string); $isBackslash = false; $operand = ''; while ($i <= $length) { $char = $...
php
protected function parseTree() { $string = $this->string; if (empty($string)) { return array(); } $tree = array(); $i = 0; $length = strlen($string); $isBackslash = false; $operand = ''; while ($i <= $length) { $char = $...
[ "protected", "function", "parseTree", "(", ")", "{", "$", "string", "=", "$", "this", "->", "string", ";", "if", "(", "empty", "(", "$", "string", ")", ")", "{", "return", "array", "(", ")", ";", "}", "$", "tree", "=", "array", "(", ")", ";", "...
Given a filter string, will parse it into an array where each row contains the boolean operator applied to it, and the operand @return array
[ "Given", "a", "filter", "string", "will", "parse", "it", "into", "an", "array", "where", "each", "row", "contains", "the", "boolean", "operator", "applied", "to", "it", "and", "the", "operand" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Segment/SegmentExpression.php#L390-L433
209,412
matomo-org/matomo
core/Segment/SegmentExpression.php
SegmentExpression.getSql
public function getSql() { if ($this->isEmpty()) { throw new Exception("Invalid segment, please specify a valid segment."); } $sql = ''; $subExpression = false; foreach ($this->tree as $expression) { $operator = $expression[self::INDEX_BOOL_OPERATOR]; ...
php
public function getSql() { if ($this->isEmpty()) { throw new Exception("Invalid segment, please specify a valid segment."); } $sql = ''; $subExpression = false; foreach ($this->tree as $expression) { $operator = $expression[self::INDEX_BOOL_OPERATOR]; ...
[ "public", "function", "getSql", "(", ")", "{", "if", "(", "$", "this", "->", "isEmpty", "(", ")", ")", "{", "throw", "new", "Exception", "(", "\"Invalid segment, please specify a valid segment.\"", ")", ";", "}", "$", "sql", "=", "''", ";", "$", "subExpres...
Given the array of parsed boolean logic, will return an array containing the full SQL string representing the filter, the needed joins and the values to bind to the query @throws Exception @return array SQL Query, Joins and Bind parameters
[ "Given", "the", "array", "of", "parsed", "boolean", "logic", "will", "return", "an", "array", "containing", "the", "full", "SQL", "string", "representing", "the", "filter", "the", "needed", "joins", "and", "the", "values", "to", "bind", "to", "the", "query" ...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Segment/SegmentExpression.php#L443-L482
209,413
matomo-org/matomo
core/Tracker.php
Tracker.initCorePiwikInTrackerMode
public static function initCorePiwikInTrackerMode() { if (SettingsServer::isTrackerApiRequest() && self::$initTrackerMode === false ) { self::$initTrackerMode = true; require_once PIWIK_INCLUDE_PATH . '/core/Option.php'; Access::getInstance(); ...
php
public static function initCorePiwikInTrackerMode() { if (SettingsServer::isTrackerApiRequest() && self::$initTrackerMode === false ) { self::$initTrackerMode = true; require_once PIWIK_INCLUDE_PATH . '/core/Option.php'; Access::getInstance(); ...
[ "public", "static", "function", "initCorePiwikInTrackerMode", "(", ")", "{", "if", "(", "SettingsServer", "::", "isTrackerApiRequest", "(", ")", "&&", "self", "::", "$", "initTrackerMode", "===", "false", ")", "{", "self", "::", "$", "initTrackerMode", "=", "t...
Used to initialize core Piwik components on a piwik.php request Eg. when cache is missed and we will be calling some APIs to generate cache
[ "Used", "to", "initialize", "core", "Piwik", "components", "on", "a", "piwik", ".", "php", "request", "Eg", ".", "when", "cache", "is", "missed", "and", "we", "will", "be", "calling", "some", "APIs", "to", "generate", "cache" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker.php#L150-L169
209,414
matomo-org/matomo
core/Widget/WidgetConfig.php
WidgetConfig.getUniqueId
public function getUniqueId() { $parameters = $this->getParameters(); unset($parameters['module']); unset($parameters['action']); return WidgetsList::getWidgetUniqueId($this->getModule(), $this->getAction(), $parameters); }
php
public function getUniqueId() { $parameters = $this->getParameters(); unset($parameters['module']); unset($parameters['action']); return WidgetsList::getWidgetUniqueId($this->getModule(), $this->getAction(), $parameters); }
[ "public", "function", "getUniqueId", "(", ")", "{", "$", "parameters", "=", "$", "this", "->", "getParameters", "(", ")", ";", "unset", "(", "$", "parameters", "[", "'module'", "]", ")", ";", "unset", "(", "$", "parameters", "[", "'action'", "]", ")", ...
Returns the unique id of an widget based on module, action and the set parameters. @return string
[ "Returns", "the", "unique", "id", "of", "an", "widget", "based", "on", "module", "action", "and", "the", "set", "parameters", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Widget/WidgetConfig.php#L270-L277
209,415
matomo-org/matomo
plugins/UsersManager/UserUpdater.php
UserUpdater.updateUserWithoutCurrentPassword
public function updateUserWithoutCurrentPassword($userLogin, $password = false, $email = false, $alias = false, $_isPasswordHashed = false) { API::$UPDATE_USER_REQUIRE_PASSWORD_CONFIRMATION = false; try { Request::processRequest('Users...
php
public function updateUserWithoutCurrentPassword($userLogin, $password = false, $email = false, $alias = false, $_isPasswordHashed = false) { API::$UPDATE_USER_REQUIRE_PASSWORD_CONFIRMATION = false; try { Request::processRequest('Users...
[ "public", "function", "updateUserWithoutCurrentPassword", "(", "$", "userLogin", ",", "$", "password", "=", "false", ",", "$", "email", "=", "false", ",", "$", "alias", "=", "false", ",", "$", "_isPasswordHashed", "=", "false", ")", "{", "API", "::", "$", ...
Use this method if you have to update the user without having the ability to ask the user for a password confirmation @param $userLogin @param bool $password @param bool $email @param bool $alias @param bool $_isPasswordHashed @throws \Exception
[ "Use", "this", "method", "if", "you", "have", "to", "update", "the", "user", "without", "having", "the", "ability", "to", "ask", "the", "user", "for", "a", "password", "confirmation" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/UserUpdater.php#L25-L42
209,416
matomo-org/matomo
core/Db/BatchInsert.php
BatchInsert.tableInsertBatchIterate
public static function tableInsertBatchIterate($tableName, $fields, $values, $ignoreWhenDuplicate = true) { $fieldList = '(' . join(',', $fields) . ')'; $ignore = $ignoreWhenDuplicate ? 'IGNORE' : ''; foreach ($values as $row) { $query = "INSERT $ignore INTO " . $tableName . ...
php
public static function tableInsertBatchIterate($tableName, $fields, $values, $ignoreWhenDuplicate = true) { $fieldList = '(' . join(',', $fields) . ')'; $ignore = $ignoreWhenDuplicate ? 'IGNORE' : ''; foreach ($values as $row) { $query = "INSERT $ignore INTO " . $tableName . ...
[ "public", "static", "function", "tableInsertBatchIterate", "(", "$", "tableName", ",", "$", "fields", ",", "$", "values", ",", "$", "ignoreWhenDuplicate", "=", "true", ")", "{", "$", "fieldList", "=", "'('", ".", "join", "(", "','", ",", "$", "fields", "...
Performs a batch insert into a specific table by iterating through the data NOTE: you should use tableInsertBatch() which will fallback to this function if LOAD DATA INFILE not available @param string $tableName PREFIXED table name! you must call Common::prefixTable() before passing the table name @param array $field...
[ "Performs", "a", "batch", "insert", "into", "a", "specific", "table", "by", "iterating", "through", "the", "data" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/BatchInsert.php#L31-L42
209,417
matomo-org/matomo
libs/HTML/QuickForm2.php
HTML_QuickForm2.setDataSources
public function setDataSources(array $datasources) { foreach ($datasources as $ds) { if (!$ds instanceof HTML_QuickForm2_DataSource) { throw new HTML_QuickForm2_InvalidArgumentException( 'Array should contain only DataSource instances' ); ...
php
public function setDataSources(array $datasources) { foreach ($datasources as $ds) { if (!$ds instanceof HTML_QuickForm2_DataSource) { throw new HTML_QuickForm2_InvalidArgumentException( 'Array should contain only DataSource instances' ); ...
[ "public", "function", "setDataSources", "(", "array", "$", "datasources", ")", "{", "foreach", "(", "$", "datasources", "as", "$", "ds", ")", "{", "if", "(", "!", "$", "ds", "instanceof", "HTML_QuickForm2_DataSource", ")", "{", "throw", "new", "HTML_QuickFor...
Replaces the list of form's data sources with a completely new one @param array A new data source list @throws HTML_QuickForm2_InvalidArgumentException if given array contains something that is not a valid data source
[ "Replaces", "the", "list", "of", "form", "s", "data", "sources", "with", "a", "completely", "new", "one" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2.php#L157-L168
209,418
matomo-org/matomo
libs/HTML/QuickForm2.php
HTML_QuickForm2.render
public function render(HTML_QuickForm2_Renderer $renderer) { $renderer->startForm($this); $renderer->getJavascriptBuilder()->startForm($this); foreach ($this as $element) { $element->render($renderer); } $renderer->finishForm($this); return $renderer; ...
php
public function render(HTML_QuickForm2_Renderer $renderer) { $renderer->startForm($this); $renderer->getJavascriptBuilder()->startForm($this); foreach ($this as $element) { $element->render($renderer); } $renderer->finishForm($this); return $renderer; ...
[ "public", "function", "render", "(", "HTML_QuickForm2_Renderer", "$", "renderer", ")", "{", "$", "renderer", "->", "startForm", "(", "$", "this", ")", ";", "$", "renderer", "->", "getJavascriptBuilder", "(", ")", "->", "startForm", "(", "$", "this", ")", "...
Renders the form using the given renderer @param HTML_QuickForm2_Renderer Renderer instance @return HTML_QuickForm2_Renderer
[ "Renders", "the", "form", "using", "the", "given", "renderer" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2.php#L213-L222
209,419
matomo-org/matomo
core/Notification.php
Notification.getPriority
public function getPriority() { if (!isset($this->priority)) { $typeToPriority = array(static::CONTEXT_ERROR => static::PRIORITY_MAX, static::CONTEXT_WARNING => static::PRIORITY_HIGH, static::CONTEXT_SUCCESS => static::PRI...
php
public function getPriority() { if (!isset($this->priority)) { $typeToPriority = array(static::CONTEXT_ERROR => static::PRIORITY_MAX, static::CONTEXT_WARNING => static::PRIORITY_HIGH, static::CONTEXT_SUCCESS => static::PRI...
[ "public", "function", "getPriority", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "priority", ")", ")", "{", "$", "typeToPriority", "=", "array", "(", "static", "::", "CONTEXT_ERROR", "=>", "static", "::", "PRIORITY_MAX", ",", "static"...
Returns the notification's priority. If no priority has been set, a priority will be set based on the notification's context. @return int
[ "Returns", "the", "notification", "s", "priority", ".", "If", "no", "priority", "has", "been", "set", "a", "priority", "will", "be", "set", "based", "on", "the", "notification", "s", "context", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Notification.php#L197-L213
209,420
matomo-org/matomo
plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php
ServerModule.isAvailable
public function isAvailable() { if (function_exists('apache_get_modules')) { foreach (apache_get_modules() as $name) { if (strpos($name, 'maxminddb') !== false) { return true; } } } $settings = self::getGeoIpServerV...
php
public function isAvailable() { if (function_exists('apache_get_modules')) { foreach (apache_get_modules() as $name) { if (strpos($name, 'maxminddb') !== false) { return true; } } } $settings = self::getGeoIpServerV...
[ "public", "function", "isAvailable", "(", ")", "{", "if", "(", "function_exists", "(", "'apache_get_modules'", ")", ")", "{", "foreach", "(", "apache_get_modules", "(", ")", "as", "$", "name", ")", "{", "if", "(", "strpos", "(", "$", "name", ",", "'maxmi...
Checks if an mod_maxminddb has been installed and MMDB_ADDR server variable is defined. There's a special check for the Apache module, but we can't check specifically for anything else. @return bool|string
[ "Checks", "if", "an", "mod_maxminddb", "has", "been", "installed", "and", "MMDB_ADDR", "server", "variable", "is", "defined", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php#L139-L173
209,421
matomo-org/matomo
plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php
ServerModule.isWorking
public function isWorking() { $settings = self::getGeoIpServerVars(); $available = array_key_exists($settings[self::CONTINENT_CODE_KEY], $_SERVER) || array_key_exists($settings[self::COUNTRY_CODE_KEY], $_SERVER) || array_key_exists($settings[self::REGION_CODE_KEY], $_SERVER)...
php
public function isWorking() { $settings = self::getGeoIpServerVars(); $available = array_key_exists($settings[self::CONTINENT_CODE_KEY], $_SERVER) || array_key_exists($settings[self::COUNTRY_CODE_KEY], $_SERVER) || array_key_exists($settings[self::REGION_CODE_KEY], $_SERVER)...
[ "public", "function", "isWorking", "(", ")", "{", "$", "settings", "=", "self", "::", "getGeoIpServerVars", "(", ")", ";", "$", "available", "=", "array_key_exists", "(", "$", "settings", "[", "self", "::", "CONTINENT_CODE_KEY", "]", ",", "$", "_SERVER", "...
Returns true if the MMDB_ADDR server variable is defined. @return bool
[ "Returns", "true", "if", "the", "MMDB_ADDR", "server", "variable", "is", "defined", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php#L180-L194
209,422
matomo-org/matomo
plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php
ServerModule.isSameOrAnonymizedIp
public static function isSameOrAnonymizedIp($ip, $currentIp) { $ip = array_reverse(explode('.', $ip)); $currentIp = array_reverse(explode('.', $currentIp)); if (count($ip) != count($currentIp)) { return false; } foreach ($ip as $i => $byte) { if ($by...
php
public static function isSameOrAnonymizedIp($ip, $currentIp) { $ip = array_reverse(explode('.', $ip)); $currentIp = array_reverse(explode('.', $currentIp)); if (count($ip) != count($currentIp)) { return false; } foreach ($ip as $i => $byte) { if ($by...
[ "public", "static", "function", "isSameOrAnonymizedIp", "(", "$", "ip", ",", "$", "currentIp", ")", "{", "$", "ip", "=", "array_reverse", "(", "explode", "(", "'.'", ",", "$", "ip", ")", ")", ";", "$", "currentIp", "=", "array_reverse", "(", "explode", ...
Checks if two IP addresses are the same or if the first is the anonymized version of the other. @param string $ip @param string $currentIp This IP should not be anonymized. @return bool
[ "Checks", "if", "two", "IP", "addresses", "are", "the", "same", "or", "if", "the", "first", "is", "the", "anonymized", "version", "of", "the", "other", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php#L271-L294
209,423
matomo-org/matomo
plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php
ServerModule.getGeoIpServerVars
protected static function getGeoIpServerVars($type = null) { $storedSettings = self::getSystemSettingsValues(); if ($type === null) { return $storedSettings; } if (array_key_exists($type, $storedSettings)) { return $storedSettings[$type]; } ...
php
protected static function getGeoIpServerVars($type = null) { $storedSettings = self::getSystemSettingsValues(); if ($type === null) { return $storedSettings; } if (array_key_exists($type, $storedSettings)) { return $storedSettings[$type]; } ...
[ "protected", "static", "function", "getGeoIpServerVars", "(", "$", "type", "=", "null", ")", "{", "$", "storedSettings", "=", "self", "::", "getSystemSettingsValues", "(", ")", ";", "if", "(", "$", "type", "===", "null", ")", "{", "return", "$", "storedSet...
Returns currently configured server variable name for given type @param string|null $type @return mixed|string
[ "Returns", "currently", "configured", "server", "variable", "name", "for", "given", "type" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php#L302-L315
209,424
matomo-org/matomo
core/Archive/ArchivePurger.php
ArchivePurger.purge
protected function purge(array $idArchivesToDelete, Date $dateStart, $reason) { $deletedRowCount = 0; if (!empty($idArchivesToDelete)) { $deletedRowCount = $this->deleteArchiveIds($dateStart, $idArchivesToDelete); $this->logger->info( "Deleted {count} rows in...
php
protected function purge(array $idArchivesToDelete, Date $dateStart, $reason) { $deletedRowCount = 0; if (!empty($idArchivesToDelete)) { $deletedRowCount = $this->deleteArchiveIds($dateStart, $idArchivesToDelete); $this->logger->info( "Deleted {count} rows in...
[ "protected", "function", "purge", "(", "array", "$", "idArchivesToDelete", ",", "Date", "$", "dateStart", ",", "$", "reason", ")", "{", "$", "deletedRowCount", "=", "0", ";", "if", "(", "!", "empty", "(", "$", "idArchivesToDelete", ")", ")", "{", "$", ...
Purge all numeric and blob archives with the given IDs from the database. @param array $idArchivesToDelete @param Date $dateStart @param string $reason @return int
[ "Purge", "all", "numeric", "and", "blob", "archives", "with", "the", "given", "IDs", "from", "the", "database", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/ArchivePurger.php#L185-L211
209,425
matomo-org/matomo
core/Archive/ArchivePurger.php
ArchivePurger.purgeArchivesWithPeriodRange
public function purgeArchivesWithPeriodRange(Date $date) { $numericTable = ArchiveTableCreator::getNumericTable($date); $blobTable = ArchiveTableCreator::getBlobTable($date); $deletedCount = $this->model->deleteArchivesWithPeriod( $numericTable, $blobTable, Piwik::$idPeriods[...
php
public function purgeArchivesWithPeriodRange(Date $date) { $numericTable = ArchiveTableCreator::getNumericTable($date); $blobTable = ArchiveTableCreator::getBlobTable($date); $deletedCount = $this->model->deleteArchivesWithPeriod( $numericTable, $blobTable, Piwik::$idPeriods[...
[ "public", "function", "purgeArchivesWithPeriodRange", "(", "Date", "$", "date", ")", "{", "$", "numericTable", "=", "ArchiveTableCreator", "::", "getNumericTable", "(", "$", "date", ")", ";", "$", "blobTable", "=", "ArchiveTableCreator", "::", "getBlobTable", "(",...
Deleting "Custom Date Range" reports after 1 day, since they can be re-processed and would take up un-necessary space. @param $date Date @return int The total number of rows deleted from both the numeric & blob table.
[ "Deleting", "Custom", "Date", "Range", "reports", "after", "1", "day", "since", "they", "can", "be", "re", "-", "processed", "and", "would", "take", "up", "un", "-", "necessary", "space", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/ArchivePurger.php#L252-L270
209,426
matomo-org/matomo
core/Archive/ArchivePurger.php
ArchivePurger.deleteArchiveIds
protected function deleteArchiveIds(Date $date, $idArchivesToDelete) { $batches = array_chunk($idArchivesToDelete, 1000); $numericTable = ArchiveTableCreator::getNumericTable($date); $blobTable = ArchiveTableCreator::getBlobTable($date); $deletedCount = 0; foreach ($...
php
protected function deleteArchiveIds(Date $date, $idArchivesToDelete) { $batches = array_chunk($idArchivesToDelete, 1000); $numericTable = ArchiveTableCreator::getNumericTable($date); $blobTable = ArchiveTableCreator::getBlobTable($date); $deletedCount = 0; foreach ($...
[ "protected", "function", "deleteArchiveIds", "(", "Date", "$", "date", ",", "$", "idArchivesToDelete", ")", "{", "$", "batches", "=", "array_chunk", "(", "$", "idArchivesToDelete", ",", "1000", ")", ";", "$", "numericTable", "=", "ArchiveTableCreator", "::", "...
Deletes by batches Archive IDs in the specified month, @param Date $date @param $idArchivesToDelete @return int Number of rows deleted from both numeric + blob table.
[ "Deletes", "by", "batches", "Archive", "IDs", "in", "the", "specified", "month" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/ArchivePurger.php#L279-L290
209,427
matomo-org/matomo
plugins/SitesManager/API.php
API.getJavascriptTag
public function getJavascriptTag($idSite, $piwikUrl = '', $mergeSubdomains = false, $groupPageTitlesByDomain = false, $mergeAliasUrls = false, $visitorCustomVariables = false, $pageCustomVariables = false, $customCampaignNameQueryParam = false, $...
php
public function getJavascriptTag($idSite, $piwikUrl = '', $mergeSubdomains = false, $groupPageTitlesByDomain = false, $mergeAliasUrls = false, $visitorCustomVariables = false, $pageCustomVariables = false, $customCampaignNameQueryParam = false, $...
[ "public", "function", "getJavascriptTag", "(", "$", "idSite", ",", "$", "piwikUrl", "=", "''", ",", "$", "mergeSubdomains", "=", "false", ",", "$", "groupPageTitlesByDomain", "=", "false", ",", "$", "mergeAliasUrls", "=", "false", ",", "$", "visitorCustomVaria...
Returns the javascript tag for the given idSite. This tag must be included on every page to be tracked by Matomo @param int $idSite @param string $piwikUrl @param bool $mergeSubdomains @param bool $groupPageTitlesByDomain @param bool $mergeAliasUrls @param bool $visitorCustomVariables @param bool $pageCustomVariables ...
[ "Returns", "the", "javascript", "tag", "for", "the", "given", "idSite", ".", "This", "tag", "must", "be", "included", "on", "every", "page", "to", "be", "tracked", "by", "Matomo" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L107-L138
209,428
matomo-org/matomo
plugins/SitesManager/API.php
API.getImageTrackingCode
public function getImageTrackingCode($idSite, $piwikUrl = '', $actionName = false, $idGoal = false, $revenue = false, $forceMatomoEndpoint = false) { $urlParams = array('idsite' => $idSite, 'rec' => 1); if ($actionName !== false) { $urlParams['action_name'] = urlencode(Common::unsanitiz...
php
public function getImageTrackingCode($idSite, $piwikUrl = '', $actionName = false, $idGoal = false, $revenue = false, $forceMatomoEndpoint = false) { $urlParams = array('idsite' => $idSite, 'rec' => 1); if ($actionName !== false) { $urlParams['action_name'] = urlencode(Common::unsanitiz...
[ "public", "function", "getImageTrackingCode", "(", "$", "idSite", ",", "$", "piwikUrl", "=", "''", ",", "$", "actionName", "=", "false", ",", "$", "idGoal", "=", "false", ",", "$", "revenue", "=", "false", ",", "$", "forceMatomoEndpoint", "=", "false", "...
Returns image link tracking code for a given site with specified options. @param int $idSite The ID to generate tracking code for. @param string $piwikUrl The domain and URL path to the Matomo installation. @param int $idGoal An ID for a goal to trigger a conversion for. @param int $revenue The revenue of the goal con...
[ "Returns", "image", "link", "tracking", "code", "for", "a", "given", "site", "with", "specified", "options", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L150-L188
209,429
matomo-org/matomo
plugins/SitesManager/API.php
API.getAllSites
public function getAllSites() { Piwik::checkUserHasSuperUserAccess(); $sites = $this->getModel()->getAllSites(); $return = array(); foreach ($sites as $site) { $this->enrichSite($site); $return[$site['idsite']] = $site; } $return = Site::set...
php
public function getAllSites() { Piwik::checkUserHasSuperUserAccess(); $sites = $this->getModel()->getAllSites(); $return = array(); foreach ($sites as $site) { $this->enrichSite($site); $return[$site['idsite']] = $site; } $return = Site::set...
[ "public", "function", "getAllSites", "(", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "sites", "=", "$", "this", "->", "getModel", "(", ")", "->", "getAllSites", "(", ")", ";", "$", "return", "=", "array", "(", ")", ";",...
Returns all websites, requires Super User access @return array The list of websites, indexed by idsite
[ "Returns", "all", "websites", "requires", "Super", "User", "access" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L276-L290
209,430
matomo-org/matomo
plugins/SitesManager/API.php
API.getSitesIdWithVisits
public function getSitesIdWithVisits($timestamp = false) { Piwik::checkUserHasSuperUserAccess(); if (empty($timestamp)) $timestamp = time(); $time = Date::factory((int)$timestamp)->getDatetime(); $now = Date::now()->addHour(1)->getDatetime(); $result = $this->getModel...
php
public function getSitesIdWithVisits($timestamp = false) { Piwik::checkUserHasSuperUserAccess(); if (empty($timestamp)) $timestamp = time(); $time = Date::factory((int)$timestamp)->getDatetime(); $now = Date::now()->addHour(1)->getDatetime(); $result = $this->getModel...
[ "public", "function", "getSitesIdWithVisits", "(", "$", "timestamp", "=", "false", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "if", "(", "empty", "(", "$", "timestamp", ")", ")", "$", "timestamp", "=", "time", "(", ")", ";", "...
Returns the list of the website IDs that received some visits since the specified timestamp. Requires Super User access. @param bool|int $timestamp @return array The list of website IDs @deprecated since 2.15 This method will be removed in Matomo 3.0, there is no replacement.
[ "Returns", "the", "list", "of", "the", "website", "IDs", "that", "received", "some", "visits", "since", "the", "specified", "timestamp", ".", "Requires", "Super", "User", "access", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L317-L334
209,431
matomo-org/matomo
plugins/SitesManager/API.php
API.getSitesWithAdminAccess
public function getSitesWithAdminAccess($fetchAliasUrls = false, $pattern = false, $limit = false) { $sitesId = $this->getSitesIdWithAdminAccess(); if ($pattern === false) { $sites = $this->getSitesFromIds($sitesId, $limit); } else { $sites = $this->getModel()->getPa...
php
public function getSitesWithAdminAccess($fetchAliasUrls = false, $pattern = false, $limit = false) { $sitesId = $this->getSitesIdWithAdminAccess(); if ($pattern === false) { $sites = $this->getSitesFromIds($sitesId, $limit); } else { $sites = $this->getModel()->getPa...
[ "public", "function", "getSitesWithAdminAccess", "(", "$", "fetchAliasUrls", "=", "false", ",", "$", "pattern", "=", "false", ",", "$", "limit", "=", "false", ")", "{", "$", "sitesId", "=", "$", "this", "->", "getSitesIdWithAdminAccess", "(", ")", ";", "if...
Returns the list of websites with the 'admin' access for the current user. For the superUser it returns all the websites in the database. @param bool $fetchAliasUrls @param false|string $pattern @param false|int $limit @return array for each site, an array of information (idsite, name, main_url, etc.)
[ "Returns", "the", "list", "of", "websites", "with", "the", "admin", "access", "for", "the", "current", "user", ".", "For", "the", "superUser", "it", "returns", "all", "the", "websites", "in", "the", "database", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L345-L368
209,432
matomo-org/matomo
plugins/SitesManager/API.php
API.getSitesWithAtLeastViewAccess
public function getSitesWithAtLeastViewAccess($limit = false, $_restrictSitesToLogin = false) { $sitesId = $this->getSitesIdWithAtLeastViewAccess($_restrictSitesToLogin); return $this->getSitesFromIds($sitesId, $limit); }
php
public function getSitesWithAtLeastViewAccess($limit = false, $_restrictSitesToLogin = false) { $sitesId = $this->getSitesIdWithAtLeastViewAccess($_restrictSitesToLogin); return $this->getSitesFromIds($sitesId, $limit); }
[ "public", "function", "getSitesWithAtLeastViewAccess", "(", "$", "limit", "=", "false", ",", "$", "_restrictSitesToLogin", "=", "false", ")", "{", "$", "sitesId", "=", "$", "this", "->", "getSitesIdWithAtLeastViewAccess", "(", "$", "_restrictSitesToLogin", ")", ";...
Returns the list of websites with the 'view' or 'admin' access for the current user. For the superUser it returns all the websites in the database. @param bool|int $limit Specify max number of sites to return @param bool $_restrictSitesToLogin Hack necessary when running scheduled tasks, where "Super User" is forced, ...
[ "Returns", "the", "list", "of", "websites", "with", "the", "view", "or", "admin", "access", "for", "the", "current", "user", ".", "For", "the", "superUser", "it", "returns", "all", "the", "websites", "in", "the", "database", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L390-L394
209,433
matomo-org/matomo
plugins/SitesManager/API.php
API.getSitesIdWithAtLeastViewAccess
public function getSitesIdWithAtLeastViewAccess($_restrictSitesToLogin = false) { /** @var Scheduler $scheduler */ $scheduler = StaticContainer::getContainer()->get('Piwik\Scheduler\Scheduler'); if (Piwik::hasUserSuperUserAccess() && !$scheduler->isRunningTask()) { return Access...
php
public function getSitesIdWithAtLeastViewAccess($_restrictSitesToLogin = false) { /** @var Scheduler $scheduler */ $scheduler = StaticContainer::getContainer()->get('Piwik\Scheduler\Scheduler'); if (Piwik::hasUserSuperUserAccess() && !$scheduler->isRunningTask()) { return Access...
[ "public", "function", "getSitesIdWithAtLeastViewAccess", "(", "$", "_restrictSitesToLogin", "=", "false", ")", "{", "/** @var Scheduler $scheduler */", "$", "scheduler", "=", "StaticContainer", "::", "getContainer", "(", ")", "->", "get", "(", "'Piwik\\Scheduler\\Schedule...
Returns the list of websites ID with the 'view' or 'admin' access for the current user. For the superUser it returns all the websites in the database. @param bool $_restrictSitesToLogin @return array list of websites ID
[ "Returns", "the", "list", "of", "websites", "ID", "with", "the", "view", "or", "admin", "access", "for", "the", "current", "user", ".", "For", "the", "superUser", "it", "returns", "all", "the", "websites", "in", "the", "database", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L437-L469
209,434
matomo-org/matomo
plugins/SitesManager/API.php
API.getSitesFromIds
private function getSitesFromIds($idSites, $limit = false) { $sites = $this->getModel()->getSitesFromIds($idSites, $limit); foreach ($sites as &$site) { $this->enrichSite($site); } $sites = Site::setSitesFromArray($sites); return $sites; }
php
private function getSitesFromIds($idSites, $limit = false) { $sites = $this->getModel()->getSitesFromIds($idSites, $limit); foreach ($sites as &$site) { $this->enrichSite($site); } $sites = Site::setSitesFromArray($sites); return $sites; }
[ "private", "function", "getSitesFromIds", "(", "$", "idSites", ",", "$", "limit", "=", "false", ")", "{", "$", "sites", "=", "$", "this", "->", "getModel", "(", ")", "->", "getSitesFromIds", "(", "$", "idSites", ",", "$", "limit", ")", ";", "foreach", ...
Returns the list of websites from the ID array in parameters. The user access is not checked in this method so the ID have to be accessible by the user! @param array $idSites list of website ID @param bool $limit @return array
[ "Returns", "the", "list", "of", "websites", "from", "the", "ID", "array", "in", "parameters", ".", "The", "user", "access", "is", "not", "checked", "in", "this", "method", "so", "the", "ID", "have", "to", "be", "accessible", "by", "the", "user!" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L479-L490
209,435
matomo-org/matomo
plugins/SitesManager/API.php
API.addSiteAliasUrls
public function addSiteAliasUrls($idSite, $urls) { Piwik::checkUserHasAdminAccess($idSite); if (empty($urls)) { return 0; } if (!is_array($urls)) { $urls = array($urls); } $urlsInit = $this->getSiteUrlsFromId($idSite); $toInsert = ar...
php
public function addSiteAliasUrls($idSite, $urls) { Piwik::checkUserHasAdminAccess($idSite); if (empty($urls)) { return 0; } if (!is_array($urls)) { $urls = array($urls); } $urlsInit = $this->getSiteUrlsFromId($idSite); $toInsert = ar...
[ "public", "function", "addSiteAliasUrls", "(", "$", "idSite", ",", "$", "urls", ")", "{", "Piwik", "::", "checkUserHasAdminAccess", "(", "$", "idSite", ")", ";", "if", "(", "empty", "(", "$", "urls", ")", ")", "{", "return", "0", ";", "}", "if", "(",...
Add a list of alias Urls to the given idSite If some URLs given in parameter are already recorded as alias URLs for this website, they won't be duplicated. The 'main_url' of the website won't be affected by this method. @param int $idSite @param array|string $urls When calling API via HTTP specify multiple URLs via `...
[ "Add", "a", "list", "of", "alias", "Urls", "to", "the", "given", "idSite" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L893-L917
209,436
matomo-org/matomo
plugins/SitesManager/API.php
API.setSiteAliasUrls
public function setSiteAliasUrls($idSite, $urls = array()) { Piwik::checkUserHasAdminAccess($idSite); $mainUrl = Site::getMainUrlFor($idSite); array_unshift($urls, $mainUrl); $urlsProperty = new Urls($idSite); $urlsProperty->setValue($urls); $urlsProperty->save(); ...
php
public function setSiteAliasUrls($idSite, $urls = array()) { Piwik::checkUserHasAdminAccess($idSite); $mainUrl = Site::getMainUrlFor($idSite); array_unshift($urls, $mainUrl); $urlsProperty = new Urls($idSite); $urlsProperty->setValue($urls); $urlsProperty->save(); ...
[ "public", "function", "setSiteAliasUrls", "(", "$", "idSite", ",", "$", "urls", "=", "array", "(", ")", ")", "{", "Piwik", "::", "checkUserHasAdminAccess", "(", "$", "idSite", ")", ";", "$", "mainUrl", "=", "Site", "::", "getMainUrlFor", "(", "$", "idSit...
Set the list of alias Urls for the given idSite Completely overwrites the current list of URLs with the provided list. The 'main_url' of the website won't be affected by this method. @return int the number of inserted URLs
[ "Set", "the", "list", "of", "alias", "Urls", "for", "the", "given", "idSite" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L927-L943
209,437
matomo-org/matomo
plugins/SitesManager/API.php
API.getIpsForRange
public function getIpsForRange($ipRange) { $range = IPUtils::getIPRangeBounds($ipRange); if ($range === null) { return false; } return array(IPUtils::binaryToStringIP($range[0]), IPUtils::binaryToStringIP($range[1])); }
php
public function getIpsForRange($ipRange) { $range = IPUtils::getIPRangeBounds($ipRange); if ($range === null) { return false; } return array(IPUtils::binaryToStringIP($range[0]), IPUtils::binaryToStringIP($range[1])); }
[ "public", "function", "getIpsForRange", "(", "$", "ipRange", ")", "{", "$", "range", "=", "IPUtils", "::", "getIPRangeBounds", "(", "$", "ipRange", ")", ";", "if", "(", "$", "range", "===", "null", ")", "{", "return", "false", ";", "}", "return", "arra...
Get the start and end IP addresses for an IP address range @param string $ipRange IP address range in presentation format @return array|false Array( low, high ) IP addresses in presentation format; or false if error
[ "Get", "the", "start", "and", "end", "IP", "addresses", "for", "an", "IP", "address", "range" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L951-L959
209,438
matomo-org/matomo
plugins/SitesManager/API.php
API.setGlobalExcludedIps
public function setGlobalExcludedIps($excludedIps) { Piwik::checkUserHasSuperUserAccess(); $excludedIps = $this->checkAndReturnExcludedIps($excludedIps); Option::set(self::OPTION_EXCLUDED_IPS_GLOBAL, $excludedIps); Cache::deleteTrackerCache(); return true; }
php
public function setGlobalExcludedIps($excludedIps) { Piwik::checkUserHasSuperUserAccess(); $excludedIps = $this->checkAndReturnExcludedIps($excludedIps); Option::set(self::OPTION_EXCLUDED_IPS_GLOBAL, $excludedIps); Cache::deleteTrackerCache(); return true; }
[ "public", "function", "setGlobalExcludedIps", "(", "$", "excludedIps", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "excludedIps", "=", "$", "this", "->", "checkAndReturnExcludedIps", "(", "$", "excludedIps", ")", ";", "Option", ":...
Sets IPs to be excluded from all websites. IPs can contain wildcards. Will also apply to websites created in the future. @param string $excludedIps Comma separated list of IPs to exclude from being tracked (allows wildcards) @return bool
[ "Sets", "IPs", "to", "be", "excluded", "from", "all", "websites", ".", "IPs", "can", "contain", "wildcards", ".", "Will", "also", "apply", "to", "websites", "created", "in", "the", "future", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L968-L975
209,439
matomo-org/matomo
plugins/SitesManager/API.php
API.setSiteSpecificUserAgentExcludeEnabled
public function setSiteSpecificUserAgentExcludeEnabled($enabled) { Piwik::checkUserHasSuperUserAccess(); // update option Option::set(self::OPTION_SITE_SPECIFIC_USER_AGENT_EXCLUDE_ENABLE, $enabled); // make sure tracker cache will reflect change Cache::deleteTrackerCache();...
php
public function setSiteSpecificUserAgentExcludeEnabled($enabled) { Piwik::checkUserHasSuperUserAccess(); // update option Option::set(self::OPTION_SITE_SPECIFIC_USER_AGENT_EXCLUDE_ENABLE, $enabled); // make sure tracker cache will reflect change Cache::deleteTrackerCache();...
[ "public", "function", "setSiteSpecificUserAgentExcludeEnabled", "(", "$", "enabled", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "// update option", "Option", "::", "set", "(", "self", "::", "OPTION_SITE_SPECIFIC_USER_AGENT_EXCLUDE_ENABLE", ",",...
Sets whether it should be allowed to exclude different user agents for different websites. @param bool $enabled
[ "Sets", "whether", "it", "should", "be", "allowed", "to", "exclude", "different", "user", "agents", "for", "different", "websites", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1080-L1089
209,440
matomo-org/matomo
plugins/SitesManager/API.php
API.setKeepURLFragmentsGlobal
public function setKeepURLFragmentsGlobal($enabled) { Piwik::checkUserHasSuperUserAccess(); // update option Option::set(self::OPTION_KEEP_URL_FRAGMENTS_GLOBAL, $enabled); // make sure tracker cache will reflect change Cache::deleteTrackerCache(); }
php
public function setKeepURLFragmentsGlobal($enabled) { Piwik::checkUserHasSuperUserAccess(); // update option Option::set(self::OPTION_KEEP_URL_FRAGMENTS_GLOBAL, $enabled); // make sure tracker cache will reflect change Cache::deleteTrackerCache(); }
[ "public", "function", "setKeepURLFragmentsGlobal", "(", "$", "enabled", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "// update option", "Option", "::", "set", "(", "self", "::", "OPTION_KEEP_URL_FRAGMENTS_GLOBAL", ",", "$", "enabled", ")",...
Sets whether the default behavior should be to keep URL fragments when tracking or not. @param $enabled bool If true, the default behavior will be to keep URL fragments when tracking. If false, the default behavior will be to remove them.
[ "Sets", "whether", "the", "default", "behavior", "should", "be", "to", "keep", "URL", "fragments", "when", "tracking", "or", "not", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1111-L1120
209,441
matomo-org/matomo
plugins/SitesManager/API.php
API.setGlobalExcludedQueryParameters
public function setGlobalExcludedQueryParameters($excludedQueryParameters) { Piwik::checkUserHasSuperUserAccess(); $excludedQueryParameters = $this->checkAndReturnCommaSeparatedStringList($excludedQueryParameters); Option::set(self::OPTION_EXCLUDED_QUERY_PARAMETERS_GLOBAL, $excludedQueryPara...
php
public function setGlobalExcludedQueryParameters($excludedQueryParameters) { Piwik::checkUserHasSuperUserAccess(); $excludedQueryParameters = $this->checkAndReturnCommaSeparatedStringList($excludedQueryParameters); Option::set(self::OPTION_EXCLUDED_QUERY_PARAMETERS_GLOBAL, $excludedQueryPara...
[ "public", "function", "setGlobalExcludedQueryParameters", "(", "$", "excludedQueryParameters", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "excludedQueryParameters", "=", "$", "this", "->", "checkAndReturnCommaSeparatedStringList", "(", "$"...
Sets list of URL query parameters to be excluded on all websites. Will also apply to websites created in the future. @param string $excludedQueryParameters Comma separated list of URL query parameters to exclude from URLs @return bool
[ "Sets", "list", "of", "URL", "query", "parameters", "to", "be", "excluded", "on", "all", "websites", ".", "Will", "also", "apply", "to", "websites", "created", "in", "the", "future", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1129-L1136
209,442
matomo-org/matomo
plugins/SitesManager/API.php
API.getDefaultCurrency
public function getDefaultCurrency() { Piwik::checkUserHasSomeAdminAccess(); $defaultCurrency = Option::get(self::OPTION_DEFAULT_CURRENCY); if ($defaultCurrency) { return $defaultCurrency; } return 'USD'; }
php
public function getDefaultCurrency() { Piwik::checkUserHasSomeAdminAccess(); $defaultCurrency = Option::get(self::OPTION_DEFAULT_CURRENCY); if ($defaultCurrency) { return $defaultCurrency; } return 'USD'; }
[ "public", "function", "getDefaultCurrency", "(", ")", "{", "Piwik", "::", "checkUserHasSomeAdminAccess", "(", ")", ";", "$", "defaultCurrency", "=", "Option", "::", "get", "(", "self", "::", "OPTION_DEFAULT_CURRENCY", ")", ";", "if", "(", "$", "defaultCurrency",...
Returns the default currency that will be set when creating a website through the API. @return string Currency ID eg. 'USD'
[ "Returns", "the", "default", "currency", "that", "will", "be", "set", "when", "creating", "a", "website", "through", "the", "API", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1154-L1162
209,443
matomo-org/matomo
plugins/SitesManager/API.php
API.setDefaultCurrency
public function setDefaultCurrency($defaultCurrency) { Piwik::checkUserHasSuperUserAccess(); $this->checkValidCurrency($defaultCurrency); Option::set(self::OPTION_DEFAULT_CURRENCY, $defaultCurrency); return true; }
php
public function setDefaultCurrency($defaultCurrency) { Piwik::checkUserHasSuperUserAccess(); $this->checkValidCurrency($defaultCurrency); Option::set(self::OPTION_DEFAULT_CURRENCY, $defaultCurrency); return true; }
[ "public", "function", "setDefaultCurrency", "(", "$", "defaultCurrency", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "this", "->", "checkValidCurrency", "(", "$", "defaultCurrency", ")", ";", "Option", "::", "set", "(", "self", ...
Sets the default currency that will be used when creating websites @param string $defaultCurrency Currency code, eg. 'USD' @return bool
[ "Sets", "the", "default", "currency", "that", "will", "be", "used", "when", "creating", "websites" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1170-L1176
209,444
matomo-org/matomo
plugins/SitesManager/API.php
API.setDefaultTimezone
public function setDefaultTimezone($defaultTimezone) { Piwik::checkUserHasSuperUserAccess(); $this->checkValidTimezone($defaultTimezone); Option::set(self::OPTION_DEFAULT_TIMEZONE, $defaultTimezone); return true; }
php
public function setDefaultTimezone($defaultTimezone) { Piwik::checkUserHasSuperUserAccess(); $this->checkValidTimezone($defaultTimezone); Option::set(self::OPTION_DEFAULT_TIMEZONE, $defaultTimezone); return true; }
[ "public", "function", "setDefaultTimezone", "(", "$", "defaultTimezone", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "this", "->", "checkValidTimezone", "(", "$", "defaultTimezone", ")", ";", "Option", "::", "set", "(", "self", ...
Sets the default timezone that will be used when creating websites @param string $defaultTimezone Timezone string eg. Europe/Paris or UTC+8 @return bool
[ "Sets", "the", "default", "timezone", "that", "will", "be", "used", "when", "creating", "websites" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1199-L1205
209,445
matomo-org/matomo
plugins/SitesManager/API.php
API.getCurrencyList
public function getCurrencyList() { $currency = Site::getCurrencyList(); $return = array(); foreach (array_keys(Site::getCurrencyList()) as $currencyCode) { $return[$currencyCode] = Piwik::translate('Intl_Currency_' . $currencyCode) . ' (' . Piwik::translate('Intl_...
php
public function getCurrencyList() { $currency = Site::getCurrencyList(); $return = array(); foreach (array_keys(Site::getCurrencyList()) as $currencyCode) { $return[$currencyCode] = Piwik::translate('Intl_Currency_' . $currencyCode) . ' (' . Piwik::translate('Intl_...
[ "public", "function", "getCurrencyList", "(", ")", "{", "$", "currency", "=", "Site", "::", "getCurrencyList", "(", ")", ";", "$", "return", "=", "array", "(", ")", ";", "foreach", "(", "array_keys", "(", "Site", "::", "getCurrencyList", "(", ")", ")", ...
Returns the list of supported currencies @see getCurrencySymbols() @return array ( currencyId => currencyName)
[ "Returns", "the", "list", "of", "supported", "currencies" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1376-L1389
209,446
matomo-org/matomo
plugins/SitesManager/API.php
API.getTimezonesList
public function getTimezonesList() { if (!SettingsServer::isTimezoneSupportEnabled()) { return array('UTC' => $this->getTimezonesListUTCOffsets()); } $countries = StaticContainer::get('Piwik\Intl\Data\Provider\RegionDataProvider')->getCountryList(); $return = array(); ...
php
public function getTimezonesList() { if (!SettingsServer::isTimezoneSupportEnabled()) { return array('UTC' => $this->getTimezonesListUTCOffsets()); } $countries = StaticContainer::get('Piwik\Intl\Data\Provider\RegionDataProvider')->getCountryList(); $return = array(); ...
[ "public", "function", "getTimezonesList", "(", ")", "{", "if", "(", "!", "SettingsServer", "::", "isTimezoneSupportEnabled", "(", ")", ")", "{", "return", "array", "(", "'UTC'", "=>", "$", "this", "->", "getTimezonesListUTCOffsets", "(", ")", ")", ";", "}", ...
Returns the list of timezones supported. Used for addSite and updateSite @return array of timezone strings
[ "Returns", "the", "list", "of", "timezones", "supported", ".", "Used", "for", "addSite", "and", "updateSite" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1421-L1452
209,447
matomo-org/matomo
plugins/SitesManager/API.php
API.removeTrailingSlash
private function removeTrailingSlash($url) { // if there is a final slash, we take the URL without this slash (expected URL format) if (strlen($url) > 5 && $url[strlen($url) - 1] == '/' ) { $url = substr($url, 0, strlen($url) - 1); } return $url; ...
php
private function removeTrailingSlash($url) { // if there is a final slash, we take the URL without this slash (expected URL format) if (strlen($url) > 5 && $url[strlen($url) - 1] == '/' ) { $url = substr($url, 0, strlen($url) - 1); } return $url; ...
[ "private", "function", "removeTrailingSlash", "(", "$", "url", ")", "{", "// if there is a final slash, we take the URL without this slash (expected URL format)", "if", "(", "strlen", "(", "$", "url", ")", ">", "5", "&&", "$", "url", "[", "strlen", "(", "$", "url", ...
Remove the final slash in the URLs if found @param string $url @return string the URL without the trailing slash
[ "Remove", "the", "final", "slash", "in", "the", "URLs", "if", "found" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1548-L1558
209,448
matomo-org/matomo
plugins/SitesManager/API.php
API.getPatternMatchSites
public function getPatternMatchSites($pattern, $limit = false) { $ids = $this->getSitesIdWithAtLeastViewAccess(); if (empty($ids)) { return array(); } $sites = $this->getModel()->getPatternMatchSites($ids, $pattern, $limit); foreach ($sites as &$site) { ...
php
public function getPatternMatchSites($pattern, $limit = false) { $ids = $this->getSitesIdWithAtLeastViewAccess(); if (empty($ids)) { return array(); } $sites = $this->getModel()->getPatternMatchSites($ids, $pattern, $limit); foreach ($sites as &$site) { ...
[ "public", "function", "getPatternMatchSites", "(", "$", "pattern", ",", "$", "limit", "=", "false", ")", "{", "$", "ids", "=", "$", "this", "->", "getSitesIdWithAtLeastViewAccess", "(", ")", ";", "if", "(", "empty", "(", "$", "ids", ")", ")", "{", "ret...
Find websites matching the given pattern. Any website will be returned that matches the pattern in the name, URL or group. To limit the number of returned sites you can either specify `filter_limit` as usual or `limit` which is faster. @param string $pattern @param int|false $limit @return array
[ "Find", "websites", "matching", "the", "given", "pattern", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1635-L1651
209,449
matomo-org/matomo
core/DataAccess/LogQueryBuilder.php
LogQueryBuilder.buildSelectQuery
private function buildSelectQuery($select, $from, $where, $groupBy, $orderBy, $limitAndOffset) { $sql = " SELECT $select FROM $from"; if ($where) { $sql .= " WHERE $where"; } if ($groupBy) { $sql .= " GROUP BY $groupBy"; }...
php
private function buildSelectQuery($select, $from, $where, $groupBy, $orderBy, $limitAndOffset) { $sql = " SELECT $select FROM $from"; if ($where) { $sql .= " WHERE $where"; } if ($groupBy) { $sql .= " GROUP BY $groupBy"; }...
[ "private", "function", "buildSelectQuery", "(", "$", "select", ",", "$", "from", ",", "$", "where", ",", "$", "groupBy", ",", "$", "orderBy", ",", "$", "limitAndOffset", ")", "{", "$", "sql", "=", "\"\n\t\t\tSELECT\n\t\t\t\t$select\n\t\t\tFROM\n\t\t\t\t$from\"", ...
Build select query the normal way @param string $select fieldlist to be selected @param string $from tablelist to select from @param string $where where clause @param string $groupBy group by clause @param string $orderBy order by clause @param string|int $limitAndOffset limit by clause eg '5' for Limit 5 Offset 0 or ...
[ "Build", "select", "query", "the", "normal", "way" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/LogQueryBuilder.php#L223-L252
209,450
matomo-org/matomo
core/AssetManager.php
AssetManager.getCompiledBaseCss
public function getCompiledBaseCss() { $mergedAsset = new InMemoryUIAsset(); $assetMerger = new StylesheetUIAssetMerger($mergedAsset, $this->minimalStylesheetFetcher, $this->cacheBuster); $assetMerger->generateFile(); return $mergedAsset; }
php
public function getCompiledBaseCss() { $mergedAsset = new InMemoryUIAsset(); $assetMerger = new StylesheetUIAssetMerger($mergedAsset, $this->minimalStylesheetFetcher, $this->cacheBuster); $assetMerger->generateFile(); return $mergedAsset; }
[ "public", "function", "getCompiledBaseCss", "(", ")", "{", "$", "mergedAsset", "=", "new", "InMemoryUIAsset", "(", ")", ";", "$", "assetMerger", "=", "new", "StylesheetUIAssetMerger", "(", "$", "mergedAsset", ",", "$", "this", "->", "minimalStylesheetFetcher", "...
Return the base.less compiled to css @return UIAsset
[ "Return", "the", "base", ".", "less", "compiled", "to", "css" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/AssetManager.php#L141-L150
209,451
matomo-org/matomo
core/AssetManager.php
AssetManager.getMergedStylesheet
public function getMergedStylesheet() { $mergedAsset = $this->getMergedStylesheetAsset(); $assetFetcher = new StylesheetUIAssetFetcher(Manager::getInstance()->getLoadedPluginsName(), $this->theme); $assetMerger = new StylesheetUIAssetMerger($mergedAsset, $assetFetcher, $this->cacheBuster);...
php
public function getMergedStylesheet() { $mergedAsset = $this->getMergedStylesheetAsset(); $assetFetcher = new StylesheetUIAssetFetcher(Manager::getInstance()->getLoadedPluginsName(), $this->theme); $assetMerger = new StylesheetUIAssetMerger($mergedAsset, $assetFetcher, $this->cacheBuster);...
[ "public", "function", "getMergedStylesheet", "(", ")", "{", "$", "mergedAsset", "=", "$", "this", "->", "getMergedStylesheetAsset", "(", ")", ";", "$", "assetFetcher", "=", "new", "StylesheetUIAssetFetcher", "(", "Manager", "::", "getInstance", "(", ")", "->", ...
Return the css merged file absolute location. If there is none, the generation process will be triggered. @return UIAsset
[ "Return", "the", "css", "merged", "file", "absolute", "location", ".", "If", "there", "is", "none", "the", "generation", "process", "will", "be", "triggered", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/AssetManager.php#L158-L169
209,452
matomo-org/matomo
core/AssetManager.php
AssetManager.removeMergedAssets
public function removeMergedAssets($pluginName = false) { $assetsToRemove = array($this->getMergedStylesheetAsset()); if ($pluginName) { if ($this->pluginContainsJScriptAssets($pluginName)) { if (Manager::getInstance()->isPluginBundledWithCore($pluginName)) { ...
php
public function removeMergedAssets($pluginName = false) { $assetsToRemove = array($this->getMergedStylesheetAsset()); if ($pluginName) { if ($this->pluginContainsJScriptAssets($pluginName)) { if (Manager::getInstance()->isPluginBundledWithCore($pluginName)) { ...
[ "public", "function", "removeMergedAssets", "(", "$", "pluginName", "=", "false", ")", "{", "$", "assetsToRemove", "=", "array", "(", "$", "this", "->", "getMergedStylesheetAsset", "(", ")", ")", ";", "if", "(", "$", "pluginName", ")", "{", "if", "(", "$...
Remove previous merged assets
[ "Remove", "previous", "merged", "assets" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/AssetManager.php#L216-L234
209,453
matomo-org/matomo
core/AssetManager.php
AssetManager.getAssetDirectory
public function getAssetDirectory() { $mergedFileDirectory = StaticContainer::get('path.tmp') . '/assets'; if (!is_dir($mergedFileDirectory)) { Filesystem::mkdir($mergedFileDirectory); } if (!is_writable($mergedFileDirectory)) { throw new Exception("Director...
php
public function getAssetDirectory() { $mergedFileDirectory = StaticContainer::get('path.tmp') . '/assets'; if (!is_dir($mergedFileDirectory)) { Filesystem::mkdir($mergedFileDirectory); } if (!is_writable($mergedFileDirectory)) { throw new Exception("Director...
[ "public", "function", "getAssetDirectory", "(", ")", "{", "$", "mergedFileDirectory", "=", "StaticContainer", "::", "get", "(", "'path.tmp'", ")", ".", "'/assets'", ";", "if", "(", "!", "is_dir", "(", "$", "mergedFileDirectory", ")", ")", "{", "Filesystem", ...
Check if the merged file directory exists and is writable. @return string The directory location @throws Exception if directory is not writable.
[ "Check", "if", "the", "merged", "file", "directory", "exists", "and", "is", "writable", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/AssetManager.php#L242-L255
209,454
matomo-org/matomo
core/AssetManager.php
AssetManager.isMergedAssetsDisabled
public function isMergedAssetsDisabled() { if (Config::getInstance()->Development['disable_merged_assets'] == 1) { return true; } if (isset($_GET['disable_merged_assets']) && $_GET['disable_merged_assets'] == 1) { return true; } retur...
php
public function isMergedAssetsDisabled() { if (Config::getInstance()->Development['disable_merged_assets'] == 1) { return true; } if (isset($_GET['disable_merged_assets']) && $_GET['disable_merged_assets'] == 1) { return true; } retur...
[ "public", "function", "isMergedAssetsDisabled", "(", ")", "{", "if", "(", "Config", "::", "getInstance", "(", ")", "->", "Development", "[", "'disable_merged_assets'", "]", "==", "1", ")", "{", "return", "true", ";", "}", "if", "(", "isset", "(", "$", "_...
Return the global option disable_merged_assets @return boolean
[ "Return", "the", "global", "option", "disable_merged_assets" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/AssetManager.php#L262-L273
209,455
matomo-org/matomo
libs/HTML/QuickForm2/Controller/Page.php
HTML_QuickForm2_Controller_Page.setDefaultAction
public function setDefaultAction($actionName, $imageSrc = '') { // require_once 'HTML/QuickForm2/Controller/DefaultAction.php'; if (0 == count($this->form)) { $image = $this->form->appendChild( new HTML_QuickForm2_Controller_DefaultAction( $this->getB...
php
public function setDefaultAction($actionName, $imageSrc = '') { // require_once 'HTML/QuickForm2/Controller/DefaultAction.php'; if (0 == count($this->form)) { $image = $this->form->appendChild( new HTML_QuickForm2_Controller_DefaultAction( $this->getB...
[ "public", "function", "setDefaultAction", "(", "$", "actionName", ",", "$", "imageSrc", "=", "''", ")", "{", "// require_once 'HTML/QuickForm2/Controller/DefaultAction.php';", "if", "(", "0", "==", "count", "(", "$", "this", "->", "form", ")", ")", "{", "$", "...
Sets the default action invoked on page-form submit This is necessary as the user may just press Enter instead of clicking one of the named submit buttons and then no action name will be passed to the script. @param string Default action name @param string Path to a 1x1 transparent GIF image @return object ...
[ "Sets", "the", "default", "action", "invoked", "on", "page", "-", "form", "submit" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller/Page.php#L181-L210
209,456
matomo-org/matomo
libs/Zend/Cache/Frontend/Function.php
Zend_Cache_Frontend_Function.makeId
public function makeId($callback, array $args = array()) { if (!is_callable($callback, true, $name)) { Zend_Cache::throwException('Invalid callback'); } // functions, methods and classnames are case-insensitive $name = strtolower($name); // generate a unique id ...
php
public function makeId($callback, array $args = array()) { if (!is_callable($callback, true, $name)) { Zend_Cache::throwException('Invalid callback'); } // functions, methods and classnames are case-insensitive $name = strtolower($name); // generate a unique id ...
[ "public", "function", "makeId", "(", "$", "callback", ",", "array", "$", "args", "=", "array", "(", ")", ")", "{", "if", "(", "!", "is_callable", "(", "$", "callback", ",", "true", ",", "$", "name", ")", ")", "{", "Zend_Cache", "::", "throwException"...
Make a cache id from the function name and parameters @param callback $callback A valid callback @param array $args Function parameters @throws Zend_Cache_Exception @return string Cache id
[ "Make", "a", "cache", "id", "from", "the", "function", "name", "and", "parameters" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Frontend/Function.php#L134-L177
209,457
matomo-org/matomo
core/Archive/ArchiveQueryFactory.php
ArchiveQueryFactory.getSiteInfoFromQueryParam
protected function getSiteInfoFromQueryParam($idSites, $_restrictSitesToLogin) { $websiteIds = Site::getIdSitesFromIdSitesString($idSites, $_restrictSitesToLogin); $timezone = false; if (count($websiteIds) == 1) { $timezone = Site::getTimezoneFor($websiteIds[0]); } ...
php
protected function getSiteInfoFromQueryParam($idSites, $_restrictSitesToLogin) { $websiteIds = Site::getIdSitesFromIdSitesString($idSites, $_restrictSitesToLogin); $timezone = false; if (count($websiteIds) == 1) { $timezone = Site::getTimezoneFor($websiteIds[0]); } ...
[ "protected", "function", "getSiteInfoFromQueryParam", "(", "$", "idSites", ",", "$", "_restrictSitesToLogin", ")", "{", "$", "websiteIds", "=", "Site", "::", "getIdSitesFromIdSitesString", "(", "$", "idSites", ",", "$", "_restrictSitesToLogin", ")", ";", "$", "tim...
Parses the site ID string provided in the 'idSite' query parameter to a list of website IDs. @param string $idSites the value of the 'idSite' query parameter @param bool $_restrictSitesToLogin @return array an array containing three elements: - an array of website IDs - string timezone to use (or false to use no timez...
[ "Parses", "the", "site", "ID", "string", "provided", "in", "the", "idSite", "query", "parameter", "to", "a", "list", "of", "website", "IDs", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/ArchiveQueryFactory.php#L75-L87
209,458
matomo-org/matomo
core/Archive/ArchiveQueryFactory.php
ArchiveQueryFactory.getPeriodInfoFromQueryParam
protected function getPeriodInfoFromQueryParam($strDate, $strPeriod, $timezone) { if (Period::isMultiplePeriod($strDate, $strPeriod)) { $oPeriod = PeriodFactory::build($strPeriod, $strDate, $timezone); $allPeriods = $oPeriod->getSubperiods(); } else { $oPeriod ...
php
protected function getPeriodInfoFromQueryParam($strDate, $strPeriod, $timezone) { if (Period::isMultiplePeriod($strDate, $strPeriod)) { $oPeriod = PeriodFactory::build($strPeriod, $strDate, $timezone); $allPeriods = $oPeriod->getSubperiods(); } else { $oPeriod ...
[ "protected", "function", "getPeriodInfoFromQueryParam", "(", "$", "strDate", ",", "$", "strPeriod", ",", "$", "timezone", ")", "{", "if", "(", "Period", "::", "isMultiplePeriod", "(", "$", "strDate", ",", "$", "strPeriod", ")", ")", "{", "$", "oPeriod", "=...
Parses the date & period query parameters into a list of periods. @param string $strDate the value of the 'date' query parameter @param string $strPeriod the value of the 'period' query parameter @param string $timezone the timezone to use when constructing periods. @return array an array containing two elements: - th...
[ "Parses", "the", "date", "&", "period", "query", "parameters", "into", "a", "list", "of", "periods", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/ArchiveQueryFactory.php#L101-L114
209,459
matomo-org/matomo
core/Db/Adapter/Pdo/Mssql.php
Mssql.checkClientVersion
public function checkClientVersion() { $serverVersion = $this->getServerVersion(); $clientVersion = $this->getClientVersion(); if (version_compare($serverVersion, '10') >= 0 && version_compare($clientVersion, '10') < 0 ) { throw new Exception(Piwik::translate...
php
public function checkClientVersion() { $serverVersion = $this->getServerVersion(); $clientVersion = $this->getClientVersion(); if (version_compare($serverVersion, '10') >= 0 && version_compare($clientVersion, '10') < 0 ) { throw new Exception(Piwik::translate...
[ "public", "function", "checkClientVersion", "(", ")", "{", "$", "serverVersion", "=", "$", "this", "->", "getServerVersion", "(", ")", ";", "$", "clientVersion", "=", "$", "this", "->", "getClientVersion", "(", ")", ";", "if", "(", "version_compare", "(", ...
Check client version compatibility against database server @throws Exception
[ "Check", "client", "version", "compatibility", "against", "database", "server" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter/Pdo/Mssql.php#L169-L179
209,460
matomo-org/matomo
core/Plugin.php
Plugin.findComponent
public function findComponent($componentName, $expectedSubclass) { $this->createCacheIfNeeded(); $cacheId = 'Plugin' . $this->pluginName . $componentName . $expectedSubclass; $pluginsDir = Manager::getPluginDirectory($this->pluginName); $componentFile = sprintf('%s/%s.php', $plugi...
php
public function findComponent($componentName, $expectedSubclass) { $this->createCacheIfNeeded(); $cacheId = 'Plugin' . $this->pluginName . $componentName . $expectedSubclass; $pluginsDir = Manager::getPluginDirectory($this->pluginName); $componentFile = sprintf('%s/%s.php', $plugi...
[ "public", "function", "findComponent", "(", "$", "componentName", ",", "$", "expectedSubclass", ")", "{", "$", "this", "->", "createCacheIfNeeded", "(", ")", ";", "$", "cacheId", "=", "'Plugin'", ".", "$", "this", "->", "pluginName", ".", "$", "componentName...
Tries to find a component such as a Menu or Tasks within this plugin. @param string $componentName The name of the component you want to look for. In case you request a component named 'Menu' it'll look for a file named 'Menu.php' within the root of the plugin folder that implements a class named Piwik\Plugin\$Pl...
[ "Tries", "to", "find", "a", "component", "such", "as", "a", "Menu", "or", "Tasks", "within", "this", "plugin", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin.php#L352-L397
209,461
matomo-org/matomo
core/Plugin.php
Plugin.getPluginNameFromBacktrace
public static function getPluginNameFromBacktrace($backtrace) { foreach ($backtrace as $tracepoint) { // try and discern the plugin name if (isset($tracepoint['class'])) { $className = self::getPluginNameFromNamespace($tracepoint['class']); if ($classN...
php
public static function getPluginNameFromBacktrace($backtrace) { foreach ($backtrace as $tracepoint) { // try and discern the plugin name if (isset($tracepoint['class'])) { $className = self::getPluginNameFromNamespace($tracepoint['class']); if ($classN...
[ "public", "static", "function", "getPluginNameFromBacktrace", "(", "$", "backtrace", ")", "{", "foreach", "(", "$", "backtrace", "as", "$", "tracepoint", ")", "{", "// try and discern the plugin name", "if", "(", "isset", "(", "$", "tracepoint", "[", "'class'", ...
Extracts the plugin name from a backtrace array. Returns `false` if we can't find one. @param array $backtrace The result of {@link debug_backtrace()} or [Exception::getTrace()](http://www.php.net/manual/en/exception.gettrace.php). @return string|false
[ "Extracts", "the", "plugin", "name", "from", "a", "backtrace", "array", ".", "Returns", "false", "if", "we", "can", "t", "find", "one", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin.php#L487-L499
209,462
matomo-org/matomo
core/ArchiveProcessor.php
ArchiveProcessor.aggregateDataTableRecords
public function aggregateDataTableRecords($recordNames, $maximumRowsInDataTableLevelZero = null, $maximumRowsInSubDataTable = null, $columnToSortByBeforeTruncation = null, ...
php
public function aggregateDataTableRecords($recordNames, $maximumRowsInDataTableLevelZero = null, $maximumRowsInSubDataTable = null, $columnToSortByBeforeTruncation = null, ...
[ "public", "function", "aggregateDataTableRecords", "(", "$", "recordNames", ",", "$", "maximumRowsInDataTableLevelZero", "=", "null", ",", "$", "maximumRowsInSubDataTable", "=", "null", ",", "$", "columnToSortByBeforeTruncation", "=", "null", ",", "&", "$", "columnsAg...
Sums records for every subperiod of the current period and inserts the result as the record for this period. DataTables are summed recursively so subtables will be summed as well. @param string|array $recordNames Name(s) of the report we are aggregating, eg, `'Referrers_type'`. @param int $maximumRowsInDataTableLevel...
[ "Sums", "records", "for", "every", "subperiod", "of", "the", "current", "period", "and", "inserts", "the", "result", "as", "the", "record", "for", "this", "period", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor.php#L203-L235
209,463
matomo-org/matomo
core/ArchiveProcessor.php
ArchiveProcessor.aggregateNumericMetrics
public function aggregateNumericMetrics($columns, $operationToApply = false) { $metrics = $this->getAggregatedNumericMetrics($columns, $operationToApply); foreach ($metrics as $column => $value) { $value = Common::forceDotAsSeparatorForDecimalPoint($value); $this->archiveWri...
php
public function aggregateNumericMetrics($columns, $operationToApply = false) { $metrics = $this->getAggregatedNumericMetrics($columns, $operationToApply); foreach ($metrics as $column => $value) { $value = Common::forceDotAsSeparatorForDecimalPoint($value); $this->archiveWri...
[ "public", "function", "aggregateNumericMetrics", "(", "$", "columns", ",", "$", "operationToApply", "=", "false", ")", "{", "$", "metrics", "=", "$", "this", "->", "getAggregatedNumericMetrics", "(", "$", "columns", ",", "$", "operationToApply", ")", ";", "for...
Aggregates one or more metrics for every subperiod of the current period and inserts the results as metrics for the current period. @param array|string $columns Array of metric names to aggregate. @param bool|string $operationToApply The operation to apply to the metric. Either `'sum'`, `'max'` or `'min'`. @return arr...
[ "Aggregates", "one", "or", "more", "metrics", "for", "every", "subperiod", "of", "the", "current", "period", "and", "inserts", "the", "results", "as", "metrics", "for", "the", "current", "period", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor.php#L256-L271
209,464
matomo-org/matomo
core/ArchiveProcessor.php
ArchiveProcessor.insertNumericRecords
public function insertNumericRecords($numericRecords) { foreach ($numericRecords as $name => $value) { $this->insertNumericRecord($name, $value); } }
php
public function insertNumericRecords($numericRecords) { foreach ($numericRecords as $name => $value) { $this->insertNumericRecord($name, $value); } }
[ "public", "function", "insertNumericRecords", "(", "$", "numericRecords", ")", "{", "foreach", "(", "$", "numericRecords", "as", "$", "name", "=>", "$", "value", ")", "{", "$", "this", "->", "insertNumericRecord", "(", "$", "name", ",", "$", "value", ")", ...
Caches multiple numeric records in the archive for this processor's site, period and segment. @param array $numericRecords A name-value mapping of numeric values that should be archived, eg, array('Referrers_distinctKeywords' => 23, 'Referrers_distinctCampaigns' => 234) @api
[ "Caches", "multiple", "numeric", "records", "in", "the", "archive", "for", "this", "processor", "s", "site", "period", "and", "segment", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor.php#L296-L301
209,465
matomo-org/matomo
core/ArchiveProcessor.php
ArchiveProcessor.insertNumericRecord
public function insertNumericRecord($name, $value) { $value = round($value, 2); $value = Common::forceDotAsSeparatorForDecimalPoint($value); $this->archiveWriter->insertRecord($name, $value); }
php
public function insertNumericRecord($name, $value) { $value = round($value, 2); $value = Common::forceDotAsSeparatorForDecimalPoint($value); $this->archiveWriter->insertRecord($name, $value); }
[ "public", "function", "insertNumericRecord", "(", "$", "name", ",", "$", "value", ")", "{", "$", "value", "=", "round", "(", "$", "value", ",", "2", ")", ";", "$", "value", "=", "Common", "::", "forceDotAsSeparatorForDecimalPoint", "(", "$", "value", ")"...
Caches a single numeric record in the archive for this processor's site, period and segment. Numeric values are not inserted if they equal `0`. @param string $name The name of the numeric value, eg, `'Referrers_distinctKeywords'`. @param float $value The numeric value. @api
[ "Caches", "a", "single", "numeric", "record", "in", "the", "archive", "for", "this", "processor", "s", "site", "period", "and", "segment", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor.php#L313-L319
209,466
matomo-org/matomo
core/ArchiveProcessor.php
ArchiveProcessor.computeNbUniques
protected function computeNbUniques($metrics) { $logAggregator = $this->getLogAggregator(); $query = $logAggregator->queryVisitsByDimension(array(), false, array(), $metrics); $data = $query->fetch(); return $data; }
php
protected function computeNbUniques($metrics) { $logAggregator = $this->getLogAggregator(); $query = $logAggregator->queryVisitsByDimension(array(), false, array(), $metrics); $data = $query->fetch(); return $data; }
[ "protected", "function", "computeNbUniques", "(", "$", "metrics", ")", "{", "$", "logAggregator", "=", "$", "this", "->", "getLogAggregator", "(", ")", ";", "$", "query", "=", "$", "logAggregator", "->", "queryVisitsByDimension", "(", "array", "(", ")", ",",...
Processes number of unique visitors for the given period This is the only Period metric (ie. week/month/year/range) that we process from the logs directly, since unique visitors cannot be summed like other metrics. @param array Metrics Ids for which to aggregates count of values @return array of metrics, where the ke...
[ "Processes", "number", "of", "unique", "visitors", "for", "the", "given", "period" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor.php#L487-L493
209,467
matomo-org/matomo
core/ArchiveProcessor.php
ArchiveProcessor.getAggregatedDataTableMap
protected function getAggregatedDataTableMap($data, $columnsAggregationOperation) { $table = new DataTable(); if (!empty($columnsAggregationOperation)) { $table->setMetadata(DataTable::COLUMN_AGGREGATION_OPS_METADATA_NAME, $columnsAggregationOperation); } if ($data inst...
php
protected function getAggregatedDataTableMap($data, $columnsAggregationOperation) { $table = new DataTable(); if (!empty($columnsAggregationOperation)) { $table->setMetadata(DataTable::COLUMN_AGGREGATION_OPS_METADATA_NAME, $columnsAggregationOperation); } if ($data inst...
[ "protected", "function", "getAggregatedDataTableMap", "(", "$", "data", ",", "$", "columnsAggregationOperation", ")", "{", "$", "table", "=", "new", "DataTable", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "columnsAggregationOperation", ")", ")", "{", ...
If the DataTable is a Map, sums all DataTable in the map and return the DataTable. @param $data DataTable|DataTable\Map @param $columnsToRenameAfterAggregation array @return DataTable
[ "If", "the", "DataTable", "is", "a", "Map", "sums", "all", "DataTable", "in", "the", "map", "and", "return", "the", "DataTable", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor.php#L503-L519
209,468
matomo-org/matomo
core/ArchiveProcessor.php
ArchiveProcessor.processDependentArchive
public function processDependentArchive($plugin, $segment) { $params = $this->getParams(); if (!$params->isRootArchiveRequest()) { // prevent all recursion return; } $idSites = [$params->getSite()->getId()]; $newSegment = Segment::combine($params->getSegment()->...
php
public function processDependentArchive($plugin, $segment) { $params = $this->getParams(); if (!$params->isRootArchiveRequest()) { // prevent all recursion return; } $idSites = [$params->getSite()->getId()]; $newSegment = Segment::combine($params->getSegment()->...
[ "public", "function", "processDependentArchive", "(", "$", "plugin", ",", "$", "segment", ")", "{", "$", "params", "=", "$", "this", "->", "getParams", "(", ")", ";", "if", "(", "!", "$", "params", "->", "isRootArchiveRequest", "(", ")", ")", "{", "// ...
Initiate archiving for a plugin during an ongoing archiving. The plugin can be another plugin or the same plugin. This method should be called during archiving when one plugin uses the report of another plugin with a segment. It will ensure reports for that segment & plugin will be archived without initiating archivin...
[ "Initiate", "archiving", "for", "a", "plugin", "during", "an", "ongoing", "archiving", ".", "The", "plugin", "can", "be", "another", "plugin", "or", "the", "same", "plugin", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor.php#L608-L634
209,469
matomo-org/matomo
libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php
Zend_Db_Adapter_Pdo_Ibm_Ids.describeTable
public function describeTable($tableName, $schemaName = null) { // this is still a work in progress $sql= "SELECT DISTINCT t.owner, t.tabname, c.colname, c.colno, c.coltype, d.default, c.collength, t.tabid FROM syscolumns c JOIN systables t ON c.tabid = ...
php
public function describeTable($tableName, $schemaName = null) { // this is still a work in progress $sql= "SELECT DISTINCT t.owner, t.tabname, c.colname, c.colno, c.coltype, d.default, c.collength, t.tabid FROM syscolumns c JOIN systables t ON c.tabid = ...
[ "public", "function", "describeTable", "(", "$", "tableName", ",", "$", "schemaName", "=", "null", ")", "{", "// this is still a work in progress", "$", "sql", "=", "\"SELECT DISTINCT t.owner, t.tabname, c.colname, c.colno, c.coltype,\n d.default, c.collength, t.tabid...
IDS catalog lookup for describe table @param string $tableName @param string $schemaName OPTIONAL @return array
[ "IDS", "catalog", "lookup", "for", "describe", "table" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php#L78-L152
209,470
matomo-org/matomo
libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php
Zend_Db_Adapter_Pdo_Ibm_Ids._getPrimaryInfo
protected function _getPrimaryInfo($tabid) { $sql = "SELECT i.part1, i.part2, i.part3, i.part4, i.part5, i.part6, i.part7, i.part8, i.part9, i.part10, i.part11, i.part12, i.part13, i.part14, i.part15, i.part16 FROM sysindexes i JOIN sysconstrai...
php
protected function _getPrimaryInfo($tabid) { $sql = "SELECT i.part1, i.part2, i.part3, i.part4, i.part5, i.part6, i.part7, i.part8, i.part9, i.part10, i.part11, i.part12, i.part13, i.part14, i.part15, i.part16 FROM sysindexes i JOIN sysconstrai...
[ "protected", "function", "_getPrimaryInfo", "(", "$", "tabid", ")", "{", "$", "sql", "=", "\"SELECT i.part1, i.part2, i.part3, i.part4, i.part5, i.part6,\n i.part7, i.part8, i.part9, i.part10, i.part11, i.part12,\n i.part13, i.part14, i.part15, i.part16\n ...
Helper method to retrieve primary key column and column location @param int $tabid @return array
[ "Helper", "method", "to", "retrieve", "primary", "key", "column", "and", "column", "location" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php#L205-L237
209,471
matomo-org/matomo
libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php
Zend_Db_Adapter_Pdo_Ibm_Ids.limit
public function limit($sql, $count, $offset = 0) { $count = intval($count); if ($count < 0) { /** @see Zend_Db_Adapter_Exception */ // require_once 'Zend/Db/Adapter/Exception.php'; throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid"); ...
php
public function limit($sql, $count, $offset = 0) { $count = intval($count); if ($count < 0) { /** @see Zend_Db_Adapter_Exception */ // require_once 'Zend/Db/Adapter/Exception.php'; throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid"); ...
[ "public", "function", "limit", "(", "$", "sql", ",", "$", "count", ",", "$", "offset", "=", "0", ")", "{", "$", "count", "=", "intval", "(", "$", "count", ")", ";", "if", "(", "$", "count", "<", "0", ")", "{", "/** @see Zend_Db_Adapter_Exception */",...
Adds an IDS-specific LIMIT clause to the SELECT statement. @param string $sql @param integer $count @param integer $offset OPTIONAL @throws Zend_Db_Adapter_Exception @return string
[ "Adds", "an", "IDS", "-", "specific", "LIMIT", "clause", "to", "the", "SELECT", "statement", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php#L248-L272
209,472
matomo-org/matomo
libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php
Zend_Db_Adapter_Pdo_Ibm_Ids.nextSequenceId
public function nextSequenceId($sequenceName) { $sql = 'SELECT '.$this->_adapter->quoteIdentifier($sequenceName).'.NEXTVAL FROM ' .'systables WHERE tabid = 1'; $value = $this->_adapter->fetchOne($sql); return $value; }
php
public function nextSequenceId($sequenceName) { $sql = 'SELECT '.$this->_adapter->quoteIdentifier($sequenceName).'.NEXTVAL FROM ' .'systables WHERE tabid = 1'; $value = $this->_adapter->fetchOne($sql); return $value; }
[ "public", "function", "nextSequenceId", "(", "$", "sequenceName", ")", "{", "$", "sql", "=", "'SELECT '", ".", "$", "this", "->", "_adapter", "->", "quoteIdentifier", "(", "$", "sequenceName", ")", ".", "'.NEXTVAL FROM '", ".", "'systables WHERE tabid = 1'", ";"...
IDS-specific sequence id value @param string $sequenceName @return integer
[ "IDS", "-", "specific", "sequence", "id", "value" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php#L294-L300
209,473
matomo-org/matomo
libs/Zend/Config/Writer/Json.php
Zend_Config_Writer_Json.render
public function render() { $data = $this->_config->toArray(); $sectionName = $this->_config->getSectionName(); $extends = $this->_config->getExtends(); if (is_string($sectionName)) { $data = array($sectionName => $data); } foreach ($extends as...
php
public function render() { $data = $this->_config->toArray(); $sectionName = $this->_config->getSectionName(); $extends = $this->_config->getExtends(); if (is_string($sectionName)) { $data = array($sectionName => $data); } foreach ($extends as...
[ "public", "function", "render", "(", ")", "{", "$", "data", "=", "$", "this", "->", "_config", "->", "toArray", "(", ")", ";", "$", "sectionName", "=", "$", "this", "->", "_config", "->", "getSectionName", "(", ")", ";", "$", "extends", "=", "$", "...
Render a Zend_Config into a JSON config string. @since 1.10 @return string
[ "Render", "a", "Zend_Config", "into", "a", "JSON", "config", "string", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config/Writer/Json.php#L75-L105
209,474
matomo-org/matomo
libs/Zend/Cache/Backend/Sqlite.php
Zend_Cache_Backend_Sqlite.getIdsNotMatchingTags
public function getIdsNotMatchingTags($tags = array()) { $res = $this->_query("SELECT id FROM cache"); $rows = @sqlite_fetch_all($res, SQLITE_ASSOC); $result = array(); foreach ($rows as $row) { $id = $row['id']; $matching = false; foreach ($tags a...
php
public function getIdsNotMatchingTags($tags = array()) { $res = $this->_query("SELECT id FROM cache"); $rows = @sqlite_fetch_all($res, SQLITE_ASSOC); $result = array(); foreach ($rows as $row) { $id = $row['id']; $matching = false; foreach ($tags a...
[ "public", "function", "getIdsNotMatchingTags", "(", "$", "tags", "=", "array", "(", ")", ")", "{", "$", "res", "=", "$", "this", "->", "_query", "(", "\"SELECT id FROM cache\"", ")", ";", "$", "rows", "=", "@", "sqlite_fetch_all", "(", "$", "res", ",", ...
Return an array of stored cache ids which don't match given tags In case of multiple tags, a logical OR is made between tags @param array $tags array of tags @return array array of not matching cache ids (string)
[ "Return", "an", "array", "of", "stored", "cache", "ids", "which", "don", "t", "match", "given", "tags" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L302-L325
209,475
matomo-org/matomo
libs/Zend/Cache/Backend/Sqlite.php
Zend_Cache_Backend_Sqlite._getConnection
private function _getConnection() { if (is_resource($this->_db)) { return $this->_db; } else { $this->_db = @sqlite_open($this->_options['cache_db_complete_path']); if (!(is_resource($this->_db))) { Zend_Cache::throwException("Impossible to open " ...
php
private function _getConnection() { if (is_resource($this->_db)) { return $this->_db; } else { $this->_db = @sqlite_open($this->_options['cache_db_complete_path']); if (!(is_resource($this->_db))) { Zend_Cache::throwException("Impossible to open " ...
[ "private", "function", "_getConnection", "(", ")", "{", "if", "(", "is_resource", "(", "$", "this", "->", "_db", ")", ")", "{", "return", "$", "this", "->", "_db", ";", "}", "else", "{", "$", "this", "->", "_db", "=", "@", "sqlite_open", "(", "$", ...
Return the connection resource If we are not connected, the connection is made @throws Zend_Cache_Exception @return resource Connection resource
[ "Return", "the", "connection", "resource" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L489-L500
209,476
matomo-org/matomo
libs/Zend/Cache/Backend/Sqlite.php
Zend_Cache_Backend_Sqlite._query
private function _query($query) { $db = $this->_getConnection(); if (is_resource($db)) { $res = @sqlite_query($db, $query); if ($res === false) { return false; } else { return $res; } } return false; ...
php
private function _query($query) { $db = $this->_getConnection(); if (is_resource($db)) { $res = @sqlite_query($db, $query); if ($res === false) { return false; } else { return $res; } } return false; ...
[ "private", "function", "_query", "(", "$", "query", ")", "{", "$", "db", "=", "$", "this", "->", "_getConnection", "(", ")", ";", "if", "(", "is_resource", "(", "$", "db", ")", ")", "{", "$", "res", "=", "@", "sqlite_query", "(", "$", "db", ",", ...
Execute an SQL query silently @param string $query SQL query @return mixed|false query results
[ "Execute", "an", "SQL", "query", "silently" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L508-L520
209,477
matomo-org/matomo
libs/Zend/Cache/Backend/Sqlite.php
Zend_Cache_Backend_Sqlite._automaticVacuum
private function _automaticVacuum() { if ($this->_options['automatic_vacuum_factor'] > 0) { $rand = rand(1, $this->_options['automatic_vacuum_factor']); if ($rand == 1) { $this->_query('VACUUM'); } } }
php
private function _automaticVacuum() { if ($this->_options['automatic_vacuum_factor'] > 0) { $rand = rand(1, $this->_options['automatic_vacuum_factor']); if ($rand == 1) { $this->_query('VACUUM'); } } }
[ "private", "function", "_automaticVacuum", "(", ")", "{", "if", "(", "$", "this", "->", "_options", "[", "'automatic_vacuum_factor'", "]", ">", "0", ")", "{", "$", "rand", "=", "rand", "(", "1", ",", "$", "this", "->", "_options", "[", "'automatic_vacuum...
Deal with the automatic vacuum process @return void
[ "Deal", "with", "the", "automatic", "vacuum", "process" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L527-L535
209,478
matomo-org/matomo
libs/Zend/Cache/Backend/Sqlite.php
Zend_Cache_Backend_Sqlite._registerTag
private function _registerTag($id, $tag) { $res = $this->_query("DELETE FROM TAG WHERE name='$tag' AND id='$id'"); $res = $this->_query("INSERT INTO tag (name, id) VALUES ('$tag', '$id')"); if (!$res) { $this->_log("Zend_Cache_Backend_Sqlite::_registerTag() : impossible to register t...
php
private function _registerTag($id, $tag) { $res = $this->_query("DELETE FROM TAG WHERE name='$tag' AND id='$id'"); $res = $this->_query("INSERT INTO tag (name, id) VALUES ('$tag', '$id')"); if (!$res) { $this->_log("Zend_Cache_Backend_Sqlite::_registerTag() : impossible to register t...
[ "private", "function", "_registerTag", "(", "$", "id", ",", "$", "tag", ")", "{", "$", "res", "=", "$", "this", "->", "_query", "(", "\"DELETE FROM TAG WHERE name='$tag' AND id='$id'\"", ")", ";", "$", "res", "=", "$", "this", "->", "_query", "(", "\"INSER...
Register a cache id with the given tag @param string $id Cache id @param string $tag Tag @return boolean True if no problem
[ "Register", "a", "cache", "id", "with", "the", "given", "tag" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L544-L552
209,479
matomo-org/matomo
libs/Zend/Cache/Backend/Sqlite.php
Zend_Cache_Backend_Sqlite._buildStructure
private function _buildStructure() { $this->_query('DROP INDEX tag_id_index'); $this->_query('DROP INDEX tag_name_index'); $this->_query('DROP INDEX cache_id_expire_index'); $this->_query('DROP TABLE version'); $this->_query('DROP TABLE cache'); $this->_query('DROP TA...
php
private function _buildStructure() { $this->_query('DROP INDEX tag_id_index'); $this->_query('DROP INDEX tag_name_index'); $this->_query('DROP INDEX cache_id_expire_index'); $this->_query('DROP TABLE version'); $this->_query('DROP TABLE cache'); $this->_query('DROP TA...
[ "private", "function", "_buildStructure", "(", ")", "{", "$", "this", "->", "_query", "(", "'DROP INDEX tag_id_index'", ")", ";", "$", "this", "->", "_query", "(", "'DROP INDEX tag_name_index'", ")", ";", "$", "this", "->", "_query", "(", "'DROP INDEX cache_id_e...
Build the database structure @return false
[ "Build", "the", "database", "structure" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L559-L574
209,480
matomo-org/matomo
plugins/UserCountry/LocationProvider/GeoIp/Php.php
Php.getGeoIpInstance
private function getGeoIpInstance($key) { if (empty($this->geoIpCache[$key])) { // make sure region names are loaded & saved first parent::getRegionNames(); require_once PIWIK_INCLUDE_PATH . '/libs/MaxMindGeoIP/geoipcity.inc'; $pathToDb = self::getPathToGeoIp...
php
private function getGeoIpInstance($key) { if (empty($this->geoIpCache[$key])) { // make sure region names are loaded & saved first parent::getRegionNames(); require_once PIWIK_INCLUDE_PATH . '/libs/MaxMindGeoIP/geoipcity.inc'; $pathToDb = self::getPathToGeoIp...
[ "private", "function", "getGeoIpInstance", "(", "$", "key", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "geoIpCache", "[", "$", "key", "]", ")", ")", "{", "// make sure region names are loaded & saved first", "parent", "::", "getRegionNames", "(", ")...
Returns a GeoIP instance. Creates it if necessary. @param string $key 'loc', 'isp' or 'org'. Determines the type of GeoIP database to load. @return object|false
[ "Returns", "a", "GeoIP", "instance", ".", "Creates", "it", "if", "necessary", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp/Php.php#L372-L386
209,481
matomo-org/matomo
core/Db/Schema.php
Schema.getSchemaClassName
private static function getSchemaClassName($schemaName) { // Upgrade from pre 2.0.4 if (strtolower($schemaName) == 'myisam' || empty($schemaName)) { $schemaName = self::DEFAULT_SCHEMA; } $class = str_replace(' ', '\\', ucwords(str_replace('_', ' ', strtolower...
php
private static function getSchemaClassName($schemaName) { // Upgrade from pre 2.0.4 if (strtolower($schemaName) == 'myisam' || empty($schemaName)) { $schemaName = self::DEFAULT_SCHEMA; } $class = str_replace(' ', '\\', ucwords(str_replace('_', ' ', strtolower...
[ "private", "static", "function", "getSchemaClassName", "(", "$", "schemaName", ")", "{", "// Upgrade from pre 2.0.4", "if", "(", "strtolower", "(", "$", "schemaName", ")", "==", "'myisam'", "||", "empty", "(", "$", "schemaName", ")", ")", "{", "$", "schemaName...
Get schema class name @param string $schemaName @return string
[ "Get", "schema", "class", "name" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Schema.php#L38-L48
209,482
matomo-org/matomo
core/Http/Router.php
Router.filterUrl
public function filterUrl($url) { $path = parse_url($url, PHP_URL_PATH); if (strpos($path, 'index.php/') !== false) { return preg_replace('#index\.php/([^\?]*)#', 'index.php', $url, 1); } return null; }
php
public function filterUrl($url) { $path = parse_url($url, PHP_URL_PATH); if (strpos($path, 'index.php/') !== false) { return preg_replace('#index\.php/([^\?]*)#', 'index.php', $url, 1); } return null; }
[ "public", "function", "filterUrl", "(", "$", "url", ")", "{", "$", "path", "=", "parse_url", "(", "$", "url", ",", "PHP_URL_PATH", ")", ";", "if", "(", "strpos", "(", "$", "path", ",", "'index.php/'", ")", "!==", "false", ")", "{", "return", "preg_re...
Filters some malformed URL by suggesting to redirect them. E.g. /index.php/.html?... can be interpreted as HTML by old browsers even though the Content-Type says JSON. @link https://github.com/piwik/piwik/issues/6156 @param string $url The URL to filter. @return string|null If not null, then the application should r...
[ "Filters", "some", "malformed", "URL", "by", "suggesting", "to", "redirect", "them", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Http/Router.php#L29-L38
209,483
matomo-org/matomo
libs/Zend/Db/Adapter/Pdo/Abstract.php
Zend_Db_Adapter_Pdo_Abstract.exec
public function exec($sql) { if ($sql instanceof Zend_Db_Select) { $sql = $sql->assemble(); } try { $affected = $this->getConnection()->exec($sql); if ($affected === false) { $errorInfo = $this->getConnection()->errorInfo(); ...
php
public function exec($sql) { if ($sql instanceof Zend_Db_Select) { $sql = $sql->assemble(); } try { $affected = $this->getConnection()->exec($sql); if ($affected === false) { $errorInfo = $this->getConnection()->errorInfo(); ...
[ "public", "function", "exec", "(", "$", "sql", ")", "{", "if", "(", "$", "sql", "instanceof", "Zend_Db_Select", ")", "{", "$", "sql", "=", "$", "sql", "->", "assemble", "(", ")", ";", "}", "try", "{", "$", "affected", "=", "$", "this", "->", "get...
Executes an SQL statement and return the number of affected rows @param mixed $sql The SQL statement with placeholders. May be a string or Zend_Db_Select. @return integer Number of rows that were modified or deleted by the SQL statement
[ "Executes", "an", "SQL", "statement", "and", "return", "the", "number", "of", "affected", "rows" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Abstract.php#L256-L282
209,484
matomo-org/matomo
libs/Zend/Db/Adapter/Pdo/Abstract.php
Zend_Db_Adapter_Pdo_Abstract.setFetchMode
public function setFetchMode($mode) { //check for PDO extension if (!extension_loaded('pdo')) { /** * @see Zend_Db_Adapter_Exception */ // require_once 'Zend/Db/Adapter/Exception.php'; throw new Zend_Db_Adapter_Exception('The PDO extensio...
php
public function setFetchMode($mode) { //check for PDO extension if (!extension_loaded('pdo')) { /** * @see Zend_Db_Adapter_Exception */ // require_once 'Zend/Db/Adapter/Exception.php'; throw new Zend_Db_Adapter_Exception('The PDO extensio...
[ "public", "function", "setFetchMode", "(", "$", "mode", ")", "{", "//check for PDO extension", "if", "(", "!", "extension_loaded", "(", "'pdo'", ")", ")", "{", "/**\n * @see Zend_Db_Adapter_Exception\n */", "// require_once 'Zend/Db/Adapter/Exception.php...
Set the PDO fetch mode. @todo Support FETCH_CLASS and FETCH_INTO. @param int $mode A PDO fetch mode. @return void @throws Zend_Db_Adapter_Exception
[ "Set", "the", "PDO", "fetch", "mode", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Abstract.php#L334-L361
209,485
matomo-org/matomo
core/API/DataTableGenericFilter.php
DataTableGenericFilter.applyGenericFilters
protected function applyGenericFilters($datatable) { if ($datatable instanceof DataTable\Map) { $tables = $datatable->getDataTables(); foreach ($tables as $table) { $this->applyGenericFilters($table); } return; } $tableDisabled...
php
protected function applyGenericFilters($datatable) { if ($datatable instanceof DataTable\Map) { $tables = $datatable->getDataTables(); foreach ($tables as $table) { $this->applyGenericFilters($table); } return; } $tableDisabled...
[ "protected", "function", "applyGenericFilters", "(", "$", "datatable", ")", "{", "if", "(", "$", "datatable", "instanceof", "DataTable", "\\", "Map", ")", "{", "$", "tables", "=", "$", "datatable", "->", "getDataTables", "(", ")", ";", "foreach", "(", "$",...
Apply generic filters to the DataTable object resulting from the API Call. Disable this feature by setting the parameter disable_generic_filters to 1 in the API call request. @param DataTable $datatable @return bool
[ "Apply", "generic", "filters", "to", "the", "DataTable", "object", "resulting", "from", "the", "API", "Call", ".", "Disable", "this", "feature", "by", "setting", "the", "parameter", "disable_generic_filters", "to", "1", "in", "the", "API", "call", "request", "...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/DataTableGenericFilter.php#L148-L206
209,486
matomo-org/matomo
plugins/DevicesDetection/API.php
API.getBrand
public function getBrand($idSite, $period, $date, $segment = false) { $dataTable = $this->getDataTable('DevicesDetection_brands', $idSite, $period, $date, $segment); $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\getDeviceBrandLabel')); $dataTable->filter('ColumnCallbackAddMe...
php
public function getBrand($idSite, $period, $date, $segment = false) { $dataTable = $this->getDataTable('DevicesDetection_brands', $idSite, $period, $date, $segment); $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\getDeviceBrandLabel')); $dataTable->filter('ColumnCallbackAddMe...
[ "public", "function", "getBrand", "(", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", "=", "false", ")", "{", "$", "dataTable", "=", "$", "this", "->", "getDataTable", "(", "'DevicesDetection_brands'", ",", "$", "idSite", ",", ...
Gets datatable displaying number of visits by device manufacturer name @param int $idSite @param string $period @param string $date @param bool|string $segment @return DataTable
[ "Gets", "datatable", "displaying", "number", "of", "visits", "by", "device", "manufacturer", "name" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DevicesDetection/API.php#L94-L101
209,487
matomo-org/matomo
plugins/DevicesDetection/API.php
API.getModel
public function getModel($idSite, $period, $date, $segment = false) { $dataTable = $this->getDataTable('DevicesDetection_models', $idSite, $period, $date, $segment); $dataTable->filter(function (DataTable $table) { foreach ($table->getRowsWithoutSummaryRow() as $row) { ...
php
public function getModel($idSite, $period, $date, $segment = false) { $dataTable = $this->getDataTable('DevicesDetection_models', $idSite, $period, $date, $segment); $dataTable->filter(function (DataTable $table) { foreach ($table->getRowsWithoutSummaryRow() as $row) { ...
[ "public", "function", "getModel", "(", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", "=", "false", ")", "{", "$", "dataTable", "=", "$", "this", "->", "getDataTable", "(", "'DevicesDetection_models'", ",", "$", "idSite", ",", ...
Gets datatable displaying number of visits by device model @param int $idSite @param string $period @param string $date @param bool|string $segment @return DataTable
[ "Gets", "datatable", "displaying", "number", "of", "visits", "by", "device", "model" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DevicesDetection/API.php#L111-L136
209,488
matomo-org/matomo
plugins/DevicesDetection/API.php
API.mergeDataTables
protected function mergeDataTables(DataTable\DataTableInterface $dataTable, DataTable\DataTableInterface $dataTable2) { if ($dataTable instanceof DataTable\Map) { $dataTables = $dataTable->getDataTables(); foreach ($dataTables as $label => $table) { $versionDataTabl...
php
protected function mergeDataTables(DataTable\DataTableInterface $dataTable, DataTable\DataTableInterface $dataTable2) { if ($dataTable instanceof DataTable\Map) { $dataTables = $dataTable->getDataTables(); foreach ($dataTables as $label => $table) { $versionDataTabl...
[ "protected", "function", "mergeDataTables", "(", "DataTable", "\\", "DataTableInterface", "$", "dataTable", ",", "DataTable", "\\", "DataTableInterface", "$", "dataTable2", ")", "{", "if", "(", "$", "dataTable", "instanceof", "DataTable", "\\", "Map", ")", "{", ...
That methods handles the fallback to version datatables to calculate those without versions. Unlike DevicesDetection plugin now, the UserSettings plugin did not store archives holding the os and browser data without their version number. The "version-less" reports were always generated out of the "version-containing" ...
[ "That", "methods", "handles", "the", "fallback", "to", "version", "datatables", "to", "calculate", "those", "without", "versions", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DevicesDetection/API.php#L176-L206
209,489
matomo-org/matomo
plugins/CorePluginsAdmin/Controller.php
Controller.isAllowedToTroubleshootAsSuperUser
protected function isAllowedToTroubleshootAsSuperUser() { $isAllowedToTroubleshootAsSuperUser = false; $salt = SettingsPiwik::getSalt(); if (!empty($salt)) { $saltFromRequest = Common::getRequestVar('i_am_super_user', '', 'string'); $isAllowedToTroubleshootAsSuperUser...
php
protected function isAllowedToTroubleshootAsSuperUser() { $isAllowedToTroubleshootAsSuperUser = false; $salt = SettingsPiwik::getSalt(); if (!empty($salt)) { $saltFromRequest = Common::getRequestVar('i_am_super_user', '', 'string'); $isAllowedToTroubleshootAsSuperUser...
[ "protected", "function", "isAllowedToTroubleshootAsSuperUser", "(", ")", "{", "$", "isAllowedToTroubleshootAsSuperUser", "=", "false", ";", "$", "salt", "=", "SettingsPiwik", "::", "getSalt", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "salt", ")", ")", ...
Let Super User troubleshoot in safe mode, even when Login is broken, with this special trick @return bool @throws Exception
[ "Let", "Super", "User", "troubleshoot", "in", "safe", "mode", "even", "when", "Login", "is", "broken", "with", "this", "special", "trick" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CorePluginsAdmin/Controller.php#L588-L597
209,490
matomo-org/matomo
core/UrlHelper.php
UrlHelper.getArrayFromQueryString
public static function getArrayFromQueryString($urlQuery) { if (strlen($urlQuery) == 0) { return array(); } // TODO: this method should not use a cache. callers should instead have their own cache, configured through DI. // one undesirable side effect of using a ca...
php
public static function getArrayFromQueryString($urlQuery) { if (strlen($urlQuery) == 0) { return array(); } // TODO: this method should not use a cache. callers should instead have their own cache, configured through DI. // one undesirable side effect of using a ca...
[ "public", "static", "function", "getArrayFromQueryString", "(", "$", "urlQuery", ")", "{", "if", "(", "strlen", "(", "$", "urlQuery", ")", "==", "0", ")", "{", "return", "array", "(", ")", ";", "}", "// TODO: this method should not use a cache. callers should inst...
Returns a URL query string as an array. @param string $urlQuery The query string, eg, `'?param1=value1&param2=value2'`. @return array eg, `array('param1' => 'value1', 'param2' => 'value2')` @api
[ "Returns", "a", "URL", "query", "string", "as", "an", "array", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/UrlHelper.php#L203-L268
209,491
matomo-org/matomo
core/UrlHelper.php
UrlHelper.getParameterFromQueryString
public static function getParameterFromQueryString($urlQuery, $parameter) { $nameToValue = self::getArrayFromQueryString($urlQuery); if (isset($nameToValue[$parameter])) { return $nameToValue[$parameter]; } return null; }
php
public static function getParameterFromQueryString($urlQuery, $parameter) { $nameToValue = self::getArrayFromQueryString($urlQuery); if (isset($nameToValue[$parameter])) { return $nameToValue[$parameter]; } return null; }
[ "public", "static", "function", "getParameterFromQueryString", "(", "$", "urlQuery", ",", "$", "parameter", ")", "{", "$", "nameToValue", "=", "self", "::", "getArrayFromQueryString", "(", "$", "urlQuery", ")", ";", "if", "(", "isset", "(", "$", "nameToValue",...
Returns the value of a single query parameter from the supplied query string. @param string $urlQuery The query string. @param string $parameter The query parameter name to return. @return string|null Parameter value if found (can be the empty string!), null if not found. @api
[ "Returns", "the", "value", "of", "a", "single", "query", "parameter", "from", "the", "supplied", "query", "string", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/UrlHelper.php#L278-L286
209,492
matomo-org/matomo
core/UrlHelper.php
UrlHelper.getPathAndQueryFromUrl
public static function getPathAndQueryFromUrl($url) { $parsedUrl = parse_url($url); $result = ''; if (isset($parsedUrl['path'])) { if (substr($parsedUrl['path'], 0, 1) == '/') { $parsedUrl['path'] = substr($parsedUrl['path'], 1); } $result ...
php
public static function getPathAndQueryFromUrl($url) { $parsedUrl = parse_url($url); $result = ''; if (isset($parsedUrl['path'])) { if (substr($parsedUrl['path'], 0, 1) == '/') { $parsedUrl['path'] = substr($parsedUrl['path'], 1); } $result ...
[ "public", "static", "function", "getPathAndQueryFromUrl", "(", "$", "url", ")", "{", "$", "parsedUrl", "=", "parse_url", "(", "$", "url", ")", ";", "$", "result", "=", "''", ";", "if", "(", "isset", "(", "$", "parsedUrl", "[", "'path'", "]", ")", ")"...
Returns the path and query string of a URL. @param string $url The URL. @return string eg, `/test/index.php?module=CoreHome` if `$url` is `http://piwik.org/test/index.php?module=CoreHome`. @api
[ "Returns", "the", "path", "and", "query", "string", "of", "a", "URL", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/UrlHelper.php#L295-L309
209,493
matomo-org/matomo
core/UrlHelper.php
UrlHelper.getQueryFromUrl
public static function getQueryFromUrl($url, array $additionalParamsToAdd = array()) { $url = @parse_url($url); $query = ''; if (!empty($url['query'])) { $query .= $url['query']; } if (!empty($additionalParamsToAdd)) { if (!empty($query)) { ...
php
public static function getQueryFromUrl($url, array $additionalParamsToAdd = array()) { $url = @parse_url($url); $query = ''; if (!empty($url['query'])) { $query .= $url['query']; } if (!empty($additionalParamsToAdd)) { if (!empty($query)) { ...
[ "public", "static", "function", "getQueryFromUrl", "(", "$", "url", ",", "array", "$", "additionalParamsToAdd", "=", "array", "(", ")", ")", "{", "$", "url", "=", "@", "parse_url", "(", "$", "url", ")", ";", "$", "query", "=", "''", ";", "if", "(", ...
Returns the query part from any valid url and adds additional parameters to the query part if needed. @param string $url Any url eg `"http://example.com/piwik/?foo=bar"` @param array $additionalParamsToAdd If not empty the given parameters will be added to the query. @return string eg. `"foo=bar&foo2=bar2"` @ap...
[ "Returns", "the", "query", "part", "from", "any", "valid", "url", "and", "adds", "additional", "parameters", "to", "the", "query", "part", "if", "needed", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/UrlHelper.php#L320-L338
209,494
matomo-org/matomo
libs/HTML/QuickForm2/Controller/SessionContainer.php
HTML_QuickForm2_Controller_SessionContainer.getValidationStatus
public function getValidationStatus($pageId) { return array_key_exists($pageId, $this->data['valid']) ? $this->data['valid'][$pageId]: null; }
php
public function getValidationStatus($pageId) { return array_key_exists($pageId, $this->data['valid']) ? $this->data['valid'][$pageId]: null; }
[ "public", "function", "getValidationStatus", "(", "$", "pageId", ")", "{", "return", "array_key_exists", "(", "$", "pageId", ",", "$", "this", "->", "data", "[", "'valid'", "]", ")", "?", "$", "this", "->", "data", "[", "'valid'", "]", "[", "$", "pageI...
Returns the page validation status kept in session @param string Page ID @return bool
[ "Returns", "the", "page", "validation", "status", "kept", "in", "session" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller/SessionContainer.php#L129-L134
209,495
matomo-org/matomo
libs/HTML/QuickForm2/Controller/SessionContainer.php
HTML_QuickForm2_Controller_SessionContainer.storeDatasources
public function storeDatasources(array $datasources) { foreach ($datasources as $ds) { if (!$ds instanceof HTML_QuickForm2_DataSource) { throw new HTML_QuickForm2_InvalidArgumentException( 'Array should contain only DataSource instances' ); ...
php
public function storeDatasources(array $datasources) { foreach ($datasources as $ds) { if (!$ds instanceof HTML_QuickForm2_DataSource) { throw new HTML_QuickForm2_InvalidArgumentException( 'Array should contain only DataSource instances' ); ...
[ "public", "function", "storeDatasources", "(", "array", "$", "datasources", ")", "{", "foreach", "(", "$", "datasources", "as", "$", "ds", ")", "{", "if", "(", "!", "$", "ds", "instanceof", "HTML_QuickForm2_DataSource", ")", "{", "throw", "new", "HTML_QuickF...
Stores the controller data sources @param array A new data source list @throws HTML_QuickForm2_InvalidArgumentException if given array contains something that is not a valid data source
[ "Stores", "the", "controller", "data", "sources" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller/SessionContainer.php#L143-L153
209,496
matomo-org/matomo
libs/HTML/QuickForm2/Controller/SessionContainer.php
HTML_QuickForm2_Controller_SessionContainer.storeOpaque
public function storeOpaque($name, $value) { if (!array_key_exists('opaque', $this->data)) { $this->data['opaque'] = array(); } $this->data['opaque'][$name] = $value; }
php
public function storeOpaque($name, $value) { if (!array_key_exists('opaque', $this->data)) { $this->data['opaque'] = array(); } $this->data['opaque'][$name] = $value; }
[ "public", "function", "storeOpaque", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "!", "array_key_exists", "(", "'opaque'", ",", "$", "this", "->", "data", ")", ")", "{", "$", "this", "->", "data", "[", "'opaque'", "]", "=", "array", "...
Stores some user-supplied parameter alongside controller data It is sometimes useful to pass some additional user data between pages of the form, thus this method. It will be removed with all the other data by {@link HTML_QuickForm2_Controller::destroySessionContainer()} @param string Parameter name @param str...
[ "Stores", "some", "user", "-", "supplied", "parameter", "alongside", "controller", "data" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller/SessionContainer.php#L175-L181
209,497
matomo-org/matomo
libs/HTML/QuickForm2/Controller/SessionContainer.php
HTML_QuickForm2_Controller_SessionContainer.getOpaque
public function getOpaque($name) { return (array_key_exists('opaque', $this->data) && array_key_exists($name, $this->data['opaque'])) ? $this->data['opaque'][$name]: null; }
php
public function getOpaque($name) { return (array_key_exists('opaque', $this->data) && array_key_exists($name, $this->data['opaque'])) ? $this->data['opaque'][$name]: null; }
[ "public", "function", "getOpaque", "(", "$", "name", ")", "{", "return", "(", "array_key_exists", "(", "'opaque'", ",", "$", "this", "->", "data", ")", "&&", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "data", "[", "'opaque'", "]", ")...
Returns a user-supplied parameter @param string Parameter name @return mixed
[ "Returns", "a", "user", "-", "supplied", "parameter" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller/SessionContainer.php#L189-L194
209,498
matomo-org/matomo
core/Columns/Dimension.php
Dimension.getMetricId
public function getMetricId() { if (!empty($this->metricId)) { return $this->metricId; } $id = $this->getId(); return str_replace(array('.', ' ', '-'), '_', strtolower($id)); }
php
public function getMetricId() { if (!empty($this->metricId)) { return $this->metricId; } $id = $this->getId(); return str_replace(array('.', ' ', '-'), '_', strtolower($id)); }
[ "public", "function", "getMetricId", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "metricId", ")", ")", "{", "return", "$", "this", "->", "metricId", ";", "}", "$", "id", "=", "$", "this", "->", "getId", "(", ")", ";", "return"...
Get the metricId which is used to generate metric names based on this dimension. @return string
[ "Get", "the", "metricId", "which", "is", "used", "to", "generate", "metric", "names", "based", "on", "this", "dimension", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L220-L229
209,499
matomo-org/matomo
core/Columns/Dimension.php
Dimension.getName
public function getName() { if (!empty($this->nameSingular)) { return Piwik::translate($this->nameSingular); } return $this->nameSingular; }
php
public function getName() { if (!empty($this->nameSingular)) { return Piwik::translate($this->nameSingular); } return $this->nameSingular; }
[ "public", "function", "getName", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "nameSingular", ")", ")", "{", "return", "Piwik", "::", "translate", "(", "$", "this", "->", "nameSingular", ")", ";", "}", "return", "$", "this", "->", ...
Returns the translated name of this dimension which is typically in singular. @return string
[ "Returns", "the", "translated", "name", "of", "this", "dimension", "which", "is", "typically", "in", "singular", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L344-L351