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,200
matomo-org/matomo
libs/Zend/Mail.php
Zend_Mail.setMessageId
public function setMessageId($id = true) { if ($id === null || $id === false) { return $this; } elseif ($id === true) { $id = $this->createMessageId(); } if ($this->_messageId === null) { $id = $this->_filterOther($id); $this->_message...
php
public function setMessageId($id = true) { if ($id === null || $id === false) { return $this; } elseif ($id === true) { $id = $this->createMessageId(); } if ($this->_messageId === null) { $id = $this->_filterOther($id); $this->_message...
[ "public", "function", "setMessageId", "(", "$", "id", "=", "true", ")", "{", "if", "(", "$", "id", "===", "null", "||", "$", "id", "===", "false", ")", "{", "return", "$", "this", ";", "}", "elseif", "(", "$", "id", "===", "true", ")", "{", "$"...
Sets the Message-ID of the message @param boolean|string $id true :Auto false :No set null :No set string:Sets given string (Angle brackets is not necessary) @return Zend_Mail Provides fluent interface @throws Zend_Mail_Exception
[ "Sets", "the", "Message", "-", "ID", "of", "the", "message" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail.php#L1042-L1063
209,201
matomo-org/matomo
libs/Zend/Mail.php
Zend_Mail.createMessageId
public function createMessageId() { $time = time(); if ($this->_from !== null) { $user = $this->_from; } elseif (isset($_SERVER['REMOTE_ADDR'])) { $user = $_SERVER['REMOTE_ADDR']; } else { $user = getmypid(); } $rand = mt_rand(); ...
php
public function createMessageId() { $time = time(); if ($this->_from !== null) { $user = $this->_from; } elseif (isset($_SERVER['REMOTE_ADDR'])) { $user = $_SERVER['REMOTE_ADDR']; } else { $user = getmypid(); } $rand = mt_rand(); ...
[ "public", "function", "createMessageId", "(", ")", "{", "$", "time", "=", "time", "(", ")", ";", "if", "(", "$", "this", "->", "_from", "!==", "null", ")", "{", "$", "user", "=", "$", "this", "->", "_from", ";", "}", "elseif", "(", "isset", "(", ...
Creates the Message-ID @return string
[ "Creates", "the", "Message", "-", "ID" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail.php#L1094-L1121
209,202
matomo-org/matomo
libs/Zend/Mail.php
Zend_Mail.addHeader
public function addHeader($name, $value, $append = false) { $prohibit = array('to', 'cc', 'bcc', 'from', 'subject', 'reply-to', 'return-path', 'date', 'message-id', ); if (in_array(strtolower($name), $prohibit)) { ...
php
public function addHeader($name, $value, $append = false) { $prohibit = array('to', 'cc', 'bcc', 'from', 'subject', 'reply-to', 'return-path', 'date', 'message-id', ); if (in_array(strtolower($name), $prohibit)) { ...
[ "public", "function", "addHeader", "(", "$", "name", ",", "$", "value", ",", "$", "append", "=", "false", ")", "{", "$", "prohibit", "=", "array", "(", "'to'", ",", "'cc'", ",", "'bcc'", ",", "'from'", ",", "'subject'", ",", "'reply-to'", ",", "'retu...
Add a custom header to the message @param string $name @param string $value @param boolean $append @return Zend_Mail Provides fluent interface @throws Zend_Mail_Exception on attempts to create standard headers
[ "Add", "a", "custom", "header", "to", "the", "message" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail.php#L1132-L1151
209,203
matomo-org/matomo
libs/Zend/Mail.php
Zend_Mail.send
public function send($transport = null) { if ($transport === null) { if (! self::$_defaultTransport instanceof Zend_Mail_Transport_Abstract) { // require_once 'Zend/Mail/Transport/Sendmail.php'; $transport = new Zend_Mail_Transport_Sendmail(); } else {...
php
public function send($transport = null) { if ($transport === null) { if (! self::$_defaultTransport instanceof Zend_Mail_Transport_Abstract) { // require_once 'Zend/Mail/Transport/Sendmail.php'; $transport = new Zend_Mail_Transport_Sendmail(); } else {...
[ "public", "function", "send", "(", "$", "transport", "=", "null", ")", "{", "if", "(", "$", "transport", "===", "null", ")", "{", "if", "(", "!", "self", "::", "$", "_defaultTransport", "instanceof", "Zend_Mail_Transport_Abstract", ")", "{", "// require_once...
Sends this email using the given transport or a previously set DefaultTransport or the internal mail function if no default transport had been set. @param Zend_Mail_Transport_Abstract $transport @return Zend_Mail Provides fluent interface
[ "Sends", "this", "email", "using", "the", "given", "transport", "or", "a", "previously", "set", "DefaultTransport", "or", "the", "internal", "mail", "function", "if", "no", "default", "transport", "had", "been", "set", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail.php#L1171-L1197
209,204
matomo-org/matomo
libs/Zend/Mail.php
Zend_Mail._formatAddress
protected function _formatAddress($email, $name) { if ($name === '' || $name === null || $name === $email) { return $email; } else { $encodedName = $this->_encodeHeader($name); if ($encodedName === $name && strcspn($name, '()<>[]:;@\\,') != strlen($name)) { ...
php
protected function _formatAddress($email, $name) { if ($name === '' || $name === null || $name === $email) { return $email; } else { $encodedName = $this->_encodeHeader($name); if ($encodedName === $name && strcspn($name, '()<>[]:;@\\,') != strlen($name)) { ...
[ "protected", "function", "_formatAddress", "(", "$", "email", ",", "$", "name", ")", "{", "if", "(", "$", "name", "===", "''", "||", "$", "name", "===", "null", "||", "$", "name", "===", "$", "email", ")", "{", "return", "$", "email", ";", "}", "...
Formats e-mail address @param string $email @param string $name @return string
[ "Formats", "e", "-", "mail", "address" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail.php#L1261-L1274
209,205
matomo-org/matomo
plugins/LanguagesManager/TranslationWriter/Filter/ByBaseTranslations.php
ByBaseTranslations.filter
public function filter($translations) { $cleanedTranslations = array(); foreach ($translations as $pluginName => $pluginTranslations) { if (empty($this->baseTranslations[$pluginName])) { $this->filteredData[$pluginName] = $pluginTranslations; continue; ...
php
public function filter($translations) { $cleanedTranslations = array(); foreach ($translations as $pluginName => $pluginTranslations) { if (empty($this->baseTranslations[$pluginName])) { $this->filteredData[$pluginName] = $pluginTranslations; continue; ...
[ "public", "function", "filter", "(", "$", "translations", ")", "{", "$", "cleanedTranslations", "=", "array", "(", ")", ";", "foreach", "(", "$", "translations", "as", "$", "pluginName", "=>", "$", "pluginTranslations", ")", "{", "if", "(", "empty", "(", ...
Removes all translations that aren't present in the base translations set in constructor @param array $translations @return array filtered translations
[ "Removes", "all", "translations", "that", "aren", "t", "present", "in", "the", "base", "translations", "set", "in", "constructor" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/TranslationWriter/Filter/ByBaseTranslations.php#L33-L61
209,206
matomo-org/matomo
libs/Zend/Cache/Backend/ZendPlatform.php
Zend_Cache_Backend_ZendPlatform._clean
private function _clean($dir, $mode) { $d = @dir($dir); if (!$d) { return false; } $result = true; while (false !== ($file = $d->read())) { if ($file == '.' || $file == '..') { continue; } $file = $d->path . $fil...
php
private function _clean($dir, $mode) { $d = @dir($dir); if (!$d) { return false; } $result = true; while (false !== ($file = $d->read())) { if ($file == '.' || $file == '..') { continue; } $file = $d->path . $fil...
[ "private", "function", "_clean", "(", "$", "dir", ",", "$", "mode", ")", "{", "$", "d", "=", "@", "dir", "(", "$", "dir", ")", ";", "if", "(", "!", "$", "d", ")", "{", "return", "false", ";", "}", "$", "result", "=", "true", ";", "while", "...
Clean a directory and recursivly go over it's subdirectories Remove all the cached files that need to be cleaned (according to mode and files mtime) @param string $dir Path of directory ot clean @param string $mode The same parameter as in Zend_Cache_Backend_ZendPlatform::clean() @return boolean True if ok
[ "Clean", "a", "directory", "and", "recursivly", "go", "over", "it", "s", "subdirectories" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/ZendPlatform.php#L260-L289
209,207
matomo-org/matomo
plugins/SEO/API.php
API.getRank
public function getRank($url) { Piwik::checkUserHasSomeViewAccess(); $metricProvider = new ProviderCache(new Aggregator()); $domain = Url::getHostFromUrl($url); $metrics = $metricProvider->getMetrics($domain); return $this->toDataTable($metrics); }
php
public function getRank($url) { Piwik::checkUserHasSomeViewAccess(); $metricProvider = new ProviderCache(new Aggregator()); $domain = Url::getHostFromUrl($url); $metrics = $metricProvider->getMetrics($domain); return $this->toDataTable($metrics); }
[ "public", "function", "getRank", "(", "$", "url", ")", "{", "Piwik", "::", "checkUserHasSomeViewAccess", "(", ")", ";", "$", "metricProvider", "=", "new", "ProviderCache", "(", "new", "Aggregator", "(", ")", ")", ";", "$", "domain", "=", "Url", "::", "ge...
Returns SEO statistics for a URL. @param string $url URL to request SEO stats for @return DataTable
[ "Returns", "SEO", "statistics", "for", "a", "URL", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SEO/API.php#L38-L47
209,208
matomo-org/matomo
libs/HTML/QuickForm2/Loader.php
HTML_QuickForm2_Loader.loadClass
public static function loadClass($className, $includeFile = null) { if (class_exists($className, false) || interface_exists($className, false)) { return true; } if (empty($includeFile)) { $includeFile = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; ...
php
public static function loadClass($className, $includeFile = null) { if (class_exists($className, false) || interface_exists($className, false)) { return true; } if (empty($includeFile)) { $includeFile = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; ...
[ "public", "static", "function", "loadClass", "(", "$", "className", ",", "$", "includeFile", "=", "null", ")", "{", "if", "(", "class_exists", "(", "$", "className", ",", "false", ")", "||", "interface_exists", "(", "$", "className", ",", "false", ")", "...
Tries to load a given class If no $includeFile was provided, $className will be used with underscores replaced with path separators and '.php' extension appended @param string Class name to load @param string Name of the file (supposedly) containing the given class @throws HTML_QuickForm2_NotFoundException ...
[ "Tries", "to", "load", "a", "given", "class" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Loader.php#L74-L98
209,209
matomo-org/matomo
libs/HTML/QuickForm2/Loader.php
HTML_QuickForm2_Loader.fileExists
public static function fileExists($fileName) { $fp = @fopen($fileName, 'r', true); if (is_resource($fp)) { fclose($fp); return true; } return false; }
php
public static function fileExists($fileName) { $fp = @fopen($fileName, 'r', true); if (is_resource($fp)) { fclose($fp); return true; } return false; }
[ "public", "static", "function", "fileExists", "(", "$", "fileName", ")", "{", "$", "fp", "=", "@", "fopen", "(", "$", "fileName", ",", "'r'", ",", "true", ")", ";", "if", "(", "is_resource", "(", "$", "fp", ")", ")", "{", "fclose", "(", "$", "fp"...
Checks whether the file exists in the include path @param string file name @return bool
[ "Checks", "whether", "the", "file", "exists", "in", "the", "include", "path" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Loader.php#L106-L114
209,210
matomo-org/matomo
core/DataAccess/RawLogDao.php
RawLogDao.deleteFromLogTable
public function deleteFromLogTable($tableName, $visitIds) { $sql = "DELETE FROM `" . Common::prefixTable($tableName) . "` WHERE idvisit IN " . $this->getInFieldExpressionWithInts($visitIds); $statement = Db::query($sql); return $statement->rowCount(); }
php
public function deleteFromLogTable($tableName, $visitIds) { $sql = "DELETE FROM `" . Common::prefixTable($tableName) . "` WHERE idvisit IN " . $this->getInFieldExpressionWithInts($visitIds); $statement = Db::query($sql); return $statement->rowCount(); }
[ "public", "function", "deleteFromLogTable", "(", "$", "tableName", ",", "$", "visitIds", ")", "{", "$", "sql", "=", "\"DELETE FROM `\"", ".", "Common", "::", "prefixTable", "(", "$", "tableName", ")", ".", "\"` WHERE idvisit IN \"", ".", "$", "this", "->", "...
Deletes conversions for the supplied visit IDs from log_conversion. This method does not cascade, so conversion items will not be deleted. @param int[] $visitIds @return int The number of deleted rows.
[ "Deletes", "conversions", "for", "the", "supplied", "visit", "IDs", "from", "log_conversion", ".", "This", "method", "does", "not", "cascade", "so", "conversion", "items", "will", "not", "be", "deleted", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/RawLogDao.php#L130-L137
209,211
matomo-org/matomo
core/DataAccess/RawLogDao.php
RawLogDao.deleteConversionItems
public function deleteConversionItems($visitIds) { $sql = "DELETE FROM `" . Common::prefixTable('log_conversion_item') . "` WHERE idvisit IN " . $this->getInFieldExpressionWithInts($visitIds); $statement = Db::query($sql); return $statement->rowCount(); }
php
public function deleteConversionItems($visitIds) { $sql = "DELETE FROM `" . Common::prefixTable('log_conversion_item') . "` WHERE idvisit IN " . $this->getInFieldExpressionWithInts($visitIds); $statement = Db::query($sql); return $statement->rowCount(); }
[ "public", "function", "deleteConversionItems", "(", "$", "visitIds", ")", "{", "$", "sql", "=", "\"DELETE FROM `\"", ".", "Common", "::", "prefixTable", "(", "'log_conversion_item'", ")", ".", "\"` WHERE idvisit IN \"", ".", "$", "this", "->", "getInFieldExpressionW...
Deletes conversion items for the supplied visit IDs from log_conversion_item. @param int[] $visitIds @return int The number of deleted rows.
[ "Deletes", "conversion", "items", "for", "the", "supplied", "visit", "IDs", "from", "log_conversion_item", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/RawLogDao.php#L145-L152
209,212
matomo-org/matomo
core/DataAccess/RawLogDao.php
RawLogDao.deleteUnusedLogActions
public function deleteUnusedLogActions() { if (!Db::isLockPrivilegeGranted()) { throw new \Exception("RawLogDao.deleteUnusedLogActions() requires table locking permission in order to complete without error."); } // get current max ID in log tables w/ idaction references. ...
php
public function deleteUnusedLogActions() { if (!Db::isLockPrivilegeGranted()) { throw new \Exception("RawLogDao.deleteUnusedLogActions() requires table locking permission in order to complete without error."); } // get current max ID in log tables w/ idaction references. ...
[ "public", "function", "deleteUnusedLogActions", "(", ")", "{", "if", "(", "!", "Db", "::", "isLockPrivilegeGranted", "(", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "\"RawLogDao.deleteUnusedLogActions() requires table locking permission in order to complete with...
Deletes all unused entries from the log_action table. This method uses a temporary table to store used actions, and then deletes rows from log_action that are not in this temporary table. Table locking is required to avoid concurrency issues. @throws \Exception If table locking permission is not granted to the curren...
[ "Deletes", "all", "unused", "entries", "from", "the", "log_action", "table", ".", "This", "method", "uses", "a", "temporary", "table", "to", "store", "used", "actions", "and", "then", "deletes", "rows", "from", "log_action", "that", "are", "not", "in", "this...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/RawLogDao.php#L162-L187
209,213
matomo-org/matomo
core/DataAccess/RawLogDao.php
RawLogDao.hasSiteVisitsBetweenTimeframe
public function hasSiteVisitsBetweenTimeframe($fromDateTime, $toDateTime, $idSite) { $sites = Db::fetchOne("SELECT 1 FROM " . Common::prefixTable('log_visit') . " WHERE idsite = ? AND visit_last_action_time > ? AND visit_last_action_time < ? ...
php
public function hasSiteVisitsBetweenTimeframe($fromDateTime, $toDateTime, $idSite) { $sites = Db::fetchOne("SELECT 1 FROM " . Common::prefixTable('log_visit') . " WHERE idsite = ? AND visit_last_action_time > ? AND visit_last_action_time < ? ...
[ "public", "function", "hasSiteVisitsBetweenTimeframe", "(", "$", "fromDateTime", ",", "$", "toDateTime", ",", "$", "idSite", ")", "{", "$", "sites", "=", "Db", "::", "fetchOne", "(", "\"SELECT 1\n FROM \"", ".", "Common", "::", "prefixTable", "(", ...
Returns the list of the website IDs that received some visits between the specified timestamp. @param string $fromDateTime @param string $toDateTime @return bool true if there are visits for this site between the given timeframe, false if not
[ "Returns", "the", "list", "of", "the", "website", "IDs", "that", "received", "some", "visits", "between", "the", "specified", "timestamp", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/RawLogDao.php#L196-L206
209,214
matomo-org/matomo
core/DataAccess/RawLogDao.php
RawLogDao.createLogIterationQuery
private function createLogIterationQuery($logTable, $idField, $fields, $conditions, $iterationStep) { $bind = array(); $sql = "SELECT " . implode(', ', $fields) . " FROM `" . Common::prefixTable($logTable) . "` WHERE $idField > ?"; foreach ($conditions as $condition) { list($co...
php
private function createLogIterationQuery($logTable, $idField, $fields, $conditions, $iterationStep) { $bind = array(); $sql = "SELECT " . implode(', ', $fields) . " FROM `" . Common::prefixTable($logTable) . "` WHERE $idField > ?"; foreach ($conditions as $condition) { list($co...
[ "private", "function", "createLogIterationQuery", "(", "$", "logTable", ",", "$", "idField", ",", "$", "fields", ",", "$", "conditions", ",", "$", "iterationStep", ")", "{", "$", "bind", "=", "array", "(", ")", ";", "$", "sql", "=", "\"SELECT \"", ".", ...
mapping for dimensions => segments, and each dimension should automatically have a segment.
[ "mapping", "for", "dimensions", "=", ">", "segments", "and", "each", "dimension", "should", "automatically", "have", "a", "segment", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/RawLogDao.php#L249-L272
209,215
matomo-org/matomo
core/DataAccess/RawLogDao.php
RawLogDao.insertActionsToKeep
protected function insertActionsToKeep($maxIds, $olderThan = true, $insertIntoTempIterationStep = 100000) { $tempTableName = Common::prefixTable(self::DELETE_UNUSED_ACTIONS_TEMP_TABLE_NAME); $idColumns = $this->getTableIdColumns(); foreach ($this->dimensionMetadataProvider->getActionReferen...
php
protected function insertActionsToKeep($maxIds, $olderThan = true, $insertIntoTempIterationStep = 100000) { $tempTableName = Common::prefixTable(self::DELETE_UNUSED_ACTIONS_TEMP_TABLE_NAME); $idColumns = $this->getTableIdColumns(); foreach ($this->dimensionMetadataProvider->getActionReferen...
[ "protected", "function", "insertActionsToKeep", "(", "$", "maxIds", ",", "$", "olderThan", "=", "true", ",", "$", "insertIntoTempIterationStep", "=", "100000", ")", "{", "$", "tempTableName", "=", "Common", "::", "prefixTable", "(", "self", "::", "DELETE_UNUSED_...
protected for testing purposes
[ "protected", "for", "testing", "purposes" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/RawLogDao.php#L324-L371
209,216
matomo-org/matomo
plugins/MultiSites/Dashboard.php
Dashboard.makeSitesFlatAndApplyGenericFilters
private function makeSitesFlatAndApplyGenericFilters(DataTable $table, $request) { // we handle limit here as we have to apply sort filter, then make sites flat, then apply limit filter. $filterOffset = $request['filter_offset']; $filterLimit = $request['filter_limit']; unset($reque...
php
private function makeSitesFlatAndApplyGenericFilters(DataTable $table, $request) { // we handle limit here as we have to apply sort filter, then make sites flat, then apply limit filter. $filterOffset = $request['filter_offset']; $filterLimit = $request['filter_limit']; unset($reque...
[ "private", "function", "makeSitesFlatAndApplyGenericFilters", "(", "DataTable", "$", "table", ",", "$", "request", ")", "{", "// we handle limit here as we have to apply sort filter, then make sites flat, then apply limit filter.", "$", "filterOffset", "=", "$", "request", "[", ...
Makes sure to not have any subtables anymore. So if $table is array( site1 site2 subtable => site3 site4 site5 site6 site7 ) it will return array( site1 site2 site3 site4 site5 site6 site7 ) in a sorted order @param DataTable $table @param array $request
[ "Makes", "sure", "to", "not", "have", "any", "subtables", "anymore", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MultiSites/Dashboard.php#L308-L336
209,217
matomo-org/matomo
core/ArchiveProcessor/Rules.php
Rules.getDoneFlags
public static function getDoneFlags(array $plugins, Segment $segment) { $doneFlags = array(); $doneAllPlugins = self::getDoneFlagArchiveContainsAllPlugins($segment); $doneFlags[$doneAllPlugins] = $doneAllPlugins; $plugins = array_unique($plugins); foreach ($plugins as $plugi...
php
public static function getDoneFlags(array $plugins, Segment $segment) { $doneFlags = array(); $doneAllPlugins = self::getDoneFlagArchiveContainsAllPlugins($segment); $doneFlags[$doneAllPlugins] = $doneAllPlugins; $plugins = array_unique($plugins); foreach ($plugins as $plugi...
[ "public", "static", "function", "getDoneFlags", "(", "array", "$", "plugins", ",", "Segment", "$", "segment", ")", "{", "$", "doneFlags", "=", "array", "(", ")", ";", "$", "doneAllPlugins", "=", "self", "::", "getDoneFlagArchiveContainsAllPlugins", "(", "$", ...
Return done flags used to tell how the archiving process for a specific archive was completed, @param array $plugins @param $segment @return array
[ "Return", "done", "flags", "used", "to", "tell", "how", "the", "archiving", "process", "for", "a", "specific", "archive", "was", "completed" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor/Rules.php#L101-L113
209,218
matomo-org/matomo
core/ArchiveProcessor/Rules.php
Rules.getSelectableDoneFlagValues
public static function getSelectableDoneFlagValues() { $possibleValues = array(ArchiveWriter::DONE_OK, ArchiveWriter::DONE_OK_TEMPORARY); if (!Rules::isRequestAuthorizedToArchive()) { //If request is not authorized to archive then fetch also invalidated archives $possibleVal...
php
public static function getSelectableDoneFlagValues() { $possibleValues = array(ArchiveWriter::DONE_OK, ArchiveWriter::DONE_OK_TEMPORARY); if (!Rules::isRequestAuthorizedToArchive()) { //If request is not authorized to archive then fetch also invalidated archives $possibleVal...
[ "public", "static", "function", "getSelectableDoneFlagValues", "(", ")", "{", "$", "possibleValues", "=", "array", "(", "ArchiveWriter", "::", "DONE_OK", ",", "ArchiveWriter", "::", "DONE_OK_TEMPORARY", ")", ";", "if", "(", "!", "Rules", "::", "isRequestAuthorized...
Returns done flag values allowed to be selected @return string
[ "Returns", "done", "flag", "values", "allowed", "to", "be", "selected" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor/Rules.php#L296-L306
209,219
matomo-org/matomo
core/DataTable/Renderer/Html.php
Html.buildTableStructure
protected function buildTableStructure($table, $columnToAdd = null, $valueToAdd = null) { $i = $this->i; $someMetadata = false; $someIdSubTable = false; /* * table = array * ROW1 = col1 | col2 | col3 | metadata | idSubTable * ROW2 = col1 | col2 (no value b...
php
protected function buildTableStructure($table, $columnToAdd = null, $valueToAdd = null) { $i = $this->i; $someMetadata = false; $someIdSubTable = false; /* * table = array * ROW1 = col1 | col2 | col3 | metadata | idSubTable * ROW2 = col1 | col2 (no value b...
[ "protected", "function", "buildTableStructure", "(", "$", "table", ",", "$", "columnToAdd", "=", "null", ",", "$", "valueToAdd", "=", "null", ")", "{", "$", "i", "=", "$", "this", "->", "i", ";", "$", "someMetadata", "=", "false", ";", "$", "someIdSubT...
Adds the given data table to the table structure array @param DataTable $table @param null|string $columnToAdd @param null|string $valueToAdd @throws Exception
[ "Adds", "the", "given", "data", "table", "to", "the", "table", "structure", "array" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Html.php#L91-L144
209,220
matomo-org/matomo
core/DataTable/Renderer/Html.php
Html.renderDataTable
protected function renderDataTable() { $html = "<table " . ($this->tableId ? "id=\"{$this->tableId}\" " : "") . "border=\"1\">\n<thead>\n\t<tr>\n"; foreach ($this->allColumns as $name => $toDisplay) { if ($toDisplay !== false) { if ($name === 0) { $na...
php
protected function renderDataTable() { $html = "<table " . ($this->tableId ? "id=\"{$this->tableId}\" " : "") . "border=\"1\">\n<thead>\n\t<tr>\n"; foreach ($this->allColumns as $name => $toDisplay) { if ($toDisplay !== false) { if ($name === 0) { $na...
[ "protected", "function", "renderDataTable", "(", ")", "{", "$", "html", "=", "\"<table \"", ".", "(", "$", "this", "->", "tableId", "?", "\"id=\\\"{$this->tableId}\\\" \"", ":", "\"\"", ")", ".", "\"border=\\\"1\\\">\\n<thead>\\n\\t<tr>\\n\"", ";", "foreach", "(", ...
Computes the output for the table structure array @return string
[ "Computes", "the", "output", "for", "the", "table", "structure", "array" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Html.php#L151-L191
209,221
matomo-org/matomo
core/Tracker/Visit/ReferrerSpamFilter.php
ReferrerSpamFilter.isSpam
public function isSpam(Request $request) { $spammers = $this->getSpammerListFromCache(); $referrerUrl = $request->getParam('urlref'); foreach ($spammers as $spammerHost) { if (stripos($referrerUrl, $spammerHost) !== false) { Common::printDebug('Referrer URL is a...
php
public function isSpam(Request $request) { $spammers = $this->getSpammerListFromCache(); $referrerUrl = $request->getParam('urlref'); foreach ($spammers as $spammerHost) { if (stripos($referrerUrl, $spammerHost) !== false) { Common::printDebug('Referrer URL is a...
[ "public", "function", "isSpam", "(", "Request", "$", "request", ")", "{", "$", "spammers", "=", "$", "this", "->", "getSpammerListFromCache", "(", ")", ";", "$", "referrerUrl", "=", "$", "request", "->", "getParam", "(", "'urlref'", ")", ";", "foreach", ...
Check if the request is from a known spammer host. @param Request $request @return bool
[ "Check", "if", "the", "request", "is", "from", "a", "known", "spammer", "host", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Visit/ReferrerSpamFilter.php#L33-L47
209,222
matomo-org/matomo
plugins/Referrers/Referrers.php
Referrers.setGetAllHtmlPrefix
public function setGetAllHtmlPrefix($referrerType) { // get singular label for referrer type $indexTranslation = ''; switch ($referrerType) { case Common::REFERRER_TYPE_DIRECT_ENTRY: $indexTranslation = 'Referrers_DirectEntry'; break; c...
php
public function setGetAllHtmlPrefix($referrerType) { // get singular label for referrer type $indexTranslation = ''; switch ($referrerType) { case Common::REFERRER_TYPE_DIRECT_ENTRY: $indexTranslation = 'Referrers_DirectEntry'; break; c...
[ "public", "function", "setGetAllHtmlPrefix", "(", "$", "referrerType", ")", "{", "// get singular label for referrer type", "$", "indexTranslation", "=", "''", ";", "switch", "(", "$", "referrerType", ")", "{", "case", "Common", "::", "REFERRER_TYPE_DIRECT_ENTRY", ":"...
DataTable filter callback that returns the HTML prefix for a label in the 'getAll' report based on the row's referrer type. @param int $referrerType The referrer type. @return string
[ "DataTable", "filter", "callback", "that", "returns", "the", "HTML", "prefix", "for", "a", "label", "in", "the", "getAll", "report", "based", "on", "the", "row", "s", "referrer", "type", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Referrers.php#L101-L131
209,223
matomo-org/matomo
core/Archive/DataTableFactory.php
DataTableFactory.getSiteIdFromMetadata
public static function getSiteIdFromMetadata(DataTable $table) { $site = $table->getMetadata('site'); if (empty($site)) { return null; } else { return $site->getId(); } }
php
public static function getSiteIdFromMetadata(DataTable $table) { $site = $table->getMetadata('site'); if (empty($site)) { return null; } else { return $site->getId(); } }
[ "public", "static", "function", "getSiteIdFromMetadata", "(", "DataTable", "$", "table", ")", "{", "$", "site", "=", "$", "table", "->", "getMetadata", "(", "'site'", ")", ";", "if", "(", "empty", "(", "$", "site", ")", ")", "{", "return", "null", ";",...
Returns the ID of the site a table is related to based on the 'site' metadata entry, or null if there is none. @param DataTable $table @return int|null
[ "Returns", "the", "ID", "of", "the", "site", "a", "table", "is", "related", "to", "based", "on", "the", "site", "metadata", "entry", "or", "null", "if", "there", "is", "none", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataTableFactory.php#L106-L114
209,224
matomo-org/matomo
core/Archive/DataTableFactory.php
DataTableFactory.make
public function make($index, $resultIndices) { $keyMetadata = $this->getDefaultMetadata(); if (empty($resultIndices)) { // for numeric data, if there's no index (and thus only 1 site & period in the query), // we want to display every queried metric name if (empt...
php
public function make($index, $resultIndices) { $keyMetadata = $this->getDefaultMetadata(); if (empty($resultIndices)) { // for numeric data, if there's no index (and thus only 1 site & period in the query), // we want to display every queried metric name if (empt...
[ "public", "function", "make", "(", "$", "index", ",", "$", "resultIndices", ")", "{", "$", "keyMetadata", "=", "$", "this", "->", "getDefaultMetadata", "(", ")", ";", "if", "(", "empty", "(", "$", "resultIndices", ")", ")", "{", "// for numeric data, if th...
Creates a DataTable|Set instance using an index of archive data. @param array $index @see DataCollection @param array $resultIndices an array mapping metadata names with pretty metadata labels. @return DataTable|DataTable\Map
[ "Creates", "a", "DataTable|Set", "instance", "using", "an", "index", "of", "archive", "data", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataTableFactory.php#L163-L182
209,225
matomo-org/matomo
core/Archive/DataTableFactory.php
DataTableFactory.makeFromBlobRow
private function makeFromBlobRow($blobRow, $keyMetadata) { if ($blobRow === false) { return new DataTable(); } if (count($this->dataNames) === 1) { return $this->makeDataTableFromSingleBlob($blobRow, $keyMetadata); } else { return $this->makeIndex...
php
private function makeFromBlobRow($blobRow, $keyMetadata) { if ($blobRow === false) { return new DataTable(); } if (count($this->dataNames) === 1) { return $this->makeDataTableFromSingleBlob($blobRow, $keyMetadata); } else { return $this->makeIndex...
[ "private", "function", "makeFromBlobRow", "(", "$", "blobRow", ",", "$", "keyMetadata", ")", "{", "if", "(", "$", "blobRow", "===", "false", ")", "{", "return", "new", "DataTable", "(", ")", ";", "}", "if", "(", "count", "(", "$", "this", "->", "data...
Creates a DataTable|Set instance using an array of blobs. If only one record is being queried, a single DataTable will be returned. Otherwise, a DataTable\Map is returned that indexes DataTables by record name. If expandDataTable was called, and only one record is being queried, the created DataTable's subtables will...
[ "Creates", "a", "DataTable|Set", "instance", "using", "an", "array", "of", "blobs", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataTableFactory.php#L239-L250
209,226
matomo-org/matomo
core/Archive/DataTableFactory.php
DataTableFactory.makeDataTableFromSingleBlob
private function makeDataTableFromSingleBlob($blobRow, $keyMetadata) { $recordName = reset($this->dataNames); if ($this->idSubtable !== null) { $recordName .= '_' . $this->idSubtable; } if (!empty($blobRow[$recordName])) { $table = DataTable::fromSerializedAr...
php
private function makeDataTableFromSingleBlob($blobRow, $keyMetadata) { $recordName = reset($this->dataNames); if ($this->idSubtable !== null) { $recordName .= '_' . $this->idSubtable; } if (!empty($blobRow[$recordName])) { $table = DataTable::fromSerializedAr...
[ "private", "function", "makeDataTableFromSingleBlob", "(", "$", "blobRow", ",", "$", "keyMetadata", ")", "{", "$", "recordName", "=", "reset", "(", "$", "this", "->", "dataNames", ")", ";", "if", "(", "$", "this", "->", "idSubtable", "!==", "null", ")", ...
Creates a DataTable for one record from an archive data row. @see makeFromBlobRow @param array $blobRow @return DataTable
[ "Creates", "a", "DataTable", "for", "one", "record", "from", "an", "archive", "data", "row", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataTableFactory.php#L260-L282
209,227
matomo-org/matomo
core/Archive/DataTableFactory.php
DataTableFactory.makeIndexedByRecordNameDataTable
private function makeIndexedByRecordNameDataTable($blobRow, $keyMetadata) { $table = new DataTable\Map(); $table->setKeyName('recordName'); $tableMetadata = array_merge(DataCollection::getDataRowMetadata($blobRow), $keyMetadata); foreach ($blobRow as $name => $blob) { $...
php
private function makeIndexedByRecordNameDataTable($blobRow, $keyMetadata) { $table = new DataTable\Map(); $table->setKeyName('recordName'); $tableMetadata = array_merge(DataCollection::getDataRowMetadata($blobRow), $keyMetadata); foreach ($blobRow as $name => $blob) { $...
[ "private", "function", "makeIndexedByRecordNameDataTable", "(", "$", "blobRow", ",", "$", "keyMetadata", ")", "{", "$", "table", "=", "new", "DataTable", "\\", "Map", "(", ")", ";", "$", "table", "->", "setKeyName", "(", "'recordName'", ")", ";", "$", "tab...
Creates a DataTable for every record in an archive data row and puts them in a DataTable\Map instance. @param array $blobRow @return DataTable\Map
[ "Creates", "a", "DataTable", "for", "every", "record", "in", "an", "archive", "data", "row", "and", "puts", "them", "in", "a", "DataTable", "\\", "Map", "instance", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataTableFactory.php#L291-L306
209,228
matomo-org/matomo
core/Archive/DataTableFactory.php
DataTableFactory.createDataTableMapFromIndex
private function createDataTableMapFromIndex($index, $resultIndices, $keyMetadata) { $result = new DataTable\Map(); $result->setKeyName(reset($resultIndices)); $resultIndex = key($resultIndices); array_shift($resultIndices); $hasIndices = !empty($resultIndices); fo...
php
private function createDataTableMapFromIndex($index, $resultIndices, $keyMetadata) { $result = new DataTable\Map(); $result->setKeyName(reset($resultIndices)); $resultIndex = key($resultIndices); array_shift($resultIndices); $hasIndices = !empty($resultIndices); fo...
[ "private", "function", "createDataTableMapFromIndex", "(", "$", "index", ",", "$", "resultIndices", ",", "$", "keyMetadata", ")", "{", "$", "result", "=", "new", "DataTable", "\\", "Map", "(", ")", ";", "$", "result", "->", "setKeyName", "(", "reset", "(",...
Creates a Set from an array index. @param array $index @see DataCollection @param array $resultIndices @see make @param array $keyMetadata The metadata to add to the table when it's created. @return DataTable\Map
[ "Creates", "a", "Set", "from", "an", "array", "index", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataTableFactory.php#L316-L339
209,229
matomo-org/matomo
core/Archive/DataTableFactory.php
DataTableFactory.createDataTable
private function createDataTable($data, $keyMetadata) { if ($this->dataType == 'blob') { $result = $this->makeFromBlobRow($data, $keyMetadata); } else { $result = $this->makeFromMetricsArray($data, $keyMetadata); } return $result; }
php
private function createDataTable($data, $keyMetadata) { if ($this->dataType == 'blob') { $result = $this->makeFromBlobRow($data, $keyMetadata); } else { $result = $this->makeFromMetricsArray($data, $keyMetadata); } return $result; }
[ "private", "function", "createDataTable", "(", "$", "data", ",", "$", "keyMetadata", ")", "{", "if", "(", "$", "this", "->", "dataType", "==", "'blob'", ")", "{", "$", "result", "=", "$", "this", "->", "makeFromBlobRow", "(", "$", "data", ",", "$", "...
Creates a DataTable instance from an index row. @param array $data An archive data row. @param array $keyMetadata The metadata to add to the table(s) when created. @return DataTable|DataTable\Map
[ "Creates", "a", "DataTable", "instance", "from", "an", "index", "row", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataTableFactory.php#L357-L366
209,230
matomo-org/matomo
core/Archive/DataTableFactory.php
DataTableFactory.prettifyIndexLabel
private function prettifyIndexLabel($labelType, $label) { if ($labelType == self::TABLE_METADATA_PERIOD_INDEX) { // prettify period labels $period = $this->periods[$label]; $label = $period->getLabel(); if ($label === 'week' || $label === 'range') { return...
php
private function prettifyIndexLabel($labelType, $label) { if ($labelType == self::TABLE_METADATA_PERIOD_INDEX) { // prettify period labels $period = $this->periods[$label]; $label = $period->getLabel(); if ($label === 'week' || $label === 'range') { return...
[ "private", "function", "prettifyIndexLabel", "(", "$", "labelType", ",", "$", "label", ")", "{", "if", "(", "$", "labelType", "==", "self", "::", "TABLE_METADATA_PERIOD_INDEX", ")", "{", "// prettify period labels", "$", "period", "=", "$", "this", "->", "peri...
Returns the pretty version of an index label. @param string $labelType eg, 'site', 'period', etc. @param string $label eg, '0', '1', '2012-01-01,2012-01-31', etc. @return string
[ "Returns", "the", "pretty", "version", "of", "an", "index", "label", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataTableFactory.php#L432-L444
209,231
matomo-org/matomo
core/ViewDataTable/Factory.php
Factory.getReport
private static function getReport($apiAction) { if (strpos($apiAction, '.') === false) { return; } list($module, $action) = explode('.', $apiAction); $report = ReportsProvider::factory($module, $action); return $report; }
php
private static function getReport($apiAction) { if (strpos($apiAction, '.') === false) { return; } list($module, $action) = explode('.', $apiAction); $report = ReportsProvider::factory($module, $action); return $report; }
[ "private", "static", "function", "getReport", "(", "$", "apiAction", ")", "{", "if", "(", "strpos", "(", "$", "apiAction", ",", "'.'", ")", "===", "false", ")", "{", "return", ";", "}", "list", "(", "$", "module", ",", "$", "action", ")", "=", "exp...
Return the report object for the given apiAction @param $apiAction @return null|Report
[ "Return", "the", "report", "object", "for", "the", "given", "apiAction" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Factory.php#L175-L184
209,232
matomo-org/matomo
core/ViewDataTable/Factory.php
Factory.getDefaultViewTypeForReport
private static function getDefaultViewTypeForReport($report, $apiAction) { if (!empty($report) && $report->isEnabled()) { return $report->getDefaultTypeViewDataTable(); } return false; }
php
private static function getDefaultViewTypeForReport($report, $apiAction) { if (!empty($report) && $report->isEnabled()) { return $report->getDefaultTypeViewDataTable(); } return false; }
[ "private", "static", "function", "getDefaultViewTypeForReport", "(", "$", "report", ",", "$", "apiAction", ")", "{", "if", "(", "!", "empty", "(", "$", "report", ")", "&&", "$", "report", "->", "isEnabled", "(", ")", ")", "{", "return", "$", "report", ...
Returns the default viewDataTable ID to use when determining which visualization to use. @param Report $report @param string $apiAction @return bool|string
[ "Returns", "the", "default", "viewDataTable", "ID", "to", "use", "when", "determining", "which", "visualization", "to", "use", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Factory.php#L194-L201
209,233
matomo-org/matomo
plugins/Goals/API.php
API.getGoal
public function getGoal($idSite, $idGoal) { Piwik::checkUserHasViewAccess($idSite); $goal = $this->getModel()->getActiveGoal($idSite, $idGoal); if (!empty($goal)) { return $this->formatGoal($goal); } }
php
public function getGoal($idSite, $idGoal) { Piwik::checkUserHasViewAccess($idSite); $goal = $this->getModel()->getActiveGoal($idSite, $idGoal); if (!empty($goal)) { return $this->formatGoal($goal); } }
[ "public", "function", "getGoal", "(", "$", "idSite", ",", "$", "idGoal", ")", "{", "Piwik", "::", "checkUserHasViewAccess", "(", "$", "idSite", ")", ";", "$", "goal", "=", "$", "this", "->", "getModel", "(", ")", "->", "getActiveGoal", "(", "$", "idSit...
Return a single goal. @param int $idSite @param int $idGoal @return array An array of goal attributes.
[ "Return", "a", "single", "goal", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L68-L77
209,234
matomo-org/matomo
plugins/Goals/API.php
API.getGoals
public function getGoals($idSite) { $cacheId = self::getCacheId($idSite); $cache = $this->getGoalsInfoStaticCache(); if (!$cache->contains($cacheId)) { // note: the reason this is secure is because the above cache is a static cache and cleared after each request // if...
php
public function getGoals($idSite) { $cacheId = self::getCacheId($idSite); $cache = $this->getGoalsInfoStaticCache(); if (!$cache->contains($cacheId)) { // note: the reason this is secure is because the above cache is a static cache and cleared after each request // if...
[ "public", "function", "getGoals", "(", "$", "idSite", ")", "{", "$", "cacheId", "=", "self", "::", "getCacheId", "(", "$", "idSite", ")", ";", "$", "cache", "=", "$", "this", "->", "getGoalsInfoStaticCache", "(", ")", ";", "if", "(", "!", "$", "cache...
Returns all Goals for a given website, or list of websites @param string|array $idSite Array or Comma separated list of website IDs to request the goals for @return array Array of Goal attributes
[ "Returns", "all", "Goals", "for", "a", "given", "website", "or", "list", "of", "websites" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L85-L112
209,235
matomo-org/matomo
plugins/Goals/API.php
API.addGoal
public function addGoal($idSite, $name, $matchAttribute, $pattern, $patternType, $caseSensitive = false, $revenue = false, $allowMultipleConversionsPerVisit = false, $description = '', $useEventValueAsRevenue = false) { Piwik::checkUserHasWriteAccess($idSite); $this->che...
php
public function addGoal($idSite, $name, $matchAttribute, $pattern, $patternType, $caseSensitive = false, $revenue = false, $allowMultipleConversionsPerVisit = false, $description = '', $useEventValueAsRevenue = false) { Piwik::checkUserHasWriteAccess($idSite); $this->che...
[ "public", "function", "addGoal", "(", "$", "idSite", ",", "$", "name", ",", "$", "matchAttribute", ",", "$", "pattern", ",", "$", "patternType", ",", "$", "caseSensitive", "=", "false", ",", "$", "revenue", "=", "false", ",", "$", "allowMultipleConversions...
Creates a Goal for a given website. @param int $idSite @param string $name @param string $matchAttribute 'url', 'title', 'file', 'external_website', 'manually', 'event_action', 'event_category' or 'event_name' @param string $pattern eg. purchase-confirmation.htm @param string $patternType 'regex', 'contains', 'exact' ...
[ "Creates", "a", "Goal", "for", "a", "given", "website", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L140-L172
209,236
matomo-org/matomo
plugins/Goals/API.php
API.deleteGoal
public function deleteGoal($idSite, $idGoal) { Piwik::checkUserHasWriteAccess($idSite); $this->getModel()->deleteGoal($idSite, $idGoal); $this->getModel()->deleteGoalConversions($idSite, $idGoal); $this->getGoalsInfoStaticCache()->delete(self::getCacheId($idSite)); Cache::...
php
public function deleteGoal($idSite, $idGoal) { Piwik::checkUserHasWriteAccess($idSite); $this->getModel()->deleteGoal($idSite, $idGoal); $this->getModel()->deleteGoalConversions($idSite, $idGoal); $this->getGoalsInfoStaticCache()->delete(self::getCacheId($idSite)); Cache::...
[ "public", "function", "deleteGoal", "(", "$", "idSite", ",", "$", "idGoal", ")", "{", "Piwik", "::", "checkUserHasWriteAccess", "(", "$", "idSite", ")", ";", "$", "this", "->", "getModel", "(", ")", "->", "deleteGoal", "(", "$", "idSite", ",", "$", "id...
Soft deletes a given Goal. Stats data in the archives will still be recorded, but not displayed. @param int $idSite @param int $idGoal @return void
[ "Soft", "deletes", "a", "given", "Goal", ".", "Stats", "data", "in", "the", "archives", "will", "still", "be", "recorded", "but", "not", "displayed", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L290-L300
209,237
matomo-org/matomo
plugins/Goals/API.php
API.convertSpecialGoalIds
protected static function convertSpecialGoalIds($idGoal) { if ($idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER) { return GoalManager::IDGOAL_ORDER; } else if ($idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART) { return GoalManager::IDGOAL_CART; } else { ...
php
protected static function convertSpecialGoalIds($idGoal) { if ($idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER) { return GoalManager::IDGOAL_ORDER; } else if ($idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART) { return GoalManager::IDGOAL_CART; } else { ...
[ "protected", "static", "function", "convertSpecialGoalIds", "(", "$", "idGoal", ")", "{", "if", "(", "$", "idGoal", "==", "Piwik", "::", "LABEL_ID_GOAL_IS_ECOMMERCE_ORDER", ")", "{", "return", "GoalManager", "::", "IDGOAL_ORDER", ";", "}", "else", "if", "(", "...
Helper function that checks for special string goal IDs and converts them to their integer equivalents. Checks for the following values: Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART @param string|int $idGoal The goal id as an integer or a special string. @return int The numeric goal ...
[ "Helper", "function", "that", "checks", "for", "special", "string", "goal", "IDs", "and", "converts", "them", "to", "their", "integer", "equivalents", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L403-L412
209,238
matomo-org/matomo
plugins/Goals/API.php
API.get
public function get($idSite, $period, $date, $segment = false, $idGoal = false, $columns = array(), $showAllGoalSpecificMetrics = false) { Piwik::checkUserHasViewAccess($idSite); /** @var DataTable|DataTable\Map $table */ $table = null; $segments = array( '' => false, ...
php
public function get($idSite, $period, $date, $segment = false, $idGoal = false, $columns = array(), $showAllGoalSpecificMetrics = false) { Piwik::checkUserHasViewAccess($idSite); /** @var DataTable|DataTable\Map $table */ $table = null; $segments = array( '' => false, ...
[ "public", "function", "get", "(", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", "=", "false", ",", "$", "idGoal", "=", "false", ",", "$", "columns", "=", "array", "(", ")", ",", "$", "showAllGoalSpecificMetrics", "=", "fal...
Returns Goals data. @param int $idSite @param string $period @param string $date @param bool $segment @param bool|int $idGoal @param array $columns Array of metrics to fetch: nb_conversions, conversion_rate, revenue @param bool $showAllGoalSpecificMetrics whether to show all goal specific metrics when no goal is set @...
[ "Returns", "Goals", "data", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L426-L466
209,239
matomo-org/matomo
plugins/Goals/API.php
API.getGoalSpecificDataTable
protected function getGoalSpecificDataTable($recordName, $idSite, $period, $date, $segment, $idGoal) { Piwik::checkUserHasViewAccess($idSite); $archive = Archive::build($idSite, $period, $date, $segment); // check for the special goal ids $realGoalId = $idGoal != true ? false : sel...
php
protected function getGoalSpecificDataTable($recordName, $idSite, $period, $date, $segment, $idGoal) { Piwik::checkUserHasViewAccess($idSite); $archive = Archive::build($idSite, $period, $date, $segment); // check for the special goal ids $realGoalId = $idGoal != true ? false : sel...
[ "protected", "function", "getGoalSpecificDataTable", "(", "$", "recordName", ",", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", ",", "$", "idGoal", ")", "{", "Piwik", "::", "checkUserHasViewAccess", "(", "$", "idSite", ")", ";",...
Utility method that retrieve an archived DataTable for a specific site, date range, segment and goal. If not goal is specified, this method will retrieve and sum the data for every goal. @param string $recordName The archive entry name. @param int|string $idSite The site(s) to select data for. @param string $period Th...
[ "Utility", "method", "that", "retrieve", "an", "archived", "DataTable", "for", "a", "specific", "site", "date", "range", "segment", "and", "goal", ".", "If", "not", "goal", "is", "specified", "this", "method", "will", "retrieve", "and", "sum", "the", "data",...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L646-L660
209,240
matomo-org/matomo
plugins/Goals/API.php
API.getDaysToConversion
public function getDaysToConversion($idSite, $period, $date, $segment = false, $idGoal = false) { $dataTable = $this->getGoalSpecificDataTable( Archiver::DAYS_UNTIL_CONV_RECORD_NAME, $idSite, $period, $date, $segment, $idGoal); $dataTable->queueFilter('Sort', array('label', 'asc', true,...
php
public function getDaysToConversion($idSite, $period, $date, $segment = false, $idGoal = false) { $dataTable = $this->getGoalSpecificDataTable( Archiver::DAYS_UNTIL_CONV_RECORD_NAME, $idSite, $period, $date, $segment, $idGoal); $dataTable->queueFilter('Sort', array('label', 'asc', true,...
[ "public", "function", "getDaysToConversion", "(", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", "=", "false", ",", "$", "idGoal", "=", "false", ")", "{", "$", "dataTable", "=", "$", "this", "->", "getGoalSpecificDataTable", "(...
Gets a DataTable that maps ranges of days to the number of conversions that occurred within those ranges, for the specified site, date range, segment and goal. @param int $idSite The site to select data from. @param string $period The period type. @param string $date The date type. @param string|bool $segment The segm...
[ "Gets", "a", "DataTable", "that", "maps", "ranges", "of", "days", "to", "the", "number", "of", "conversions", "that", "occurred", "within", "those", "ranges", "for", "the", "specified", "site", "date", "range", "segment", "and", "goal", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L674-L684
209,241
matomo-org/matomo
plugins/Goals/API.php
API.getVisitsUntilConversion
public function getVisitsUntilConversion($idSite, $period, $date, $segment = false, $idGoal = false) { $dataTable = $this->getGoalSpecificDataTable( Archiver::VISITS_UNTIL_RECORD_NAME, $idSite, $period, $date, $segment, $idGoal); $dataTable->queueFilter('Sort', array('label', 'asc', tru...
php
public function getVisitsUntilConversion($idSite, $period, $date, $segment = false, $idGoal = false) { $dataTable = $this->getGoalSpecificDataTable( Archiver::VISITS_UNTIL_RECORD_NAME, $idSite, $period, $date, $segment, $idGoal); $dataTable->queueFilter('Sort', array('label', 'asc', tru...
[ "public", "function", "getVisitsUntilConversion", "(", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", "=", "false", ",", "$", "idGoal", "=", "false", ")", "{", "$", "dataTable", "=", "$", "this", "->", "getGoalSpecificDataTable",...
Gets a DataTable that maps ranges of visit counts to the number of conversions that occurred on those visits for the specified site, date range, segment and goal. @param int $idSite The site to select data from. @param string $period The period type. @param string $date The date type. @param string|bool $segment The s...
[ "Gets", "a", "DataTable", "that", "maps", "ranges", "of", "visit", "counts", "to", "the", "number", "of", "conversions", "that", "occurred", "on", "those", "visits", "for", "the", "specified", "site", "date", "range", "segment", "and", "goal", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L698-L708
209,242
matomo-org/matomo
plugins/Goals/API.php
API.enrichItemsTableWithViewMetrics
protected function enrichItemsTableWithViewMetrics($dataTable, $recordName, $idSite, $period, $date, $segment) { // Enrich the datatable with Product/Categories views, and conversion rates $customVariables = \Piwik\Plugins\CustomVariables\API::getInstance()->getCustomVariables($idSite, $period, $dat...
php
protected function enrichItemsTableWithViewMetrics($dataTable, $recordName, $idSite, $period, $date, $segment) { // Enrich the datatable with Product/Categories views, and conversion rates $customVariables = \Piwik\Plugins\CustomVariables\API::getInstance()->getCustomVariables($idSite, $period, $dat...
[ "protected", "function", "enrichItemsTableWithViewMetrics", "(", "$", "dataTable", ",", "$", "recordName", ",", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", ")", "{", "// Enrich the datatable with Product/Categories views, and conversion rat...
Enhances the dataTable with Items attributes found in the Custom Variables report. @param $dataTable @param $recordName @param $idSite @param $period @param $date @param $segment
[ "Enhances", "the", "dataTable", "with", "Items", "attributes", "found", "in", "the", "Custom", "Variables", "report", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L720-L768
209,243
matomo-org/matomo
plugins/Login/Controller.php
Controller.configureView
protected function configureView($view) { $this->setBasicVariablesNoneAdminView($view); $view->linkTitle = Piwik::getRandomTitle(); // crsf token: don't trust the submitted value; generate/fetch it from session data $view->nonce = Nonce::getNonce('Login.login'); }
php
protected function configureView($view) { $this->setBasicVariablesNoneAdminView($view); $view->linkTitle = Piwik::getRandomTitle(); // crsf token: don't trust the submitted value; generate/fetch it from session data $view->nonce = Nonce::getNonce('Login.login'); }
[ "protected", "function", "configureView", "(", "$", "view", ")", "{", "$", "this", "->", "setBasicVariablesNoneAdminView", "(", "$", "view", ")", ";", "$", "view", "->", "linkTitle", "=", "Piwik", "::", "getRandomTitle", "(", ")", ";", "// crsf token: don't tr...
Configure common view properties @param View $view
[ "Configure", "common", "view", "properties" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Controller.php#L175-L183
209,244
matomo-org/matomo
plugins/Login/Controller.php
Controller.logme
function logme() { $password = Common::getRequestVar('password', null, 'string'); $login = Common::getRequestVar('login', null, 'string'); if (Piwik::hasTheUserSuperUserAccess($login)) { throw new Exception(Piwik::translate('Login_ExceptionInvalidSuperUserAccessAuthenticationMet...
php
function logme() { $password = Common::getRequestVar('password', null, 'string'); $login = Common::getRequestVar('login', null, 'string'); if (Piwik::hasTheUserSuperUserAccess($login)) { throw new Exception(Piwik::translate('Login_ExceptionInvalidSuperUserAccessAuthenticationMet...
[ "function", "logme", "(", ")", "{", "$", "password", "=", "Common", "::", "getRequestVar", "(", "'password'", ",", "null", ",", "'string'", ")", ";", "$", "login", "=", "Common", "::", "getRequestVar", "(", "'login'", ",", "null", ",", "'string'", ")", ...
Form-less login @see how to use it on http://piwik.org/faq/how-to/#faq_30 @throws Exception @return void
[ "Form", "-", "less", "login" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Controller.php#L229-L248
209,245
matomo-org/matomo
plugins/Login/Controller.php
Controller.ajaxNoAccess
public function ajaxNoAccess($errorMessage) { return sprintf( '<div class="alert alert-danger"> <p><strong>%s:</strong> %s</p> <p><a href="%s">%s</a></p> </div>', Piwik::translate('General_Error'), htmlentities($errorMessage, Co...
php
public function ajaxNoAccess($errorMessage) { return sprintf( '<div class="alert alert-danger"> <p><strong>%s:</strong> %s</p> <p><a href="%s">%s</a></p> </div>', Piwik::translate('General_Error'), htmlentities($errorMessage, Co...
[ "public", "function", "ajaxNoAccess", "(", "$", "errorMessage", ")", "{", "return", "sprintf", "(", "'<div class=\"alert alert-danger\">\n <p><strong>%s:</strong> %s</p>\n <p><a href=\"%s\">%s</a></p>\n </div>'", ",", "Piwik", "::", "translate",...
Error message shown when an AJAX request has no access @param string $errorMessage @return string
[ "Error", "message", "shown", "when", "an", "AJAX", "request", "has", "no", "access" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Controller.php#L266-L278
209,246
matomo-org/matomo
plugins/Login/Controller.php
Controller.authenticateAndRedirect
protected function authenticateAndRedirect($login, $password, $urlToRedirect = false, $passwordHashed = false) { Nonce::discardNonce('Login.login'); $this->auth->setLogin($login); if ($passwordHashed === false) { $this->auth->setPassword($password); } else { ...
php
protected function authenticateAndRedirect($login, $password, $urlToRedirect = false, $passwordHashed = false) { Nonce::discardNonce('Login.login'); $this->auth->setLogin($login); if ($passwordHashed === false) { $this->auth->setPassword($password); } else { ...
[ "protected", "function", "authenticateAndRedirect", "(", "$", "login", ",", "$", "password", ",", "$", "urlToRedirect", "=", "false", ",", "$", "passwordHashed", "=", "false", ")", "{", "Nonce", "::", "discardNonce", "(", "'Login.login'", ")", ";", "$", "thi...
Authenticate user and password. Redirect if successful. @param string $login user name @param string $password plain-text or hashed password @param string $urlToRedirect URL to redirect to, if successfully authenticated @param bool $passwordHashed indicates if $password is hashed @return string failure message if una...
[ "Authenticate", "user", "and", "password", ".", "Redirect", "if", "successful", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Controller.php#L289-L328
209,247
matomo-org/matomo
plugins/Login/Controller.php
Controller.resetPassword
function resetPassword() { $infoMessage = null; $formErrors = null; $form = new FormResetPassword(); if ($form->validate()) { $nonce = $form->getSubmitValue('form_nonce'); if (Nonce::verifyNonce('Login.login', $nonce)) { $formErrors = $this->r...
php
function resetPassword() { $infoMessage = null; $formErrors = null; $form = new FormResetPassword(); if ($form->validate()) { $nonce = $form->getSubmitValue('form_nonce'); if (Nonce::verifyNonce('Login.login', $nonce)) { $formErrors = $this->r...
[ "function", "resetPassword", "(", ")", "{", "$", "infoMessage", "=", "null", ";", "$", "formErrors", "=", "null", ";", "$", "form", "=", "new", "FormResetPassword", "(", ")", ";", "if", "(", "$", "form", "->", "validate", "(", ")", ")", "{", "$", "...
Reset password action. Stores new password as hash and sends email to confirm use.
[ "Reset", "password", "action", ".", "Stores", "new", "password", "as", "hash", "and", "sends", "email", "to", "confirm", "use", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Controller.php#L367-L394
209,248
matomo-org/matomo
plugins/Login/Controller.php
Controller.resetPasswordFirstStep
protected function resetPasswordFirstStep($form) { $loginMail = $form->getSubmitValue('form_login'); $password = $form->getSubmitValue('form_password'); try { $this->passwordResetter->initiatePasswordResetProcess($loginMail, $password); } catch (Exception $ex) { ...
php
protected function resetPasswordFirstStep($form) { $loginMail = $form->getSubmitValue('form_login'); $password = $form->getSubmitValue('form_password'); try { $this->passwordResetter->initiatePasswordResetProcess($loginMail, $password); } catch (Exception $ex) { ...
[ "protected", "function", "resetPasswordFirstStep", "(", "$", "form", ")", "{", "$", "loginMail", "=", "$", "form", "->", "getSubmitValue", "(", "'form_login'", ")", ";", "$", "password", "=", "$", "form", "->", "getSubmitValue", "(", "'form_password'", ")", ...
Saves password reset info and sends confirmation email. @param QuickForm2 $form @return array Error message(s) if an error occurs.
[ "Saves", "password", "reset", "info", "and", "sends", "confirmation", "email", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Controller.php#L402-L416
209,249
matomo-org/matomo
plugins/Login/Controller.php
Controller.confirmResetPassword
public function confirmResetPassword() { $errorMessage = null; $login = Common::getRequestVar('login', ''); $resetToken = Common::getRequestVar('resetToken', ''); try { $this->passwordResetter->confirmNewPassword($login, $resetToken); } catch (Exception $ex) { ...
php
public function confirmResetPassword() { $errorMessage = null; $login = Common::getRequestVar('login', ''); $resetToken = Common::getRequestVar('resetToken', ''); try { $this->passwordResetter->confirmNewPassword($login, $resetToken); } catch (Exception $ex) { ...
[ "public", "function", "confirmResetPassword", "(", ")", "{", "$", "errorMessage", "=", "null", ";", "$", "login", "=", "Common", "::", "getRequestVar", "(", "'login'", ",", "''", ")", ";", "$", "resetToken", "=", "Common", "::", "getRequestVar", "(", "'res...
Password reset confirmation action. Finishes the password reset process. Users visit this action from a link supplied in an email.
[ "Password", "reset", "confirmation", "action", ".", "Finishes", "the", "password", "reset", "process", ".", "Users", "visit", "this", "action", "from", "a", "link", "supplied", "in", "an", "email", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Controller.php#L422-L443
209,250
matomo-org/matomo
plugins/Login/Controller.php
Controller.logout
public function logout() { Piwik::postEvent('Login.logout', array(Piwik::getCurrentUserLogin())); self::clearSession(); $logoutUrl = @Config::getInstance()->General['login_logout_url']; if (empty($logoutUrl)) { Piwik::redirectToModule('CoreHome'); } else { ...
php
public function logout() { Piwik::postEvent('Login.logout', array(Piwik::getCurrentUserLogin())); self::clearSession(); $logoutUrl = @Config::getInstance()->General['login_logout_url']; if (empty($logoutUrl)) { Piwik::redirectToModule('CoreHome'); } else { ...
[ "public", "function", "logout", "(", ")", "{", "Piwik", "::", "postEvent", "(", "'Login.logout'", ",", "array", "(", "Piwik", "::", "getCurrentUserLogin", "(", ")", ")", ")", ";", "self", "::", "clearSession", "(", ")", ";", "$", "logoutUrl", "=", "@", ...
Logout current user @param none @return void
[ "Logout", "current", "user" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Controller.php#L474-L486
209,251
matomo-org/matomo
libs/HTML/QuickForm2/Rule.php
HTML_QuickForm2_Rule.and_
public function and_(HTML_QuickForm2_Rule $next) { if ($next instanceof HTML_QuickForm2_Rule_Required) { throw new HTML_QuickForm2_InvalidArgumentException( 'and_(): Cannot add a "required" rule' ); } $this->chainedRules[count($this->chainedRules) - 1]...
php
public function and_(HTML_QuickForm2_Rule $next) { if ($next instanceof HTML_QuickForm2_Rule_Required) { throw new HTML_QuickForm2_InvalidArgumentException( 'and_(): Cannot add a "required" rule' ); } $this->chainedRules[count($this->chainedRules) - 1]...
[ "public", "function", "and_", "(", "HTML_QuickForm2_Rule", "$", "next", ")", "{", "if", "(", "$", "next", "instanceof", "HTML_QuickForm2_Rule_Required", ")", "{", "throw", "new", "HTML_QuickForm2_InvalidArgumentException", "(", "'and_(): Cannot add a \"required\" rule'", ...
Adds a rule to the chain with an "and" operator Evaluation is short-circuited, next rule will not be evaluated if the previous one returns false. The method is named this way because "and" is a reserved word in PHP. @param HTML_QuickForm2_Rule @return HTML_QuickForm2_Rule first rule in the chain (i.e. $this) ...
[ "Adds", "a", "rule", "to", "the", "chain", "with", "an", "and", "operator" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule.php#L202-L211
209,252
matomo-org/matomo
libs/HTML/QuickForm2/Rule.php
HTML_QuickForm2_Rule.or_
public function or_(HTML_QuickForm2_Rule $next) { if ($next instanceof HTML_QuickForm2_Rule_Required) { throw new HTML_QuickForm2_InvalidArgumentException( 'or_(): Cannot add a "required" rule' ); } $this->chainedRules[] = array($next); return ...
php
public function or_(HTML_QuickForm2_Rule $next) { if ($next instanceof HTML_QuickForm2_Rule_Required) { throw new HTML_QuickForm2_InvalidArgumentException( 'or_(): Cannot add a "required" rule' ); } $this->chainedRules[] = array($next); return ...
[ "public", "function", "or_", "(", "HTML_QuickForm2_Rule", "$", "next", ")", "{", "if", "(", "$", "next", "instanceof", "HTML_QuickForm2_Rule_Required", ")", "{", "throw", "new", "HTML_QuickForm2_InvalidArgumentException", "(", "'or_(): Cannot add a \"required\" rule'", ")...
Adds a rule to the chain with an "or" operator Evaluation is short-circuited, next rule will not be evaluated if the previous one returns true. The method is named this way because "or" is a reserved word in PHP. @param HTML_QuickForm2_Rule @return HTML_QuickForm2_Rule first rule in the chain (i.e. $this) @th...
[ "Adds", "a", "rule", "to", "the", "chain", "with", "an", "or", "operator" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule.php#L225-L234
209,253
matomo-org/matomo
libs/HTML/QuickForm2/Rule.php
HTML_QuickForm2_Rule.setOwnerError
protected function setOwnerError() { if (strlen($this->getMessage()) && !$this->owner->getError()) { $this->owner->setError($this->getMessage()); } }
php
protected function setOwnerError() { if (strlen($this->getMessage()) && !$this->owner->getError()) { $this->owner->setError($this->getMessage()); } }
[ "protected", "function", "setOwnerError", "(", ")", "{", "if", "(", "strlen", "(", "$", "this", "->", "getMessage", "(", ")", ")", "&&", "!", "$", "this", "->", "owner", "->", "getError", "(", ")", ")", "{", "$", "this", "->", "owner", "->", "setEr...
Sets the error message on the owner element
[ "Sets", "the", "error", "message", "on", "the", "owner", "element" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule.php#L273-L278
209,254
matomo-org/matomo
libs/HTML/QuickForm2/Rule.php
HTML_QuickForm2_Rule.getJavascript
public function getJavascript() { $js = "{\n\tcallback: " . $this->getJavascriptCallback() . ",\n" . "\telementId: '" . $this->owner->getId() . "',\n" . "\terrorMessage: '" . strtr($this->getMessage(), array( "\r" => '\r', "\n" => '\n...
php
public function getJavascript() { $js = "{\n\tcallback: " . $this->getJavascriptCallback() . ",\n" . "\telementId: '" . $this->owner->getId() . "',\n" . "\terrorMessage: '" . strtr($this->getMessage(), array( "\r" => '\r', "\n" => '\n...
[ "public", "function", "getJavascript", "(", ")", "{", "$", "js", "=", "\"{\\n\\tcallback: \"", ".", "$", "this", "->", "getJavascriptCallback", "(", ")", ".", "\",\\n\"", ".", "\"\\telementId: '\"", ".", "$", "this", "->", "owner", "->", "getId", "(", ")", ...
Returns the client-side representation of the Rule The Javascript object returned contains the following fields: - callback: {@see getJavascriptCallback()} - elementId: element ID to set error for if validation fails - errorMessage: error message to set if validation fails - chained: chained rules, array of arrays lik...
[ "Returns", "the", "client", "-", "side", "representation", "of", "the", "Rule" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule.php#L309-L331
209,255
matomo-org/matomo
core/Db.php
Db.get
public static function get() { if (SettingsServer::isTrackerApiRequest()) { return Tracker::getDatabase(); } if (!self::hasDatabaseObject()) { self::createDatabaseObject(); } return self::$connection; }
php
public static function get() { if (SettingsServer::isTrackerApiRequest()) { return Tracker::getDatabase(); } if (!self::hasDatabaseObject()) { self::createDatabaseObject(); } return self::$connection; }
[ "public", "static", "function", "get", "(", ")", "{", "if", "(", "SettingsServer", "::", "isTrackerApiRequest", "(", ")", ")", "{", "return", "Tracker", "::", "getDatabase", "(", ")", ";", "}", "if", "(", "!", "self", "::", "hasDatabaseObject", "(", ")",...
Returns the database connection and creates it if it hasn't been already. @return \Piwik\Tracker\Db|\Piwik\Db\AdapterInterface|\Piwik\Db
[ "Returns", "the", "database", "connection", "and", "creates", "it", "if", "it", "hasn", "t", "been", "already", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L47-L58
209,256
matomo-org/matomo
core/Db.php
Db.getDatabaseConfig
public static function getDatabaseConfig($dbConfig = null) { $config = Config::getInstance(); if (is_null($dbConfig)) { $dbConfig = $config->database; } /** * Triggered before a database connection is established. * * This event can be used to...
php
public static function getDatabaseConfig($dbConfig = null) { $config = Config::getInstance(); if (is_null($dbConfig)) { $dbConfig = $config->database; } /** * Triggered before a database connection is established. * * This event can be used to...
[ "public", "static", "function", "getDatabaseConfig", "(", "$", "dbConfig", "=", "null", ")", "{", "$", "config", "=", "Config", "::", "getInstance", "(", ")", ";", "if", "(", "is_null", "(", "$", "dbConfig", ")", ")", "{", "$", "dbConfig", "=", "$", ...
Returns an array with the Database connection information. @param array|null $dbConfig @return array
[ "Returns", "an", "array", "with", "the", "Database", "connection", "information", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L66-L97
209,257
matomo-org/matomo
core/Db.php
Db.fetchOne
public static function fetchOne($sql, $parameters = array()) { try { self::logSql(__FUNCTION__, $sql, $parameters); return self::get()->fetchOne($sql, $parameters); } catch (Exception $ex) { self::logExtraInfoIfDeadlock($ex); throw $ex; } ...
php
public static function fetchOne($sql, $parameters = array()) { try { self::logSql(__FUNCTION__, $sql, $parameters); return self::get()->fetchOne($sql, $parameters); } catch (Exception $ex) { self::logExtraInfoIfDeadlock($ex); throw $ex; } ...
[ "public", "static", "function", "fetchOne", "(", "$", "sql", ",", "$", "parameters", "=", "array", "(", ")", ")", "{", "try", "{", "self", "::", "logSql", "(", "__FUNCTION__", ",", "$", "sql", ",", "$", "parameters", ")", ";", "return", "self", "::",...
Executes an SQL `SELECT` statement and returns the first column value of the first row in the result set. @param string $sql The SQL query. @param array $parameters Parameters to bind in the query, eg, `array(param1 => value1, param2 => value2)`. @throws \Exception If there is a problem with the SQL or bind parameters...
[ "Executes", "an", "SQL", "SELECT", "statement", "and", "returns", "the", "first", "column", "value", "of", "the", "first", "row", "in", "the", "result", "set", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L256-L266
209,258
matomo-org/matomo
core/Db.php
Db.deleteAllRows
public static function deleteAllRows($table, $where, $orderBy, $maxRowsPerQuery = 100000, $parameters = array()) { $orderByClause = $orderBy ? "ORDER BY $orderBy" : ""; $sql = "DELETE FROM $table $where $orderByClause LIMIT " . (int)$maxRowsPerQuery; // delete rows w/ a lim...
php
public static function deleteAllRows($table, $where, $orderBy, $maxRowsPerQuery = 100000, $parameters = array()) { $orderByClause = $orderBy ? "ORDER BY $orderBy" : ""; $sql = "DELETE FROM $table $where $orderByClause LIMIT " . (int)$maxRowsPerQuery; // delete rows w/ a lim...
[ "public", "static", "function", "deleteAllRows", "(", "$", "table", ",", "$", "where", ",", "$", "orderBy", ",", "$", "maxRowsPerQuery", "=", "100000", ",", "$", "parameters", "=", "array", "(", ")", ")", "{", "$", "orderByClause", "=", "$", "orderBy", ...
Deletes all desired rows in a table, while using a limit. This function will execute many DELETE queries until there are no more rows to delete. Use this function when you need to delete many thousands of rows from a table without locking the table for too long. **Example** // delete all visit rows whose ID is less ...
[ "Deletes", "all", "desired", "rows", "in", "a", "table", "while", "using", "a", "limit", ".", "This", "function", "will", "execute", "many", "DELETE", "queries", "until", "there", "are", "no", "more", "rows", "to", "delete", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L313-L330
209,259
matomo-org/matomo
core/Db.php
Db.optimizeTables
public static function optimizeTables($tables, $force = false) { $optimize = Config::getInstance()->General['enable_sql_optimize_queries']; if (empty($optimize) && !$force ) { return false; } if (empty($tables)) { return false; } ...
php
public static function optimizeTables($tables, $force = false) { $optimize = Config::getInstance()->General['enable_sql_optimize_queries']; if (empty($optimize) && !$force ) { return false; } if (empty($tables)) { return false; } ...
[ "public", "static", "function", "optimizeTables", "(", "$", "tables", ",", "$", "force", "=", "false", ")", "{", "$", "optimize", "=", "Config", "::", "getInstance", "(", ")", "->", "General", "[", "'enable_sql_optimize_queries'", "]", ";", "if", "(", "emp...
Runs an `OPTIMIZE TABLE` query on the supplied table or tables. Tables will only be optimized if the `[General] enable_sql_optimize_queries` INI config option is set to **1**. @param string|array $tables The name of the table to optimize or an array of tables to optimize. Table names must be prefixed (see {@link Piwi...
[ "Runs", "an", "OPTIMIZE", "TABLE", "query", "on", "the", "supplied", "table", "or", "tables", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L343-L383
209,260
matomo-org/matomo
core/Db.php
Db.dropTables
public static function dropTables($tables) { if (!is_array($tables)) { $tables = array($tables); } return self::query("DROP TABLE `" . implode('`,`', $tables) . "`"); }
php
public static function dropTables($tables) { if (!is_array($tables)) { $tables = array($tables); } return self::query("DROP TABLE `" . implode('`,`', $tables) . "`"); }
[ "public", "static", "function", "dropTables", "(", "$", "tables", ")", "{", "if", "(", "!", "is_array", "(", "$", "tables", ")", ")", "{", "$", "tables", "=", "array", "(", "$", "tables", ")", ";", "}", "return", "self", "::", "query", "(", "\"DROP...
Drops the supplied table or tables. @param string|array $tables The name of the table to drop or an array of table names to drop. Table names must be prefixed (see {@link Piwik\Common::prefixTable()}). @return \Zend_Db_Statement
[ "Drops", "the", "supplied", "table", "or", "tables", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L397-L404
209,261
matomo-org/matomo
core/Db.php
Db.lockTables
public static function lockTables($tablesToRead, $tablesToWrite = array()) { if (!is_array($tablesToRead)) { $tablesToRead = array($tablesToRead); } if (!is_array($tablesToWrite)) { $tablesToWrite = array($tablesToWrite); } $lockExprs = array(); ...
php
public static function lockTables($tablesToRead, $tablesToWrite = array()) { if (!is_array($tablesToRead)) { $tablesToRead = array($tablesToRead); } if (!is_array($tablesToWrite)) { $tablesToWrite = array($tablesToWrite); } $lockExprs = array(); ...
[ "public", "static", "function", "lockTables", "(", "$", "tablesToRead", ",", "$", "tablesToWrite", "=", "array", "(", ")", ")", "{", "if", "(", "!", "is_array", "(", "$", "tablesToRead", ")", ")", "{", "$", "tablesToRead", "=", "array", "(", "$", "tabl...
Locks the supplied table or tables. **NOTE:** Piwik does not require the `LOCK TABLES` privilege to be available. Piwik should still work if it has not been granted. @param string|array $tablesToRead The table or tables to obtain 'read' locks on. Table names must be prefixed (see {@link Piwik\Common::prefixTable()})....
[ "Locks", "the", "supplied", "table", "or", "tables", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L440-L460
209,262
matomo-org/matomo
core/Db.php
Db.segmentedFetchFirst
public static function segmentedFetchFirst($sql, $first, $last, $step, $params = array()) { $result = false; if ($step > 0) { for ($i = $first; $result === false && $i <= $last; $i += $step) { $result = self::fetchOne($sql, array_merge($params, array($i, $i + $step))); ...
php
public static function segmentedFetchFirst($sql, $first, $last, $step, $params = array()) { $result = false; if ($step > 0) { for ($i = $first; $result === false && $i <= $last; $i += $step) { $result = self::fetchOne($sql, array_merge($params, array($i, $i + $step))); ...
[ "public", "static", "function", "segmentedFetchFirst", "(", "$", "sql", ",", "$", "first", ",", "$", "last", ",", "$", "step", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "result", "=", "false", ";", "if", "(", "$", "step", ">", "0...
Performs a `SELECT` statement on a table one chunk at a time and returns the first successfully fetched value. This function will execute a query on one set of rows in a table. If nothing is fetched, it will execute the query on the next set of rows and so on until the query returns a value. This function will break ...
[ "Performs", "a", "SELECT", "statement", "on", "a", "table", "one", "chunk", "at", "a", "time", "and", "returns", "the", "first", "successfully", "fetched", "value", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L513-L528
209,263
matomo-org/matomo
core/Db.php
Db.segmentedFetchOne
public static function segmentedFetchOne($sql, $first, $last, $step, $params = array()) { $result = array(); if ($step > 0) { for ($i = $first; $i <= $last; $i += $step) { $result[] = self::fetchOne($sql, array_merge($params, array($i, $i + $step))); } ...
php
public static function segmentedFetchOne($sql, $first, $last, $step, $params = array()) { $result = array(); if ($step > 0) { for ($i = $first; $i <= $last; $i += $step) { $result[] = self::fetchOne($sql, array_merge($params, array($i, $i + $step))); } ...
[ "public", "static", "function", "segmentedFetchOne", "(", "$", "sql", ",", "$", "first", ",", "$", "last", ",", "$", "step", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "result", "=", "array", "(", ")", ";", "if", "(", "$", "step",...
Performs a `SELECT` on a table one chunk at a time and returns an array of every fetched value. This function will break up a `SELECT` query into several smaller queries by using only a limited number of rows at a time. It will accumulate the results of each smaller query and return the result. This function should b...
[ "Performs", "a", "SELECT", "on", "a", "table", "one", "chunk", "at", "a", "time", "and", "returns", "an", "array", "of", "every", "fetched", "value", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L551-L566
209,264
matomo-org/matomo
core/Db.php
Db.segmentedFetchAll
public static function segmentedFetchAll($sql, $first, $last, $step, $params = array()) { $result = array(); if ($step > 0) { for ($i = $first; $i <= $last; $i += $step) { $currentParams = array_merge($params, array($i, $i + $step)); $result = arra...
php
public static function segmentedFetchAll($sql, $first, $last, $step, $params = array()) { $result = array(); if ($step > 0) { for ($i = $first; $i <= $last; $i += $step) { $currentParams = array_merge($params, array($i, $i + $step)); $result = arra...
[ "public", "static", "function", "segmentedFetchAll", "(", "$", "sql", ",", "$", "first", ",", "$", "last", ",", "$", "step", ",", "$", "params", "=", "array", "(", ")", ")", "{", "$", "result", "=", "array", "(", ")", ";", "if", "(", "$", "step",...
Performs a SELECT on a table one chunk at a time and returns an array of every fetched row. This function will break up a `SELECT` query into several smaller queries by using only a limited number of rows at a time. It will accumulate the results of each smaller query and return the result. This function should be us...
[ "Performs", "a", "SELECT", "on", "a", "table", "one", "chunk", "at", "a", "time", "and", "returns", "an", "array", "of", "every", "fetched", "row", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L590-L607
209,265
matomo-org/matomo
core/Db.php
Db.segmentedQuery
public static function segmentedQuery($sql, $first, $last, $step, $params = array()) { if ($step > 0) { for ($i = $first; $i <= $last; $i += $step) { $currentParams = array_merge($params, array($i, $i + $step)); self::query($sql, $currentParams); } ...
php
public static function segmentedQuery($sql, $first, $last, $step, $params = array()) { if ($step > 0) { for ($i = $first; $i <= $last; $i += $step) { $currentParams = array_merge($params, array($i, $i + $step)); self::query($sql, $currentParams); } ...
[ "public", "static", "function", "segmentedQuery", "(", "$", "sql", ",", "$", "first", ",", "$", "last", ",", "$", "step", ",", "$", "params", "=", "array", "(", ")", ")", "{", "if", "(", "$", "step", ">", "0", ")", "{", "for", "(", "$", "i", ...
Performs a `UPDATE` or `DELETE` statement on a table one chunk at a time. This function will break up a query into several smaller queries by using only a limited number of rows at a time. This function should be used when executing a non-query statement will take a long time to finish. Using several smaller queries ...
[ "Performs", "a", "UPDATE", "or", "DELETE", "statement", "on", "a", "table", "one", "chunk", "at", "a", "time", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L627-L640
209,266
matomo-org/matomo
core/Db.php
Db.getDbLock
public static function getDbLock($lockName, $maxRetries = 30) { if (strlen($lockName) > 64) { throw new \Exception('DB lock name has to be 64 characters or less for MySQL 5.7 compatibility.'); } /* * the server (e.g., shared hosting) may have a low wait timeout ...
php
public static function getDbLock($lockName, $maxRetries = 30) { if (strlen($lockName) > 64) { throw new \Exception('DB lock name has to be 64 characters or less for MySQL 5.7 compatibility.'); } /* * the server (e.g., shared hosting) may have a low wait timeout ...
[ "public", "static", "function", "getDbLock", "(", "$", "lockName", ",", "$", "maxRetries", "=", "30", ")", "{", "if", "(", "strlen", "(", "$", "lockName", ")", ">", "64", ")", "{", "throw", "new", "\\", "Exception", "(", "'DB lock name has to be 64 charact...
Attempts to get a named lock. This function uses a timeout of 1s, but will retry a set number of times. @param string $lockName The lock name. @param int $maxRetries The max number of times to retry. @return bool `true` if the lock was obtained, `false` if otherwise. @throws \Exception if Lock name is too long
[ "Attempts", "to", "get", "a", "named", "lock", ".", "This", "function", "uses", "a", "timeout", "of", "1s", "but", "will", "retry", "a", "set", "number", "of", "times", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L651-L676
209,267
matomo-org/matomo
core/Db.php
Db.releaseDbLock
public static function releaseDbLock($lockName) { $sql = 'SELECT RELEASE_LOCK(?)'; $db = self::get(); return $db->fetchOne($sql, array($lockName)) == '1'; }
php
public static function releaseDbLock($lockName) { $sql = 'SELECT RELEASE_LOCK(?)'; $db = self::get(); return $db->fetchOne($sql, array($lockName)) == '1'; }
[ "public", "static", "function", "releaseDbLock", "(", "$", "lockName", ")", "{", "$", "sql", "=", "'SELECT RELEASE_LOCK(?)'", ";", "$", "db", "=", "self", "::", "get", "(", ")", ";", "return", "$", "db", "->", "fetchOne", "(", "$", "sql", ",", "array",...
Releases a named lock. @param string $lockName The lock name. @return bool `true` if the lock was released, `false` if otherwise.
[ "Releases", "a", "named", "lock", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L684-L690
209,268
matomo-org/matomo
core/Db.php
Db.isLockPrivilegeGranted
public static function isLockPrivilegeGranted() { if (is_null(self::$lockPrivilegeGranted)) { try { Db::lockTables(Common::prefixTable('log_visit')); Db::unlockAllTables(); self::$lockPrivilegeGranted = true; } catch (Exception $ex) { ...
php
public static function isLockPrivilegeGranted() { if (is_null(self::$lockPrivilegeGranted)) { try { Db::lockTables(Common::prefixTable('log_visit')); Db::unlockAllTables(); self::$lockPrivilegeGranted = true; } catch (Exception $ex) { ...
[ "public", "static", "function", "isLockPrivilegeGranted", "(", ")", "{", "if", "(", "is_null", "(", "self", "::", "$", "lockPrivilegeGranted", ")", ")", "{", "try", "{", "Db", "::", "lockTables", "(", "Common", "::", "prefixTable", "(", "'log_visit'", ")", ...
Checks whether the database user is allowed to lock tables. @return bool
[ "Checks", "whether", "the", "database", "user", "is", "allowed", "to", "lock", "tables", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L707-L721
209,269
matomo-org/matomo
core/CliMulti.php
CliMulti.cleanupNotRemovedFiles
public static function cleanupNotRemovedFiles() { $timeOneWeekAgo = strtotime('-1 week'); $files = _glob(self::getTmpPath() . '/*'); if (empty($files)) { return; } foreach ($files as $file) { if (file_exists($file)) { $timeLastModifie...
php
public static function cleanupNotRemovedFiles() { $timeOneWeekAgo = strtotime('-1 week'); $files = _glob(self::getTmpPath() . '/*'); if (empty($files)) { return; } foreach ($files as $file) { if (file_exists($file)) { $timeLastModifie...
[ "public", "static", "function", "cleanupNotRemovedFiles", "(", ")", "{", "$", "timeOneWeekAgo", "=", "strtotime", "(", "'-1 week'", ")", ";", "$", "files", "=", "_glob", "(", "self", "::", "getTmpPath", "(", ")", ".", "'/*'", ")", ";", "if", "(", "empty"...
Remove files older than one week. They should be cleaned up automatically after each request but for whatever reason there can be always some files left.
[ "Remove", "files", "older", "than", "one", "week", ".", "They", "should", "be", "cleaned", "up", "automatically", "after", "each", "request", "but", "for", "whatever", "reason", "there", "can", "be", "always", "some", "files", "left", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CliMulti.php#L269-L287
209,270
matomo-org/matomo
plugins/Actions/ArchivingHelper.php
ArchivingHelper.getRankingQueryLimit
public static function getRankingQueryLimit() { $configGeneral = Config::getInstance()->General; $configLimit = $configGeneral['archiving_ranking_query_row_limit']; $limit = $configLimit == 0 ? 0 : max( $configLimit, $configGeneral['datatable_archiving_maximum_rows_ac...
php
public static function getRankingQueryLimit() { $configGeneral = Config::getInstance()->General; $configLimit = $configGeneral['archiving_ranking_query_row_limit']; $limit = $configLimit == 0 ? 0 : max( $configLimit, $configGeneral['datatable_archiving_maximum_rows_ac...
[ "public", "static", "function", "getRankingQueryLimit", "(", ")", "{", "$", "configGeneral", "=", "Config", "::", "getInstance", "(", ")", "->", "General", ";", "$", "configLimit", "=", "$", "configGeneral", "[", "'archiving_ranking_query_row_limit'", "]", ";", ...
Returns the limit to use with RankingQuery for this plugin. @return int
[ "Returns", "the", "limit", "to", "use", "with", "RankingQuery", "for", "this", "plugin", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/ArchivingHelper.php#L235-L272
209,271
matomo-org/matomo
plugins/Actions/ArchivingHelper.php
ArchivingHelper.getUnknownActionName
public static function getUnknownActionName($type) { if (empty(self::$defaultActionNameWhenNotDefined)) { self::$defaultActionNameWhenNotDefined = Piwik::translate('General_NotDefined', Piwik::translate('Actions_ColumnPageName')); self::$defaultActionUrlWhenNotDefined = Piwik::transl...
php
public static function getUnknownActionName($type) { if (empty(self::$defaultActionNameWhenNotDefined)) { self::$defaultActionNameWhenNotDefined = Piwik::translate('General_NotDefined', Piwik::translate('Actions_ColumnPageName')); self::$defaultActionUrlWhenNotDefined = Piwik::transl...
[ "public", "static", "function", "getUnknownActionName", "(", "$", "type", ")", "{", "if", "(", "empty", "(", "self", "::", "$", "defaultActionNameWhenNotDefined", ")", ")", "{", "self", "::", "$", "defaultActionNameWhenNotDefined", "=", "Piwik", "::", "translate...
Returns default label for the action type @param $type @return string
[ "Returns", "default", "label", "for", "the", "action", "type" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/ArchivingHelper.php#L416-L426
209,272
matomo-org/matomo
plugins/Actions/ArchivingHelper.php
ArchivingHelper.getActionExplodedNames
public static function getActionExplodedNames($name, $type, $urlPrefix = null) { // Site Search does not split Search keywords if ($type == Action::TYPE_SITE_SEARCH) { return array($name); } $name = str_replace("\n", "", $name); if ($type == Action::TYPE_PAGE_TI...
php
public static function getActionExplodedNames($name, $type, $urlPrefix = null) { // Site Search does not split Search keywords if ($type == Action::TYPE_SITE_SEARCH) { return array($name); } $name = str_replace("\n", "", $name); if ($type == Action::TYPE_PAGE_TI...
[ "public", "static", "function", "getActionExplodedNames", "(", "$", "name", ",", "$", "type", ",", "$", "urlPrefix", "=", "null", ")", "{", "// Site Search does not split Search keywords", "if", "(", "$", "type", "==", "Action", "::", "TYPE_SITE_SEARCH", ")", "{...
Explodes action name into an array of elements. NOTE: before calling this function make sure ArchivingHelper::reloadConfig(); is called for downloads: we explode link http://piwik.org/some/path/piwik.zip into an array( 'piwik.org', '/some/path/piwik.zip' ); for outlinks: we explode link http://dev.piwik.org/some/pat...
[ "Explodes", "action", "name", "into", "an", "array", "of", "elements", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/ArchivingHelper.php#L450-L491
209,273
matomo-org/matomo
plugins/Actions/ArchivingHelper.php
ArchivingHelper.setCachedActionRow
private static function setCachedActionRow($idAction, $actionType, $actionRow) { $cacheLabel = self::getCachedActionRowKey($idAction, $actionType); self::$cacheParsedAction[$cacheLabel] = $actionRow; }
php
private static function setCachedActionRow($idAction, $actionType, $actionRow) { $cacheLabel = self::getCachedActionRowKey($idAction, $actionType); self::$cacheParsedAction[$cacheLabel] = $actionRow; }
[ "private", "static", "function", "setCachedActionRow", "(", "$", "idAction", ",", "$", "actionType", ",", "$", "actionRow", ")", "{", "$", "cacheLabel", "=", "self", "::", "getCachedActionRowKey", "(", "$", "idAction", ",", "$", "actionType", ")", ";", "self...
Set cached action row for an id & type. @param int $idAction @param int $actionType @param \DataTable\Row
[ "Set", "cached", "action", "row", "for", "an", "id", "&", "type", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/ArchivingHelper.php#L546-L550
209,274
matomo-org/matomo
core/ArchiveProcessor/Loader.php
Loader.prepareCoreMetricsArchive
protected function prepareCoreMetricsArchive($visits, $visitsConverted) { $createSeparateArchiveForCoreMetrics = $this->mustProcessVisitCount($visits) && !$this->doesRequestedPluginIncludeVisitsSummary(); if ($createSeparateArchiveForCoreMetrics) { $reque...
php
protected function prepareCoreMetricsArchive($visits, $visitsConverted) { $createSeparateArchiveForCoreMetrics = $this->mustProcessVisitCount($visits) && !$this->doesRequestedPluginIncludeVisitsSummary(); if ($createSeparateArchiveForCoreMetrics) { $reque...
[ "protected", "function", "prepareCoreMetricsArchive", "(", "$", "visits", ",", "$", "visitsConverted", ")", "{", "$", "createSeparateArchiveForCoreMetrics", "=", "$", "this", "->", "mustProcessVisitCount", "(", "$", "visits", ")", "&&", "!", "$", "this", "->", "...
Prepares the core metrics if needed. @param $visits @return array
[ "Prepares", "the", "core", "metrics", "if", "needed", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor/Loader.php#L98-L119
209,275
matomo-org/matomo
core/ArchiveProcessor/Loader.php
Loader.loadExistingArchiveIdFromDb
protected function loadExistingArchiveIdFromDb() { $noArchiveFound = array(false, false, false); // see isArchiveTemporary() $minDatetimeArchiveProcessedUTC = $this->getMinTimeArchiveProcessed(); if ($this->isArchivingForcedToTrigger()) { return $noArchiveFound; ...
php
protected function loadExistingArchiveIdFromDb() { $noArchiveFound = array(false, false, false); // see isArchiveTemporary() $minDatetimeArchiveProcessedUTC = $this->getMinTimeArchiveProcessed(); if ($this->isArchivingForcedToTrigger()) { return $noArchiveFound; ...
[ "protected", "function", "loadExistingArchiveIdFromDb", "(", ")", "{", "$", "noArchiveFound", "=", "array", "(", "false", ",", "false", ",", "false", ")", ";", "// see isArchiveTemporary()", "$", "minDatetimeArchiveProcessedUTC", "=", "$", "this", "->", "getMinTimeA...
Returns the idArchive if the archive is available in the database for the requested plugin. Returns false if the archive needs to be processed. @return array
[ "Returns", "the", "idArchive", "if", "the", "archive", "is", "available", "in", "the", "database", "for", "the", "requested", "plugin", ".", "Returns", "false", "if", "the", "archive", "needs", "to", "be", "processed", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor/Loader.php#L170-L188
209,276
matomo-org/matomo
core/ArchiveProcessor/Loader.php
Loader.getMinTimeArchiveProcessed
protected function getMinTimeArchiveProcessed() { $endDateTimestamp = self::determineIfArchivePermanent($this->params->getDateEnd()); $isArchiveTemporary = ($endDateTimestamp === false); $this->temporaryArchive = $isArchiveTemporary; if ($endDateTimestamp) { // Permanent...
php
protected function getMinTimeArchiveProcessed() { $endDateTimestamp = self::determineIfArchivePermanent($this->params->getDateEnd()); $isArchiveTemporary = ($endDateTimestamp === false); $this->temporaryArchive = $isArchiveTemporary; if ($endDateTimestamp) { // Permanent...
[ "protected", "function", "getMinTimeArchiveProcessed", "(", ")", "{", "$", "endDateTimestamp", "=", "self", "::", "determineIfArchivePermanent", "(", "$", "this", "->", "params", "->", "getDateEnd", "(", ")", ")", ";", "$", "isArchiveTemporary", "=", "(", "$", ...
Returns the minimum archive processed datetime to look at. Only public for tests. @return int|bool Datetime timestamp, or false if must look at any archive available
[ "Returns", "the", "minimum", "archive", "processed", "datetime", "to", "look", "at", ".", "Only", "public", "for", "tests", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor/Loader.php#L195-L213
209,277
matomo-org/matomo
core/Tracker/Visit/Factory.php
Factory.make
public static function make() { $visit = null; /** * Triggered before a new **visit tracking object** is created. Subscribers to this * event can force the use of a custom visit tracking object that extends from * {@link Piwik\Tracker\VisitInterface}. * ...
php
public static function make() { $visit = null; /** * Triggered before a new **visit tracking object** is created. Subscribers to this * event can force the use of a custom visit tracking object that extends from * {@link Piwik\Tracker\VisitInterface}. * ...
[ "public", "static", "function", "make", "(", ")", "{", "$", "visit", "=", "null", ";", "/**\n * Triggered before a new **visit tracking object** is created. Subscribers to this\n * event can force the use of a custom visit tracking object that extends from\n * {@link ...
Returns the Tracker_Visit object. This method can be overwritten to use a different Tracker_Visit object @throws Exception @return \Piwik\Tracker\Visit
[ "Returns", "the", "Tracker_Visit", "object", ".", "This", "method", "can", "be", "overwritten", "to", "use", "a", "different", "Tracker_Visit", "object" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Visit/Factory.php#L25-L47
209,278
matomo-org/matomo
libs/HTML/QuickForm2/Renderer/Proxy.php
HTML_QuickForm2_Renderer_Proxy.addPlugin
protected function addPlugin($index, HTML_QuickForm2_Renderer_Plugin $plugin) { $methods = array(); $reflection = new ReflectionObject($plugin); foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { $lower = strtolower($method->getName()); if ...
php
protected function addPlugin($index, HTML_QuickForm2_Renderer_Plugin $plugin) { $methods = array(); $reflection = new ReflectionObject($plugin); foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { $lower = strtolower($method->getName()); if ...
[ "protected", "function", "addPlugin", "(", "$", "index", ",", "HTML_QuickForm2_Renderer_Plugin", "$", "plugin", ")", "{", "$", "methods", "=", "array", "(", ")", ";", "$", "reflection", "=", "new", "ReflectionObject", "(", "$", "plugin", ")", ";", "foreach",...
Adds a plugin for the current renderer instance Plugin's methods are imported and can be later called as this object's own @param HTML_QuickForm2_Renderer_Plugin a plugin instance @throws HTML_QuickForm2_InvalidArgumentException if a plugin has already imported name
[ "Adds", "a", "plugin", "for", "the", "current", "renderer", "instance" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Renderer/Proxy.php#L162-L187
209,279
matomo-org/matomo
libs/Zend/Db/Adapter/Db2.php
Zend_Db_Adapter_Db2.prepare
public function prepare($sql) { $this->_connect(); $stmtClass = $this->_defaultStmtClass; if (!class_exists($stmtClass)) { // require_once 'Zend/Loader.php'; Zend_Loader::loadClass($stmtClass); } $stmt = new $stmtClass($this, $sql); $stmt->setF...
php
public function prepare($sql) { $this->_connect(); $stmtClass = $this->_defaultStmtClass; if (!class_exists($stmtClass)) { // require_once 'Zend/Loader.php'; Zend_Loader::loadClass($stmtClass); } $stmt = new $stmtClass($this, $sql); $stmt->setF...
[ "public", "function", "prepare", "(", "$", "sql", ")", "{", "$", "this", "->", "_connect", "(", ")", ";", "$", "stmtClass", "=", "$", "this", "->", "_defaultStmtClass", ";", "if", "(", "!", "class_exists", "(", "$", "stmtClass", ")", ")", "{", "// re...
Returns an SQL statement for preparation. @param string $sql The SQL statement with placeholders. @return Zend_Db_Statement_Db2
[ "Returns", "an", "SQL", "statement", "for", "preparation", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Db2.php#L230-L241
209,280
matomo-org/matomo
libs/Zend/Db/Adapter/Db2.php
Zend_Db_Adapter_Db2._determineI5
protected function _determineI5() { // first us the compiled flag. $this->_isI5 = (php_uname('s') == 'OS400') ? true : false; // if this is set, then us it if (isset($this->_config['os'])){ if (strtolower($this->_config['os']) === 'i5') { $this->_isI5 = t...
php
protected function _determineI5() { // first us the compiled flag. $this->_isI5 = (php_uname('s') == 'OS400') ? true : false; // if this is set, then us it if (isset($this->_config['os'])){ if (strtolower($this->_config['os']) === 'i5') { $this->_isI5 = t...
[ "protected", "function", "_determineI5", "(", ")", "{", "// first us the compiled flag.", "$", "this", "->", "_isI5", "=", "(", "php_uname", "(", "'s'", ")", "==", "'OS400'", ")", "?", "true", ":", "false", ";", "// if this is set, then us it", "if", "(", "iss...
Check the connection parameters according to verify type of used OS @return void
[ "Check", "the", "connection", "parameters", "according", "to", "verify", "type", "of", "used", "OS" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Db2.php#L761-L776
209,281
matomo-org/matomo
libs/Zend/Db/Adapter/Db2.php
Zend_Db_Adapter_Db2._i5listTables
protected function _i5listTables($schema = null) { //list of i5 libraries. $tables = array(); if ($schema) { $tablesStatement = db2_tables($this->_connection, null, $schema); while ($rowTables = db2_fetch_assoc($tablesStatement) ) { if ($rowTables['TAB...
php
protected function _i5listTables($schema = null) { //list of i5 libraries. $tables = array(); if ($schema) { $tablesStatement = db2_tables($this->_connection, null, $schema); while ($rowTables = db2_fetch_assoc($tablesStatement) ) { if ($rowTables['TAB...
[ "protected", "function", "_i5listTables", "(", "$", "schema", "=", "null", ")", "{", "//list of i5 libraries.", "$", "tables", "=", "array", "(", ")", ";", "if", "(", "$", "schema", ")", "{", "$", "tablesStatement", "=", "db2_tables", "(", "$", "this", "...
Db2 On I5 specific method Returns a list of the tables in the database . Used only for DB2/400. @return array
[ "Db2", "On", "I5", "specific", "method" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Db2.php#L786-L815
209,282
matomo-org/matomo
libs/Zend/Validate/File/Extension.php
Zend_Validate_File_Extension.addExtension
public function addExtension($extension) { $extensions = $this->getExtension(); if (is_string($extension)) { $extension = explode(',', $extension); } foreach ($extension as $content) { if (empty($content) || !is_string($content)) { continue; ...
php
public function addExtension($extension) { $extensions = $this->getExtension(); if (is_string($extension)) { $extension = explode(',', $extension); } foreach ($extension as $content) { if (empty($content) || !is_string($content)) { continue; ...
[ "public", "function", "addExtension", "(", "$", "extension", ")", "{", "$", "extensions", "=", "$", "this", "->", "getExtension", "(", ")", ";", "if", "(", "is_string", "(", "$", "extension", ")", ")", "{", "$", "extension", "=", "explode", "(", "','",...
Adds the file extensions @param string|array $extension The extensions to add for validation @return Zend_Validate_File_Extension Provides a fluent interface
[ "Adds", "the", "file", "extensions" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/File/Extension.php#L149-L175
209,283
matomo-org/matomo
libs/Zend/Validate/File/Extension.php
Zend_Validate_File_Extension._throw
protected function _throw($file, $errorType) { if (null !== $file) { $this->_value = $file['name']; } $this->_error($errorType); return false; }
php
protected function _throw($file, $errorType) { if (null !== $file) { $this->_value = $file['name']; } $this->_error($errorType); return false; }
[ "protected", "function", "_throw", "(", "$", "file", ",", "$", "errorType", ")", "{", "if", "(", "null", "!==", "$", "file", ")", "{", "$", "this", "->", "_value", "=", "$", "file", "[", "'name'", "]", ";", "}", "$", "this", "->", "_error", "(", ...
Throws an error of the given type @param string $file @param string $errorType @return false
[ "Throws", "an", "error", "of", "the", "given", "type" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/File/Extension.php#L223-L231
209,284
matomo-org/matomo
core/Settings/Plugin/UserSettings.php
UserSettings.makeSetting
protected function makeSetting($name, $defaultValue, $type, $configureCallback) { $userLogin = Piwik::getCurrentUserLogin(); $setting = new UserSetting($name, $defaultValue, $type, $this->pluginName, $userLogin); $setting->setConfigureCallback($configureCallback); $this->addSetting...
php
protected function makeSetting($name, $defaultValue, $type, $configureCallback) { $userLogin = Piwik::getCurrentUserLogin(); $setting = new UserSetting($name, $defaultValue, $type, $this->pluginName, $userLogin); $setting->setConfigureCallback($configureCallback); $this->addSetting...
[ "protected", "function", "makeSetting", "(", "$", "name", ",", "$", "defaultValue", ",", "$", "type", ",", "$", "configureCallback", ")", "{", "$", "userLogin", "=", "Piwik", "::", "getCurrentUserLogin", "(", ")", ";", "$", "setting", "=", "new", "UserSett...
Creates a new user setting. Settings will be displayed in the UI depending on the order of `makeSetting` calls. This means you can define the order of the displayed settings by calling makeSetting first for more important settings. @param string $name The name of the setting that shall be created @param mixed...
[ "Creates", "a", "new", "user", "setting", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Settings/Plugin/UserSettings.php#L57-L66
209,285
matomo-org/matomo
plugins/CoreVisualizations/Visualizations/Graph.php
Graph.determineWhichRowsAreSelectable
public function determineWhichRowsAreSelectable() { if ($this->config->row_picker_match_rows_by === false) { return; } // collect all selectable rows $self = $this; $this->dataTable->filter(function ($dataTable) use ($self) { /** @var DataTable $data...
php
public function determineWhichRowsAreSelectable() { if ($this->config->row_picker_match_rows_by === false) { return; } // collect all selectable rows $self = $this; $this->dataTable->filter(function ($dataTable) use ($self) { /** @var DataTable $data...
[ "public", "function", "determineWhichRowsAreSelectable", "(", ")", "{", "if", "(", "$", "this", "->", "config", "->", "row_picker_match_rows_by", "===", "false", ")", "{", "return", ";", "}", "// collect all selectable rows", "$", "self", "=", "$", "this", ";", ...
Determines what rows are selectable and stores them in the selectable_rows property in a format the SeriesPicker JavaScript class can use.
[ "Determines", "what", "rows", "are", "selectable", "and", "stores", "them", "in", "the", "selectable_rows", "property", "in", "a", "format", "the", "SeriesPicker", "JavaScript", "class", "can", "use", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/Visualizations/Graph.php#L71-L100
209,286
matomo-org/matomo
plugins/CoreVisualizations/Visualizations/Graph.php
Graph.afterAllFiltersAreApplied
public function afterAllFiltersAreApplied() { $this->determineWhichRowsAreSelectable(); // set default selectable columns, if none specified $selectableColumns = $this->config->selectable_columns; if (false === $selectableColumns) { $this->generateSelectableColumns(); ...
php
public function afterAllFiltersAreApplied() { $this->determineWhichRowsAreSelectable(); // set default selectable columns, if none specified $selectableColumns = $this->config->selectable_columns; if (false === $selectableColumns) { $this->generateSelectableColumns(); ...
[ "public", "function", "afterAllFiltersAreApplied", "(", ")", "{", "$", "this", "->", "determineWhichRowsAreSelectable", "(", ")", ";", "// set default selectable columns, if none specified", "$", "selectableColumns", "=", "$", "this", "->", "config", "->", "selectable_col...
Defaults the selectable_columns property if it has not been set and then transforms it into something the SeriesPicker JavaScript class can use.
[ "Defaults", "the", "selectable_columns", "property", "if", "it", "has", "not", "been", "set", "and", "then", "transforms", "it", "into", "something", "the", "SeriesPicker", "JavaScript", "class", "can", "use", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/Visualizations/Graph.php#L116-L132
209,287
matomo-org/matomo
core/Sequence.php
Sequence.exists
public function exists() { $query = $this->db->query('SELECT * FROM ' . $this->table . ' WHERE name = ?', $this->name); return $query->rowCount() > 0; }
php
public function exists() { $query = $this->db->query('SELECT * FROM ' . $this->table . ' WHERE name = ?', $this->name); return $query->rowCount() > 0; }
[ "public", "function", "exists", "(", ")", "{", "$", "query", "=", "$", "this", "->", "db", "->", "query", "(", "'SELECT * FROM '", ".", "$", "this", "->", "table", ".", "' WHERE name = ?'", ",", "$", "this", "->", "name", ")", ";", "return", "$", "qu...
Returns true if the sequence exist. @return bool
[ "Returns", "true", "if", "the", "sequence", "exist", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Sequence.php#L77-L82
209,288
matomo-org/matomo
core/Sequence.php
Sequence.getCurrentId
public function getCurrentId() { $sql = 'SELECT value FROM ' . $this->table . ' WHERE name = ?'; $id = $this->db->fetchOne($sql, array($this->name)); if (!empty($id) || '0' === $id || 0 === $id) { return (int) $id; } }
php
public function getCurrentId() { $sql = 'SELECT value FROM ' . $this->table . ' WHERE name = ?'; $id = $this->db->fetchOne($sql, array($this->name)); if (!empty($id) || '0' === $id || 0 === $id) { return (int) $id; } }
[ "public", "function", "getCurrentId", "(", ")", "{", "$", "sql", "=", "'SELECT value FROM '", ".", "$", "this", "->", "table", ".", "' WHERE name = ?'", ";", "$", "id", "=", "$", "this", "->", "db", "->", "fetchOne", "(", "$", "sql", ",", "array", "(",...
Returns the current max id. @return int @internal
[ "Returns", "the", "current", "max", "id", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Sequence.php#L112-L121
209,289
matomo-org/matomo
plugins/CoreVisualizations/Visualizations/Sparklines/Config.php
Config.removeSparklineMetric
public function removeSparklineMetric($metricNames) { foreach ($this->sparkline_metrics as $index => $metric) { if ($metric['columns'] === $metricNames) { array_splice($this->sparkline_metrics, $index, 1); break; } } }
php
public function removeSparklineMetric($metricNames) { foreach ($this->sparkline_metrics as $index => $metric) { if ($metric['columns'] === $metricNames) { array_splice($this->sparkline_metrics, $index, 1); break; } } }
[ "public", "function", "removeSparklineMetric", "(", "$", "metricNames", ")", "{", "foreach", "(", "$", "this", "->", "sparkline_metrics", "as", "$", "index", "=>", "$", "metric", ")", "{", "if", "(", "$", "metric", "[", "'columns'", "]", "===", "$", "met...
Removes an existing sparkline entry. Especially useful in dataTable filters in case sparklines should be not displayed depending on the fetched data. Example: $config->addSparklineMetric('nb_users'); $config->filters[] = function ($dataTable) use ($config) { if ($dataTable->getFirstRow()->getColumn('nb_users') == 0) {...
[ "Removes", "an", "existing", "sparkline", "entry", ".", "Especially", "useful", "in", "dataTable", "filters", "in", "case", "sparklines", "should", "be", "not", "displayed", "depending", "on", "the", "fetched", "data", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/Visualizations/Sparklines/Config.php#L90-L99
209,290
matomo-org/matomo
plugins/CoreVisualizations/Visualizations/Sparklines/Config.php
Config.replaceSparklineMetric
public function replaceSparklineMetric($metricNames, $replacementColumns) { foreach ($this->sparkline_metrics as $index => $metric) { if ($metric['columns'] === $metricNames) { $this->sparkline_metrics[$index]['columns'] = $replacementColumns; } } }
php
public function replaceSparklineMetric($metricNames, $replacementColumns) { foreach ($this->sparkline_metrics as $index => $metric) { if ($metric['columns'] === $metricNames) { $this->sparkline_metrics[$index]['columns'] = $replacementColumns; } } }
[ "public", "function", "replaceSparklineMetric", "(", "$", "metricNames", ",", "$", "replacementColumns", ")", "{", "foreach", "(", "$", "this", "->", "sparkline_metrics", "as", "$", "index", "=>", "$", "metric", ")", "{", "if", "(", "$", "metric", "[", "'c...
Replaces an existing sparkline entry with different columns. Especially useful in dataTable filters in case sparklines should be not displayed depending on the fetched data. Example: $config->addSparklineMetric('nb_users'); $config->filters[] = function ($dataTable) use ($config) { if ($dataTable->getFirstRow()->getCo...
[ "Replaces", "an", "existing", "sparkline", "entry", "with", "different", "columns", ".", "Especially", "useful", "in", "dataTable", "filters", "in", "case", "sparklines", "should", "be", "not", "displayed", "depending", "on", "the", "fetched", "data", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/Visualizations/Sparklines/Config.php#L118-L125
209,291
matomo-org/matomo
plugins/CoreVisualizations/Visualizations/Sparklines/Config.php
Config.getUrlSparkline
private function getUrlSparkline($customParameters = array()) { $customParameters['viewDataTable'] = 'sparkline'; $params = $this->getGraphParamsModified($customParameters); // convert array values to comma separated foreach ($params as &$value) { if (is_array($value)) ...
php
private function getUrlSparkline($customParameters = array()) { $customParameters['viewDataTable'] = 'sparkline'; $params = $this->getGraphParamsModified($customParameters); // convert array values to comma separated foreach ($params as &$value) { if (is_array($value)) ...
[ "private", "function", "getUrlSparkline", "(", "$", "customParameters", "=", "array", "(", ")", ")", "{", "$", "customParameters", "[", "'viewDataTable'", "]", "=", "'sparkline'", ";", "$", "params", "=", "$", "this", "->", "getGraphParamsModified", "(", "$", ...
Returns a URL to a sparkline image for a report served by the current plugin. The result of this URL should be used with the [sparkline()](/api-reference/Piwik/View#twig) twig function. The current site ID and period will be used. @param array $customParameters The array of query parameter name/value pairs that shou...
[ "Returns", "a", "URL", "to", "a", "sparkline", "image", "for", "a", "report", "served", "by", "the", "current", "plugin", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/Visualizations/Sparklines/Config.php#L327-L341
209,292
matomo-org/matomo
plugins/DBStats/Tasks.php
Tasks.cacheDataByArchiveNameReports
public function cacheDataByArchiveNameReports() { $api = API::getInstance(); $api->getIndividualReportsSummary(true); $api->getIndividualMetricsSummary(true); $now = Date::now()->getLocalized(Date::DATE_FORMAT_SHORT); Option::set(DBStats::TIME_OF_LAST_TASK_RUN_OPTION, $now);...
php
public function cacheDataByArchiveNameReports() { $api = API::getInstance(); $api->getIndividualReportsSummary(true); $api->getIndividualMetricsSummary(true); $now = Date::now()->getLocalized(Date::DATE_FORMAT_SHORT); Option::set(DBStats::TIME_OF_LAST_TASK_RUN_OPTION, $now);...
[ "public", "function", "cacheDataByArchiveNameReports", "(", ")", "{", "$", "api", "=", "API", "::", "getInstance", "(", ")", ";", "$", "api", "->", "getIndividualReportsSummary", "(", "true", ")", ";", "$", "api", "->", "getIndividualMetricsSummary", "(", "tru...
Caches the intermediate DataTables used in the getIndividualReportsSummary and getIndividualMetricsSummary reports in the option table.
[ "Caches", "the", "intermediate", "DataTables", "used", "in", "the", "getIndividualReportsSummary", "and", "getIndividualMetricsSummary", "reports", "in", "the", "option", "table", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/Tasks.php#L25-L33
209,293
matomo-org/matomo
libs/HTML/QuickForm2/Controller.php
HTML_QuickForm2_Controller.getSessionContainer
public function getSessionContainer() { if (empty($this->sessionContainer)) { $this->sessionContainer = new HTML_QuickForm2_Controller_SessionContainer($this); } return $this->sessionContainer; }
php
public function getSessionContainer() { if (empty($this->sessionContainer)) { $this->sessionContainer = new HTML_QuickForm2_Controller_SessionContainer($this); } return $this->sessionContainer; }
[ "public", "function", "getSessionContainer", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "sessionContainer", ")", ")", "{", "$", "this", "->", "sessionContainer", "=", "new", "HTML_QuickForm2_Controller_SessionContainer", "(", "$", "this", ")", ...
Returns the session container with the controller data @return HTML_QuickForm2_Controller_SessionContainer
[ "Returns", "the", "session", "container", "with", "the", "controller", "data" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L211-L217
209,294
matomo-org/matomo
libs/HTML/QuickForm2/Controller.php
HTML_QuickForm2_Controller.destroySessionContainer
public function destroySessionContainer() { unset($_SESSION[sprintf(self::KEY_CONTAINER, $this->id)]); $this->sessionContainer = null; }
php
public function destroySessionContainer() { unset($_SESSION[sprintf(self::KEY_CONTAINER, $this->id)]); $this->sessionContainer = null; }
[ "public", "function", "destroySessionContainer", "(", ")", "{", "unset", "(", "$", "_SESSION", "[", "sprintf", "(", "self", "::", "KEY_CONTAINER", ",", "$", "this", "->", "id", ")", "]", ")", ";", "$", "this", "->", "sessionContainer", "=", "null", ";", ...
Removes the session variable containing the controller data
[ "Removes", "the", "session", "variable", "containing", "the", "controller", "data" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L222-L226
209,295
matomo-org/matomo
libs/HTML/QuickForm2/Controller.php
HTML_QuickForm2_Controller.getActionName
public function getActionName() { if (is_array($this->actionName)) { return $this->actionName; } if (empty($this->pages)) { throw new HTML_QuickForm2_NotFoundException('No pages added to the form'); } $names = array_map('preg_quote', array_keys($this->...
php
public function getActionName() { if (is_array($this->actionName)) { return $this->actionName; } if (empty($this->pages)) { throw new HTML_QuickForm2_NotFoundException('No pages added to the form'); } $names = array_map('preg_quote', array_keys($this->...
[ "public", "function", "getActionName", "(", ")", "{", "if", "(", "is_array", "(", "$", "this", "->", "actionName", ")", ")", "{", "return", "$", "this", "->", "actionName", ";", "}", "if", "(", "empty", "(", "$", "this", "->", "pages", ")", ")", "{...
Extracts the name of the page and the action to perform with it from HTTP request data @return array first element is page name, second is action name
[ "Extracts", "the", "name", "of", "the", "page", "and", "the", "action", "to", "perform", "with", "it", "from", "HTTP", "request", "data" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L233-L254
209,296
matomo-org/matomo
libs/HTML/QuickForm2/Controller.php
HTML_QuickForm2_Controller.addPage
public function addPage(HTML_QuickForm2_Controller_Page $page) { $pageId = $page->getForm()->getId(); if (!empty($this->pages[$pageId])) { throw new HTML_QuickForm2_InvalidArgumentException( "Duplicate page ID '{$pageId}'" ); } $page->setContro...
php
public function addPage(HTML_QuickForm2_Controller_Page $page) { $pageId = $page->getForm()->getId(); if (!empty($this->pages[$pageId])) { throw new HTML_QuickForm2_InvalidArgumentException( "Duplicate page ID '{$pageId}'" ); } $page->setContro...
[ "public", "function", "addPage", "(", "HTML_QuickForm2_Controller_Page", "$", "page", ")", "{", "$", "pageId", "=", "$", "page", "->", "getForm", "(", ")", "->", "getId", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "pages", "[", "...
Adds a new page to the form @param HTML_QuickForm2_Controller_Page
[ "Adds", "a", "new", "page", "to", "the", "form" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L317-L327
209,297
matomo-org/matomo
libs/HTML/QuickForm2/Controller.php
HTML_QuickForm2_Controller.getPage
public function getPage($pageId) { if (!empty($this->pages[$pageId])) { return $this->pages[$pageId]; } else { throw new HTML_QuickForm2_NotFoundException( "Unknown page '{$pageId}'" ); } }
php
public function getPage($pageId) { if (!empty($this->pages[$pageId])) { return $this->pages[$pageId]; } else { throw new HTML_QuickForm2_NotFoundException( "Unknown page '{$pageId}'" ); } }
[ "public", "function", "getPage", "(", "$", "pageId", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "pages", "[", "$", "pageId", "]", ")", ")", "{", "return", "$", "this", "->", "pages", "[", "$", "pageId", "]", ";", "}", "else", "{...
Returns a page @param string Page ID @return HTML_QuickForm2_Controller_Page @throws HTML_QuickForm2_NotFoundException if there is no page with the given ID
[ "Returns", "a", "page" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L337-L346
209,298
matomo-org/matomo
libs/HTML/QuickForm2/Controller.php
HTML_QuickForm2_Controller.previousPage
public function previousPage(HTML_QuickForm2_Controller_Page $reference) { $previous = null; foreach ($this->pages as $page) { if ($page === $reference) { return $previous; } $previous = $page; } return null; }
php
public function previousPage(HTML_QuickForm2_Controller_Page $reference) { $previous = null; foreach ($this->pages as $page) { if ($page === $reference) { return $previous; } $previous = $page; } return null; }
[ "public", "function", "previousPage", "(", "HTML_QuickForm2_Controller_Page", "$", "reference", ")", "{", "$", "previous", "=", "null", ";", "foreach", "(", "$", "this", "->", "pages", "as", "$", "page", ")", "{", "if", "(", "$", "page", "===", "$", "ref...
Returns the page preceding the given one @param HTML_QuickForm2_Controller_Page @return HTML_QuickForm2_Controller_Page|null
[ "Returns", "the", "page", "preceding", "the", "given", "one" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L354-L364
209,299
matomo-org/matomo
libs/HTML/QuickForm2/Controller.php
HTML_QuickForm2_Controller.isValid
public function isValid(HTML_QuickForm2_Controller_Page $reference = null) { $container = $this->getSessionContainer(); foreach ($this->pages as $id => $page) { if ($reference === $page) { return true; } if (!$container->getValidationStatus($id)) {...
php
public function isValid(HTML_QuickForm2_Controller_Page $reference = null) { $container = $this->getSessionContainer(); foreach ($this->pages as $id => $page) { if ($reference === $page) { return true; } if (!$container->getValidationStatus($id)) {...
[ "public", "function", "isValid", "(", "HTML_QuickForm2_Controller_Page", "$", "reference", "=", "null", ")", "{", "$", "container", "=", "$", "this", "->", "getSessionContainer", "(", ")", ";", "foreach", "(", "$", "this", "->", "pages", "as", "$", "id", "...
Checks whether the pages of the controller are valid @param HTML_QuickForm2_Controller_Page If given, check only the pages before (not including) that page @return bool
[ "Checks", "whether", "the", "pages", "of", "the", "controller", "are", "valid" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L391-L419