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,600
matomo-org/matomo
core/DataTable/Row.php
Row.addColumn
public function addColumn($name, $value) { if (isset($this[$name])) { throw new Exception("Column $name already in the array!"); } $this->setColumn($name, $value); }
php
public function addColumn($name, $value) { if (isset($this[$name])) { throw new Exception("Column $name already in the array!"); } $this->setColumn($name, $value); }
[ "public", "function", "addColumn", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "isset", "(", "$", "this", "[", "$", "name", "]", ")", ")", "{", "throw", "new", "Exception", "(", "\"Column $name already in the array!\"", ")", ";", "}", "$"...
Add a new column to the row. If the column already exists, throws an exception. @param string $name name of the column to add. @param mixed $value value of the column to set or a PHP callable. @throws Exception if the column already exists.
[ "Add", "a", "new", "column", "to", "the", "row", ".", "If", "the", "column", "already", "exists", "throws", "an", "exception", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L391-L397
209,601
matomo-org/matomo
core/DataTable/Row.php
Row.addColumns
public function addColumns($columns) { foreach ($columns as $name => $value) { try { $this->addColumn($name, $value); } catch (Exception $e) { } } if (!empty($e)) { throw $e; } }
php
public function addColumns($columns) { foreach ($columns as $name => $value) { try { $this->addColumn($name, $value); } catch (Exception $e) { } } if (!empty($e)) { throw $e; } }
[ "public", "function", "addColumns", "(", "$", "columns", ")", "{", "foreach", "(", "$", "columns", "as", "$", "name", "=>", "$", "value", ")", "{", "try", "{", "$", "this", "->", "addColumn", "(", "$", "name", ",", "$", "value", ")", ";", "}", "c...
Add many columns to this row. @param array $columns Name/Value pairs, e.g., `array('name' => $value , ...)` @throws Exception if any column name does not exist. @return void
[ "Add", "many", "columns", "to", "this", "row", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L406-L418
209,602
matomo-org/matomo
core/DataTable/Row.php
Row.addMetadata
public function addMetadata($name, $value) { if (isset($this->metadata[$name])) { throw new Exception("Metadata $name already in the array!"); } $this->setMetadata($name, $value); }
php
public function addMetadata($name, $value) { if (isset($this->metadata[$name])) { throw new Exception("Metadata $name already in the array!"); } $this->setMetadata($name, $value); }
[ "public", "function", "addMetadata", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "metadata", "[", "$", "name", "]", ")", ")", "{", "throw", "new", "Exception", "(", "\"Metadata $name already in the array!\"", ...
Add a new metadata to the row. If the metadata already exists, throws an exception. @param string $name name of the metadata to add. @param mixed $value value of the metadata to set. @throws Exception if the metadata already exists.
[ "Add", "a", "new", "metadata", "to", "the", "row", ".", "If", "the", "metadata", "already", "exists", "throws", "an", "exception", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L427-L433
209,603
matomo-org/matomo
core/DataTable/Row.php
Row.isEqual
public static function isEqual(Row $row1, Row $row2) { //same columns $cols1 = $row1->getColumns(); $cols2 = $row2->getColumns(); $diff1 = array_udiff($cols1, $cols2, array(__CLASS__, 'compareElements')); $diff2 = array_udiff($cols2, $cols1, array(__CLASS__, 'compareElements...
php
public static function isEqual(Row $row1, Row $row2) { //same columns $cols1 = $row1->getColumns(); $cols2 = $row2->getColumns(); $diff1 = array_udiff($cols1, $cols2, array(__CLASS__, 'compareElements')); $diff2 = array_udiff($cols2, $cols1, array(__CLASS__, 'compareElements...
[ "public", "static", "function", "isEqual", "(", "Row", "$", "row1", ",", "Row", "$", "row2", ")", "{", "//same columns", "$", "cols1", "=", "$", "row1", "->", "getColumns", "(", ")", ";", "$", "cols2", "=", "$", "row2", "->", "getColumns", "(", ")", ...
Helper function that tests if two rows are equal. Two rows are equal if: - they have exactly the same columns / metadata - they have a subDataTable associated, then we check that both of them are the same. Column order is not important. @param \Piwik\DataTable\Row $row1 first to compare @param \Piwik\DataTable\Row ...
[ "Helper", "function", "that", "tests", "if", "two", "rows", "are", "equal", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L682-L718
209,604
matomo-org/matomo
core/View/RenderTokenParser.php
RenderTokenParser.parse
public function parse(Twig_Token $token) { $parser = $this->parser; $stream = $parser->getStream(); $view = $parser->getExpressionParser()->parseExpression(); $variablesOverride = new Twig_Node_Expression_Array(array(), $token->getLine()); if ($stream->test(Twig_Token::NAME...
php
public function parse(Twig_Token $token) { $parser = $this->parser; $stream = $parser->getStream(); $view = $parser->getExpressionParser()->parseExpression(); $variablesOverride = new Twig_Node_Expression_Array(array(), $token->getLine()); if ($stream->test(Twig_Token::NAME...
[ "public", "function", "parse", "(", "Twig_Token", "$", "token", ")", "{", "$", "parser", "=", "$", "this", "->", "parser", ";", "$", "stream", "=", "$", "parser", "->", "getStream", "(", ")", ";", "$", "view", "=", "$", "parser", "->", "getExpression...
Parses the Twig stream and creates a Twig_Node_Include instance that includes the View's template. @return Twig_Node_Include
[ "Parses", "the", "Twig", "stream", "and", "creates", "a", "Twig_Node_Include", "instance", "that", "includes", "the", "View", "s", "template", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/View/RenderTokenParser.php#L34-L71
209,605
matomo-org/matomo
core/CronArchive.php
CronArchive.main
public function main() { if ($this->isMaintenanceModeEnabled()) { $this->logger->info("Archiving won't run because maintenance mode is enabled"); return; } $self = $this; Access::doAsSuperUser(function () use ($self) { $self->init(); $...
php
public function main() { if ($this->isMaintenanceModeEnabled()) { $this->logger->info("Archiving won't run because maintenance mode is enabled"); return; } $self = $this; Access::doAsSuperUser(function () use ($self) { $self->init(); $...
[ "public", "function", "main", "(", ")", "{", "if", "(", "$", "this", "->", "isMaintenanceModeEnabled", "(", ")", ")", "{", "$", "this", "->", "logger", "->", "info", "(", "\"Archiving won't run because maintenance mode is enabled\"", ")", ";", "return", ";", "...
Initializes and runs the cron archiver.
[ "Initializes", "and", "runs", "the", "cron", "archiver", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L306-L320
209,606
matomo-org/matomo
core/CronArchive.php
CronArchive.end
public function end() { /** * This event is triggered after archiving. * * @param CronArchive $this */ Piwik::postEvent('CronArchive.end', array($this)); if (empty($this->errors)) { // No error -> Logs the successful script execution until com...
php
public function end() { /** * This event is triggered after archiving. * * @param CronArchive $this */ Piwik::postEvent('CronArchive.end', array($this)); if (empty($this->errors)) { // No error -> Logs the successful script execution until com...
[ "public", "function", "end", "(", ")", "{", "/**\n * This event is triggered after archiving.\n *\n * @param CronArchive $this\n */", "Piwik", "::", "postEvent", "(", "'CronArchive.end'", ",", "array", "(", "$", "this", ")", ")", ";", "if", "...
End of the script
[ "End", "of", "the", "script" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L548-L571
209,607
matomo-org/matomo
core/CronArchive.php
CronArchive.logSection
private function logSection($title = "") { $this->logger->info("---------------------------"); if (!empty($title)) { $this->logger->info($title); } }
php
private function logSection($title = "") { $this->logger->info("---------------------------"); if (!empty($title)) { $this->logger->info($title); } }
[ "private", "function", "logSection", "(", "$", "title", "=", "\"\"", ")", "{", "$", "this", "->", "logger", "->", "info", "(", "\"---------------------------\"", ")", ";", "if", "(", "!", "empty", "(", "$", "title", ")", ")", "{", "$", "this", "->", ...
Logs a section in the output @param string $title
[ "Logs", "a", "section", "in", "the", "output" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L1057-L1063
209,608
matomo-org/matomo
core/CronArchive.php
CronArchive.initStateFromParameters
private function initStateFromParameters() { $this->todayArchiveTimeToLive = Rules::getTodayArchiveTimeToLive(); $this->processPeriodsMaximumEverySeconds = $this->getDelayBetweenPeriodsArchives(); $this->lastSuccessRunTimestamp = $this->getLastSuccessRunTimestamp(); $this->shouldArch...
php
private function initStateFromParameters() { $this->todayArchiveTimeToLive = Rules::getTodayArchiveTimeToLive(); $this->processPeriodsMaximumEverySeconds = $this->getDelayBetweenPeriodsArchives(); $this->lastSuccessRunTimestamp = $this->getLastSuccessRunTimestamp(); $this->shouldArch...
[ "private", "function", "initStateFromParameters", "(", ")", "{", "$", "this", "->", "todayArchiveTimeToLive", "=", "Rules", "::", "getTodayArchiveTimeToLive", "(", ")", ";", "$", "this", "->", "processPeriodsMaximumEverySeconds", "=", "$", "this", "->", "getDelayBet...
Initializes the various parameters to the script, based on input parameters.
[ "Initializes", "the", "various", "parameters", "to", "the", "script", "based", "on", "input", "parameters", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L1132-L1144
209,609
matomo-org/matomo
core/CronArchive.php
CronArchive.initWebsiteIds
public function initWebsiteIds() { if (count($this->shouldArchiveSpecifiedSites) > 0) { $this->logger->info("- Will process " . count($this->shouldArchiveSpecifiedSites) . " websites (--force-idsites)"); return $this->shouldArchiveSpecifiedSites; } $this->findWebsit...
php
public function initWebsiteIds() { if (count($this->shouldArchiveSpecifiedSites) > 0) { $this->logger->info("- Will process " . count($this->shouldArchiveSpecifiedSites) . " websites (--force-idsites)"); return $this->shouldArchiveSpecifiedSites; } $this->findWebsit...
[ "public", "function", "initWebsiteIds", "(", ")", "{", "if", "(", "count", "(", "$", "this", "->", "shouldArchiveSpecifiedSites", ")", ">", "0", ")", "{", "$", "this", "->", "logger", "->", "info", "(", "\"- Will process \"", ".", "count", "(", "$", "thi...
Returns the list of sites to loop over and archive. @return array
[ "Returns", "the", "list", "of", "sites", "to", "loop", "over", "and", "archive", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L1221-L1237
209,610
matomo-org/matomo
core/CronArchive.php
CronArchive.hadWebsiteTrafficSinceMidnightInTimezone
private function hadWebsiteTrafficSinceMidnightInTimezone($idSite) { $timezone = Site::getTimezoneFor($idSite); $nowInTimezone = Date::factory('now', $timezone); $midnightInTimezone = $nowInTimezone->setTime('00:00:00'); $secondsSinceMidnight = $nowInTimezone->getTimestamp() -...
php
private function hadWebsiteTrafficSinceMidnightInTimezone($idSite) { $timezone = Site::getTimezoneFor($idSite); $nowInTimezone = Date::factory('now', $timezone); $midnightInTimezone = $nowInTimezone->setTime('00:00:00'); $secondsSinceMidnight = $nowInTimezone->getTimestamp() -...
[ "private", "function", "hadWebsiteTrafficSinceMidnightInTimezone", "(", "$", "idSite", ")", "{", "$", "timezone", "=", "Site", "::", "getTimezoneFor", "(", "$", "idSite", ")", ";", "$", "nowInTimezone", "=", "Date", "::", "factory", "(", "'now'", ",", "$", "...
Detects whether a site had visits since midnight in the websites timezone @param $idSite @return bool
[ "Detects", "whether", "a", "site", "had", "visits", "since", "midnight", "in", "the", "websites", "timezone" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L1272-L1303
209,611
matomo-org/matomo
core/CronArchive.php
CronArchive.getTimezonesHavingNewDaySinceLastRun
private function getTimezonesHavingNewDaySinceLastRun() { $timestamp = $this->lastSuccessRunTimestamp; $uniqueTimezones = APISitesManager::getInstance()->getUniqueSiteTimezones(); $timezoneToProcess = array(); foreach ($uniqueTimezones as &$timezone) { $processedDateInTz ...
php
private function getTimezonesHavingNewDaySinceLastRun() { $timestamp = $this->lastSuccessRunTimestamp; $uniqueTimezones = APISitesManager::getInstance()->getUniqueSiteTimezones(); $timezoneToProcess = array(); foreach ($uniqueTimezones as &$timezone) { $processedDateInTz ...
[ "private", "function", "getTimezonesHavingNewDaySinceLastRun", "(", ")", "{", "$", "timestamp", "=", "$", "this", "->", "lastSuccessRunTimestamp", ";", "$", "uniqueTimezones", "=", "APISitesManager", "::", "getInstance", "(", ")", "->", "getUniqueSiteTimezones", "(", ...
Returns the list of timezones where the specified timestamp in that timezone is on a different day than today in that timezone. @return array
[ "Returns", "the", "list", "of", "timezones", "where", "the", "specified", "timestamp", "in", "that", "timezone", "is", "on", "a", "different", "day", "than", "today", "in", "that", "timezone", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L1311-L1325
209,612
matomo-org/matomo
core/Tracker/GoalManager.php
GoalManager.detectGoalsMatchingUrl
public function detectGoalsMatchingUrl($idSite, $action) { if (!Common::isGoalPluginEnabled()) { return array(); } $goals = $this->getGoalDefinitions($idSite); $convertedGoals = array(); foreach ($goals as $goal) { $convertedUrl = $this->detectGoalMa...
php
public function detectGoalsMatchingUrl($idSite, $action) { if (!Common::isGoalPluginEnabled()) { return array(); } $goals = $this->getGoalDefinitions($idSite); $convertedGoals = array(); foreach ($goals as $goal) { $convertedUrl = $this->detectGoalMa...
[ "public", "function", "detectGoalsMatchingUrl", "(", "$", "idSite", ",", "$", "action", ")", "{", "if", "(", "!", "Common", "::", "isGoalPluginEnabled", "(", ")", ")", "{", "return", "array", "(", ")", ";", "}", "$", "goals", "=", "$", "this", "->", ...
Look at the URL or Page Title and sees if it matches any existing Goal definition @param int $idSite @param Action $action @throws Exception @return array[] Goals matched
[ "Look", "at", "the", "URL", "or", "Page", "Title", "and", "sees", "if", "it", "matches", "any", "existing", "Goal", "definition" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/GoalManager.php#L125-L141
209,613
matomo-org/matomo
core/Tracker/GoalManager.php
GoalManager.detectGoalMatch
public function detectGoalMatch($goal, Action $action) { $actionType = $action->getActionType(); $attribute = $goal['match_attribute']; // if the attribute to match is not the type of the current action if ((($attribute == 'url' || $attribute == 'title') && $actionType != Action::T...
php
public function detectGoalMatch($goal, Action $action) { $actionType = $action->getActionType(); $attribute = $goal['match_attribute']; // if the attribute to match is not the type of the current action if ((($attribute == 'url' || $attribute == 'title') && $actionType != Action::T...
[ "public", "function", "detectGoalMatch", "(", "$", "goal", ",", "Action", "$", "action", ")", "{", "$", "actionType", "=", "$", "action", "->", "getActionType", "(", ")", ";", "$", "attribute", "=", "$", "goal", "[", "'match_attribute'", "]", ";", "// if...
Detects if an Action matches a given goal. If it does, the URL that triggered the goal is returned. Otherwise null is returned. @param array $goal @param Action $action @return if a goal is matched, a string of the Action URL is returned, or if no goal was matched it returns null
[ "Detects", "if", "an", "Action", "matches", "a", "given", "goal", ".", "If", "it", "does", "the", "URL", "that", "triggered", "the", "goal", "is", "returned", ".", "Otherwise", "null", "is", "returned", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/GoalManager.php#L151-L196
209,614
matomo-org/matomo
core/Tracker/GoalManager.php
GoalManager.recordGoals
public function recordGoals(VisitProperties $visitProperties, Request $request) { $visitorInformation = $visitProperties->getProperties(); $visitCustomVariables = $request->getMetadata('CustomVariables', 'visitCustomVariables') ?: array(); /** @var Action $action */ $action = $reque...
php
public function recordGoals(VisitProperties $visitProperties, Request $request) { $visitorInformation = $visitProperties->getProperties(); $visitCustomVariables = $request->getMetadata('CustomVariables', 'visitCustomVariables') ?: array(); /** @var Action $action */ $action = $reque...
[ "public", "function", "recordGoals", "(", "VisitProperties", "$", "visitProperties", ",", "Request", "$", "request", ")", "{", "$", "visitorInformation", "=", "$", "visitProperties", "->", "getProperties", "(", ")", ";", "$", "visitCustomVariables", "=", "$", "r...
Records one or several goals matched in this request. @param Visitor $visitor @param array $visitorInformation @param array $visitCustomVariables @param Action $action
[ "Records", "one", "or", "several", "goals", "matched", "in", "this", "request", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/GoalManager.php#L227-L262
209,615
matomo-org/matomo
core/Tracker/GoalManager.php
GoalManager.getEcommerceItemsFromRequest
private function getEcommerceItemsFromRequest(Request $request) { $items = $request->getParam('ec_items'); if (empty($items)) { Common::printDebug("There are no Ecommerce items in the request"); // we still record an Ecommerce order without any item in it return ...
php
private function getEcommerceItemsFromRequest(Request $request) { $items = $request->getParam('ec_items'); if (empty($items)) { Common::printDebug("There are no Ecommerce items in the request"); // we still record an Ecommerce order without any item in it return ...
[ "private", "function", "getEcommerceItemsFromRequest", "(", "Request", "$", "request", ")", "{", "$", "items", "=", "$", "request", "->", "getParam", "(", "'ec_items'", ")", ";", "if", "(", "empty", "(", "$", "items", ")", ")", "{", "Common", "::", "prin...
Returns Items read from the request string @return array|bool
[ "Returns", "Items", "read", "from", "the", "request", "string" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/GoalManager.php#L354-L373
209,616
matomo-org/matomo
core/Tracker/GoalManager.php
GoalManager.updateEcommerceItems
protected function updateEcommerceItems($goal, $itemsToUpdate) { if (empty($itemsToUpdate)) { return; } Common::printDebug("Goal data used to update ecommerce items:"); Common::printDebug($goal); foreach ($itemsToUpdate as $item) { $newRow = $this->g...
php
protected function updateEcommerceItems($goal, $itemsToUpdate) { if (empty($itemsToUpdate)) { return; } Common::printDebug("Goal data used to update ecommerce items:"); Common::printDebug($goal); foreach ($itemsToUpdate as $item) { $newRow = $this->g...
[ "protected", "function", "updateEcommerceItems", "(", "$", "goal", ",", "$", "itemsToUpdate", ")", "{", "if", "(", "empty", "(", "$", "itemsToUpdate", ")", ")", "{", "return", ";", "}", "Common", "::", "printDebug", "(", "\"Goal data used to update ecommerce ite...
Updates the cart items in the DB that have been modified since the last cart update @param array $goal @param array $itemsToUpdate @return void
[ "Updates", "the", "cart", "items", "in", "the", "DB", "that", "have", "been", "modified", "since", "the", "last", "cart", "update" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/GoalManager.php#L569-L584
209,617
matomo-org/matomo
core/Tracker/GoalManager.php
GoalManager.insertEcommerceItems
protected function insertEcommerceItems($goal, $itemsToInsert) { if (empty($itemsToInsert)) { return; } Common::printDebug("Ecommerce items that are added to the cart/order"); Common::printDebug($itemsToInsert); $items = array(); foreach ($itemsToInsert...
php
protected function insertEcommerceItems($goal, $itemsToInsert) { if (empty($itemsToInsert)) { return; } Common::printDebug("Ecommerce items that are added to the cart/order"); Common::printDebug($itemsToInsert); $items = array(); foreach ($itemsToInsert...
[ "protected", "function", "insertEcommerceItems", "(", "$", "goal", ",", "$", "itemsToInsert", ")", "{", "if", "(", "empty", "(", "$", "itemsToInsert", ")", ")", "{", "return", ";", "}", "Common", "::", "printDebug", "(", "\"Ecommerce items that are added to the ...
Inserts in the cart in the DB the new items that were not previously in the cart @param array $goal @param array $itemsToInsert @return void
[ "Inserts", "in", "the", "cart", "in", "the", "DB", "the", "new", "items", "that", "were", "not", "previously", "in", "the", "cart" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/GoalManager.php#L600-L616
209,618
matomo-org/matomo
core/Tracker/GoalManager.php
GoalManager.getItemRowCast
protected function getItemRowCast($row) { return array( (string)(int)$row[self::INTERNAL_ITEM_SKU], (string)(int)$row[self::INTERNAL_ITEM_NAME], (string)(int)$row[self::INTERNAL_ITEM_CATEGORY], (string)(int)$row[self::INTERNAL_ITEM_CATEGORY2], (str...
php
protected function getItemRowCast($row) { return array( (string)(int)$row[self::INTERNAL_ITEM_SKU], (string)(int)$row[self::INTERNAL_ITEM_NAME], (string)(int)$row[self::INTERNAL_ITEM_CATEGORY], (string)(int)$row[self::INTERNAL_ITEM_CATEGORY2], (str...
[ "protected", "function", "getItemRowCast", "(", "$", "row", ")", "{", "return", "array", "(", "(", "string", ")", "(", "int", ")", "$", "row", "[", "self", "::", "INTERNAL_ITEM_SKU", "]", ",", "(", "string", ")", "(", "int", ")", "$", "row", "[", "...
Casts the item array so that array comparisons work nicely @param array $row @return array
[ "Casts", "the", "item", "array", "so", "that", "array", "comparisons", "work", "nicely" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/GoalManager.php#L763-L776
209,619
matomo-org/matomo
core/Tracker/GoalManager.php
GoalManager.formatRegex
public static function formatRegex($pattern) { if (strpos($pattern, '/') !== false && strpos($pattern, '\\/') === false ) { $pattern = str_replace('/', '\\/', $pattern); } return '/' . $pattern . '/'; }
php
public static function formatRegex($pattern) { if (strpos($pattern, '/') !== false && strpos($pattern, '\\/') === false ) { $pattern = str_replace('/', '\\/', $pattern); } return '/' . $pattern . '/'; }
[ "public", "static", "function", "formatRegex", "(", "$", "pattern", ")", "{", "if", "(", "strpos", "(", "$", "pattern", ",", "'/'", ")", "!==", "false", "&&", "strpos", "(", "$", "pattern", ",", "'\\\\/'", ")", "===", "false", ")", "{", "$", "pattern...
Formats a goal regex pattern to a usable regex @param string $pattern @return string
[ "Formats", "a", "goal", "regex", "pattern", "to", "a", "usable", "regex" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/GoalManager.php#L900-L908
209,620
matomo-org/matomo
core/API/DataTablePostProcessor.php
DataTablePostProcessor.process
public function process(DataTableInterface $dataTable) { // TODO: when calculating metrics before hand, only calculate for needed metrics, not all. NOTE: // this is non-trivial since it will require, eg, to make sure processed metrics aren't added // after pivotBy is handled. ...
php
public function process(DataTableInterface $dataTable) { // TODO: when calculating metrics before hand, only calculate for needed metrics, not all. NOTE: // this is non-trivial since it will require, eg, to make sure processed metrics aren't added // after pivotBy is handled. ...
[ "public", "function", "process", "(", "DataTableInterface", "$", "dataTable", ")", "{", "// TODO: when calculating metrics before hand, only calculate for needed metrics, not all. NOTE:", "// this is non-trivial since it will require, eg, to make sure processed metrics aren't added", "//...
Apply post-processing logic to a DataTable of a report for an API request. @param DataTableInterface $dataTable The data table to process. @return DataTableInterface A new data table.
[ "Apply", "post", "-", "processing", "logic", "to", "a", "DataTable", "of", "a", "report", "for", "an", "API", "request", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/DataTablePostProcessor.php#L106-L134
209,621
matomo-org/matomo
plugins/CoreConsole/Commands/CoreArchiver.php
CoreArchiver.makeArchiver
public static function makeArchiver($url, InputInterface $input) { $archiver = new CronArchive(); $archiver->disableScheduledTasks = $input->getOption('disable-scheduled-tasks'); $archiver->acceptInvalidSSLCertificate = $input->getOption("accept-invalid-ssl-certificate"); $archiver-...
php
public static function makeArchiver($url, InputInterface $input) { $archiver = new CronArchive(); $archiver->disableScheduledTasks = $input->getOption('disable-scheduled-tasks'); $archiver->acceptInvalidSSLCertificate = $input->getOption("accept-invalid-ssl-certificate"); $archiver-...
[ "public", "static", "function", "makeArchiver", "(", "$", "url", ",", "InputInterface", "$", "input", ")", "{", "$", "archiver", "=", "new", "CronArchive", "(", ")", ";", "$", "archiver", "->", "disableScheduledTasks", "=", "$", "input", "->", "getOption", ...
also used by another console command
[ "also", "used", "by", "another", "console", "command" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreConsole/Commands/CoreArchiver.php#L31-L64
209,622
matomo-org/matomo
core/ViewDataTable/Manager.php
Manager.getIdsWithInheritance
public static function getIdsWithInheritance($klass) { $klasses = Common::getClassLineage($klass); $result = array(); foreach ($klasses as $klass) { try { $result[] = $klass::getViewDataTableId(); } catch (\Exception $e) { // in case $...
php
public static function getIdsWithInheritance($klass) { $klasses = Common::getClassLineage($klass); $result = array(); foreach ($klasses as $klass) { try { $result[] = $klass::getViewDataTableId(); } catch (\Exception $e) { // in case $...
[ "public", "static", "function", "getIdsWithInheritance", "(", "$", "klass", ")", "{", "$", "klasses", "=", "Common", "::", "getClassLineage", "(", "$", "klass", ")", ";", "$", "result", "=", "array", "(", ")", ";", "foreach", "(", "$", "klasses", "as", ...
Returns the viewDataTable IDs of a visualization's class lineage. @see self::getVisualizationClassLineage @param string $klass The visualization class. @return array
[ "Returns", "the", "viewDataTable", "IDs", "of", "a", "visualization", "s", "class", "lineage", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Manager.php#L40-L55
209,623
matomo-org/matomo
core/ViewDataTable/Manager.php
Manager.getAvailableViewDataTables
public static function getAvailableViewDataTables() { $cache = Cache::getTransientCache(); $cacheId = 'ViewDataTable.getAvailableViewDataTables'; $dataTables = $cache->fetch($cacheId); if (!empty($dataTables)) { return $dataTables; } $klassToExtend = '\\...
php
public static function getAvailableViewDataTables() { $cache = Cache::getTransientCache(); $cacheId = 'ViewDataTable.getAvailableViewDataTables'; $dataTables = $cache->fetch($cacheId); if (!empty($dataTables)) { return $dataTables; } $klassToExtend = '\\...
[ "public", "static", "function", "getAvailableViewDataTables", "(", ")", "{", "$", "cache", "=", "Cache", "::", "getTransientCache", "(", ")", ";", "$", "cacheId", "=", "'ViewDataTable.getAvailableViewDataTables'", ";", "$", "dataTables", "=", "$", "cache", "->", ...
Returns all registered visualization classes. Uses the 'Visualization.getAvailable' event to retrieve visualizations. @return array Array mapping visualization IDs with their associated visualization classes. @throws \Exception If a visualization class does not exist or if a duplicate visualization ID is found. @retur...
[ "Returns", "all", "registered", "visualization", "classes", ".", "Uses", "the", "Visualization", ".", "getAvailable", "event", "to", "retrieve", "visualizations", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Manager.php#L66-L122
209,624
matomo-org/matomo
core/ViewDataTable/Manager.php
Manager.getNonCoreViewDataTables
public static function getNonCoreViewDataTables() { $result = array(); foreach (static::getAvailableViewDataTables() as $vizId => $vizClass) { if (false === strpos($vizClass, 'Piwik\\Plugins\\CoreVisualizations') && false === strpos($vizClass, 'Piwik\\Plugins\\Goals\\Vis...
php
public static function getNonCoreViewDataTables() { $result = array(); foreach (static::getAvailableViewDataTables() as $vizId => $vizClass) { if (false === strpos($vizClass, 'Piwik\\Plugins\\CoreVisualizations') && false === strpos($vizClass, 'Piwik\\Plugins\\Goals\\Vis...
[ "public", "static", "function", "getNonCoreViewDataTables", "(", ")", "{", "$", "result", "=", "array", "(", ")", ";", "foreach", "(", "static", "::", "getAvailableViewDataTables", "(", ")", "as", "$", "vizId", "=>", "$", "vizClass", ")", "{", "if", "(", ...
Returns all available visualizations that are not part of the CoreVisualizations plugin. @return array Array mapping visualization IDs with their associated visualization classes.
[ "Returns", "all", "available", "visualizations", "that", "are", "not", "part", "of", "the", "CoreVisualizations", "plugin", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Manager.php#L129-L141
209,625
matomo-org/matomo
core/ViewDataTable/Manager.php
Manager.configureFooterIcons
public static function configureFooterIcons(ViewDataTable $view) { $result = array(); $normalViewIcons = self::getNormalViewIcons($view); if (!empty($normalViewIcons['buttons'])) { $result[] = $normalViewIcons; } // add insight views $insightsViewIcons ...
php
public static function configureFooterIcons(ViewDataTable $view) { $result = array(); $normalViewIcons = self::getNormalViewIcons($view); if (!empty($normalViewIcons['buttons'])) { $result[] = $normalViewIcons; } // add insight views $insightsViewIcons ...
[ "public", "static", "function", "configureFooterIcons", "(", "ViewDataTable", "$", "view", ")", "{", "$", "result", "=", "array", "(", ")", ";", "$", "normalViewIcons", "=", "self", "::", "getNormalViewIcons", "(", "$", "view", ")", ";", "if", "(", "!", ...
This method determines the default set of footer icons to display below a report. $result has the following format: ``` array( array( // footer icon group 1 'class' => 'footerIconGroup1CssClass', 'buttons' => array( 'id' => 'myid', 'title' => 'My Tooltip', 'icon' => 'path/to/my/icon.png' ) ), array( // footer icon gr...
[ "This", "method", "determines", "the", "default", "set", "of", "footer", "icons", "to", "display", "below", "a", "report", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Manager.php#L166-L210
209,626
matomo-org/matomo
core/ViewDataTable/Manager.php
Manager.getFooterIconFor
private static function getFooterIconFor($viewDataTableId) { $tables = static::getAvailableViewDataTables(); if (!array_key_exists($viewDataTableId, $tables)) { return; } $klass = $tables[$viewDataTableId]; return array( 'id' => $klass::getViewDa...
php
private static function getFooterIconFor($viewDataTableId) { $tables = static::getAvailableViewDataTables(); if (!array_key_exists($viewDataTableId, $tables)) { return; } $klass = $tables[$viewDataTableId]; return array( 'id' => $klass::getViewDa...
[ "private", "static", "function", "getFooterIconFor", "(", "$", "viewDataTableId", ")", "{", "$", "tables", "=", "static", "::", "getAvailableViewDataTables", "(", ")", ";", "if", "(", "!", "array_key_exists", "(", "$", "viewDataTableId", ",", "$", "tables", ")...
Returns an array with information necessary for adding the viewDataTable to the footer. @param string $viewDataTableId @return array
[ "Returns", "an", "array", "with", "information", "necessary", "for", "adding", "the", "viewDataTable", "to", "the", "footer", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Manager.php#L219-L234
209,627
matomo-org/matomo
plugins/SegmentEditor/SegmentEditor.php
SegmentEditor.getKnownSegmentsToArchiveForSite
public function getKnownSegmentsToArchiveForSite(&$segments, $idSite) { $model = new Model(); $segmentToAutoArchive = $model->getSegmentsToAutoArchive($idSite); foreach ($segmentToAutoArchive as $segmentInfo) { $segments[] = $segmentInfo['definition']; } $segmen...
php
public function getKnownSegmentsToArchiveForSite(&$segments, $idSite) { $model = new Model(); $segmentToAutoArchive = $model->getSegmentsToAutoArchive($idSite); foreach ($segmentToAutoArchive as $segmentInfo) { $segments[] = $segmentInfo['definition']; } $segmen...
[ "public", "function", "getKnownSegmentsToArchiveForSite", "(", "&", "$", "segments", ",", "$", "idSite", ")", "{", "$", "model", "=", "new", "Model", "(", ")", ";", "$", "segmentToAutoArchive", "=", "$", "model", "->", "getSegmentsToAutoArchive", "(", "$", "...
Adds the pre-processed segments to the list of Segments. Used by CronArchive, ArchiveProcessor\Rules, etc. @param $segments @param $idSite
[ "Adds", "the", "pre", "-", "processed", "segments", "to", "the", "list", "of", "Segments", ".", "Used", "by", "CronArchive", "ArchiveProcessor", "\\", "Rules", "etc", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SegmentEditor/SegmentEditor.php#L79-L89
209,628
matomo-org/matomo
plugins/DBStats/Reports/Base.php
Base.setIndividualSummaryFooterMessage
protected function setIndividualSummaryFooterMessage(ViewDataTable $view) { $lastGenerated = self::getDateOfLastCachingRun(); if ($lastGenerated !== false) { $view->config->show_footer_message = Piwik::translate('Mobile_LastUpdated', $lastGenerated); } }
php
protected function setIndividualSummaryFooterMessage(ViewDataTable $view) { $lastGenerated = self::getDateOfLastCachingRun(); if ($lastGenerated !== false) { $view->config->show_footer_message = Piwik::translate('Mobile_LastUpdated', $lastGenerated); } }
[ "protected", "function", "setIndividualSummaryFooterMessage", "(", "ViewDataTable", "$", "view", ")", "{", "$", "lastGenerated", "=", "self", "::", "getDateOfLastCachingRun", "(", ")", ";", "if", "(", "$", "lastGenerated", "!==", "false", ")", "{", "$", "view", ...
Sets the footer message for the Individual...Summary reports.
[ "Sets", "the", "footer", "message", "for", "the", "Individual", "...", "Summary", "reports", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/Reports/Base.php#L147-L153
209,629
matomo-org/matomo
core/ProxyHeaders.php
ProxyHeaders.getProtocolInformation
public static function getProtocolInformation() { if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { return 'SERVER_PORT=443'; } if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { return ...
php
public static function getProtocolInformation() { if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { return 'SERVER_PORT=443'; } if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { return ...
[ "public", "static", "function", "getProtocolInformation", "(", ")", "{", "if", "(", "isset", "(", "$", "_SERVER", "[", "'SERVER_PORT'", "]", ")", "&&", "$", "_SERVER", "[", "'SERVER_PORT'", "]", "==", "443", ")", "{", "return", "'SERVER_PORT=443'", ";", "}...
Get protocol information, with the exception of HTTPS @return string protocol information
[ "Get", "protocol", "information", "with", "the", "exception", "of", "HTTPS" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ProxyHeaders.php#L22-L41
209,630
matomo-org/matomo
core/ProxyHeaders.php
ProxyHeaders.getHeaders
private static function getHeaders($recognizedHeaders) { $headers = array(); foreach ($recognizedHeaders as $header) { if (isset($_SERVER[$header])) { $headers[] = $header; } } return $headers; }
php
private static function getHeaders($recognizedHeaders) { $headers = array(); foreach ($recognizedHeaders as $header) { if (isset($_SERVER[$header])) { $headers[] = $header; } } return $headers; }
[ "private", "static", "function", "getHeaders", "(", "$", "recognizedHeaders", ")", "{", "$", "headers", "=", "array", "(", ")", ";", "foreach", "(", "$", "recognizedHeaders", "as", "$", "header", ")", "{", "if", "(", "isset", "(", "$", "_SERVER", "[", ...
Get headers present in the HTTP request @param array $recognizedHeaders @return array HTTP headers
[ "Get", "headers", "present", "in", "the", "HTTP", "request" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ProxyHeaders.php#L49-L60
209,631
matomo-org/matomo
plugins/Referrers/API.php
API.getReferrerType
public function getReferrerType($idSite, $period, $date, $segment = false, $typeReferrer = false, $idSubtable = false, $expanded = false) { Piwik::checkUserHasViewAccess($idSite); $this->checkSingleSite($idSite, 'getReferrerType'); // if idSubtable is su...
php
public function getReferrerType($idSite, $period, $date, $segment = false, $typeReferrer = false, $idSubtable = false, $expanded = false) { Piwik::checkUserHasViewAccess($idSite); $this->checkSingleSite($idSite, 'getReferrerType'); // if idSubtable is su...
[ "public", "function", "getReferrerType", "(", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", "=", "false", ",", "$", "typeReferrer", "=", "false", ",", "$", "idSubtable", "=", "false", ",", "$", "expanded", "=", "false", ")",...
Returns a report describing visit information for each possible referrer type. The result is a datatable whose subtables are the reports for each parent row's referrer type. The subtable reports are: 'getKeywords' (for search engine referrer type), 'getWebsites', and 'getCampaigns'. @param string $idSite The site ID....
[ "Returns", "a", "report", "describing", "visit", "information", "for", "each", "possible", "referrer", "type", ".", "The", "result", "is", "a", "datatable", "whose", "subtables", "are", "the", "reports", "for", "each", "parent", "row", "s", "referrer", "type",...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/API.php#L67-L127
209,632
matomo-org/matomo
plugins/Referrers/API.php
API.getAll
public function getAll($idSite, $period, $date, $segment = false) { Piwik::checkUserHasViewAccess($idSite); $this->checkSingleSite($idSite, 'getAll'); $dataTable = $this->getReferrerType($idSite, $period, $date, $segment, $typeReferrer = false, $idSubtable = false, $expanded = true); ...
php
public function getAll($idSite, $period, $date, $segment = false) { Piwik::checkUserHasViewAccess($idSite); $this->checkSingleSite($idSite, 'getAll'); $dataTable = $this->getReferrerType($idSite, $period, $date, $segment, $typeReferrer = false, $idSubtable = false, $expanded = true); ...
[ "public", "function", "getAll", "(", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", "=", "false", ")", "{", "Piwik", "::", "checkUserHasViewAccess", "(", "$", "idSite", ")", ";", "$", "this", "->", "checkSingleSite", "(", "$"...
Returns a report that shows
[ "Returns", "a", "report", "that", "shows" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/API.php#L141-L157
209,633
matomo-org/matomo
plugins/Referrers/API.php
API.getUrlsForSocial
public function getUrlsForSocial($idSite, $period, $date, $segment = false, $idSubtable = false) { Piwik::checkUserHasViewAccess($idSite); $dataTable = $this->getDataTable(Archiver::SOCIAL_NETWORKS_RECORD_NAME, $idSite, $period, $date, $segment, $expanded = true, $idSubtable); if (!$idSubt...
php
public function getUrlsForSocial($idSite, $period, $date, $segment = false, $idSubtable = false) { Piwik::checkUserHasViewAccess($idSite); $dataTable = $this->getDataTable(Archiver::SOCIAL_NETWORKS_RECORD_NAME, $idSite, $period, $date, $segment, $expanded = true, $idSubtable); if (!$idSubt...
[ "public", "function", "getUrlsForSocial", "(", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", "=", "false", ",", "$", "idSubtable", "=", "false", ")", "{", "Piwik", "::", "checkUserHasViewAccess", "(", "$", "idSite", ")", ";", ...
Returns report containing individual referrer URLs for a specific social networking site. @param string $idSite @param string $period @param string $date @param bool|string $segment @param bool|int $idSubtable This ID does not reference a real DataTable record. Instead, it is the array index of an item in the Socials ...
[ "Returns", "report", "containing", "individual", "referrer", "URLs", "for", "a", "specific", "social", "networking", "site", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/API.php#L464-L497
209,634
matomo-org/matomo
plugins/Referrers/API.php
API.removeSubtableMetadata
private function removeSubtableMetadata($dataTable) { if ($dataTable instanceof DataTable\Map) { foreach ($dataTable->getDataTables() as $childTable) { $this->removeSubtableMetadata($childTable); } } else { foreach ($dataTable->getRows() as $row) {...
php
private function removeSubtableMetadata($dataTable) { if ($dataTable instanceof DataTable\Map) { foreach ($dataTable->getDataTables() as $childTable) { $this->removeSubtableMetadata($childTable); } } else { foreach ($dataTable->getRows() as $row) {...
[ "private", "function", "removeSubtableMetadata", "(", "$", "dataTable", ")", "{", "if", "(", "$", "dataTable", "instanceof", "DataTable", "\\", "Map", ")", "{", "foreach", "(", "$", "dataTable", "->", "getDataTables", "(", ")", "as", "$", "childTable", ")", ...
Removes idsubdatatable_in_db metadata from a DataTable. Used by Social tables since they use fake subtable IDs. @param DataTable $dataTable
[ "Removes", "idsubdatatable_in_db", "metadata", "from", "a", "DataTable", ".", "Used", "by", "Social", "tables", "since", "they", "use", "fake", "subtable", "IDs", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/API.php#L542-L553
209,635
matomo-org/matomo
plugins/Referrers/API.php
API.setSocialIdSubtables
private function setSocialIdSubtables($dataTable) { if ($dataTable instanceof DataTable\Map) { foreach ($dataTable->getDataTables() as $childTable) { $this->setSocialIdSubtables($childTable); } } else { foreach ($dataTable->getRows() as $row) { ...
php
private function setSocialIdSubtables($dataTable) { if ($dataTable instanceof DataTable\Map) { foreach ($dataTable->getDataTables() as $childTable) { $this->setSocialIdSubtables($childTable); } } else { foreach ($dataTable->getRows() as $row) { ...
[ "private", "function", "setSocialIdSubtables", "(", "$", "dataTable", ")", "{", "if", "(", "$", "dataTable", "instanceof", "DataTable", "\\", "Map", ")", "{", "foreach", "(", "$", "dataTable", "->", "getDataTables", "(", ")", "as", "$", "childTable", ")", ...
Sets the subtable IDs for the DataTable returned by getSocial. The IDs are int indexes into the array in of defined socials. @param DataTable $dataTable
[ "Sets", "the", "subtable", "IDs", "for", "the", "DataTable", "returned", "by", "getSocial", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/API.php#L562-L583
209,636
matomo-org/matomo
libs/Zend/Db.php
Zend_Db.factory
public static function factory($adapter, $config = array()) { if ($config instanceof Zend_Config) { $config = $config->toArray(); } /* * Convert Zend_Config argument to plain string * adapter name and separate config object. */ if ($adapter ins...
php
public static function factory($adapter, $config = array()) { if ($config instanceof Zend_Config) { $config = $config->toArray(); } /* * Convert Zend_Config argument to plain string * adapter name and separate config object. */ if ($adapter ins...
[ "public", "static", "function", "factory", "(", "$", "adapter", ",", "$", "config", "=", "array", "(", ")", ")", "{", "if", "(", "$", "config", "instanceof", "Zend_Config", ")", "{", "$", "config", "=", "$", "config", "->", "toArray", "(", ")", ";", ...
Factory for Zend_Db_Adapter_Abstract classes. First argument may be a string containing the base of the adapter class name, e.g. 'Mysqli' corresponds to class Zend_Db_Adapter_Mysqli. This name is currently case-insensitive, but is not ideal to rely on this behavior. If your class is named 'My_Company_Pdo_Mysql', wher...
[ "Factory", "for", "Zend_Db_Adapter_Abstract", "classes", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db.php#L199-L284
209,637
matomo-org/matomo
plugins/Referrers/SearchEngine.php
SearchEngine.getDefinitions
public function getDefinitions() { $cache = Cache::getEagerCache(); $cacheId = 'SearchEngine-' . self::OPTION_STORAGE_NAME; if ($cache->contains($cacheId)) { $list = $cache->fetch($cacheId); } else { $list = $this->loadDefinitions(); $cache->sav...
php
public function getDefinitions() { $cache = Cache::getEagerCache(); $cacheId = 'SearchEngine-' . self::OPTION_STORAGE_NAME; if ($cache->contains($cacheId)) { $list = $cache->fetch($cacheId); } else { $list = $this->loadDefinitions(); $cache->sav...
[ "public", "function", "getDefinitions", "(", ")", "{", "$", "cache", "=", "Cache", "::", "getEagerCache", "(", ")", ";", "$", "cacheId", "=", "'SearchEngine-'", ".", "self", "::", "OPTION_STORAGE_NAME", ";", "if", "(", "$", "cache", "->", "contains", "(", ...
Returns list of search engines by URL @return array Array of ( URL => array( searchEngineName, keywordParameter, path, charset ) )
[ "Returns", "list", "of", "search", "engines", "by", "URL" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/SearchEngine.php#L35-L48
209,638
matomo-org/matomo
plugins/Referrers/SearchEngine.php
SearchEngine.getNames
public function getNames() { $cacheId = 'SearchEngine.getSearchEngineNames'; $cache = Cache::getTransientCache(); $nameToUrl = $cache->fetch($cacheId); if (empty($nameToUrl)) { $searchEngines = $this->getDefinitions(); $nameToUrl = array(); ...
php
public function getNames() { $cacheId = 'SearchEngine.getSearchEngineNames'; $cache = Cache::getTransientCache(); $nameToUrl = $cache->fetch($cacheId); if (empty($nameToUrl)) { $searchEngines = $this->getDefinitions(); $nameToUrl = array(); ...
[ "public", "function", "getNames", "(", ")", "{", "$", "cacheId", "=", "'SearchEngine.getSearchEngineNames'", ";", "$", "cache", "=", "Cache", "::", "getTransientCache", "(", ")", ";", "$", "nameToUrl", "=", "$", "cache", "->", "fetch", "(", "$", "cacheId", ...
Returns list of search engines by name @return array Array of ( searchEngineName => URL )
[ "Returns", "list", "of", "search", "engines", "by", "name" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/SearchEngine.php#L133-L152
209,639
matomo-org/matomo
plugins/Referrers/SearchEngine.php
SearchEngine.getDefinitionByHost
public function getDefinitionByHost($host) { $searchEngines = $this->getDefinitions(); if (!array_key_exists($host, $searchEngines)) { return array(); } return $searchEngines[$host]; }
php
public function getDefinitionByHost($host) { $searchEngines = $this->getDefinitions(); if (!array_key_exists($host, $searchEngines)) { return array(); } return $searchEngines[$host]; }
[ "public", "function", "getDefinitionByHost", "(", "$", "host", ")", "{", "$", "searchEngines", "=", "$", "this", "->", "getDefinitions", "(", ")", ";", "if", "(", "!", "array_key_exists", "(", "$", "host", ",", "$", "searchEngines", ")", ")", "{", "retur...
Returns definitions for the given search engine host @param string $host @return array
[ "Returns", "definitions", "for", "the", "given", "search", "engine", "host" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/SearchEngine.php#L160-L169
209,640
matomo-org/matomo
plugins/Referrers/SearchEngine.php
SearchEngine.convertCharset
protected function convertCharset($string, $charsets) { if (function_exists('iconv') && !empty($charsets) ) { $charset = $charsets[0]; if (count($charsets) > 1 && function_exists('mb_detect_encoding') ) { $charset = mb_d...
php
protected function convertCharset($string, $charsets) { if (function_exists('iconv') && !empty($charsets) ) { $charset = $charsets[0]; if (count($charsets) > 1 && function_exists('mb_detect_encoding') ) { $charset = mb_d...
[ "protected", "function", "convertCharset", "(", "$", "string", ",", "$", "charsets", ")", "{", "if", "(", "function_exists", "(", "'iconv'", ")", "&&", "!", "empty", "(", "$", "charsets", ")", ")", "{", "$", "charset", "=", "$", "charsets", "[", "0", ...
Tries to convert the given string from one of the given charsets to UTF-8 @param string $string @param array $charsets @return string
[ "Tries", "to", "convert", "the", "given", "string", "from", "one", "of", "the", "given", "charsets", "to", "UTF", "-", "8" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/SearchEngine.php#L397-L419
209,641
matomo-org/matomo
plugins/Referrers/SearchEngine.php
SearchEngine.getUrlFromName
public function getUrlFromName($name) { $searchEngineNames = $this->getNames(); if (isset($searchEngineNames[$name])) { $url = 'http://' . $searchEngineNames[$name]; } else { $url = 'URL unknown!'; } return $url; }
php
public function getUrlFromName($name) { $searchEngineNames = $this->getNames(); if (isset($searchEngineNames[$name])) { $url = 'http://' . $searchEngineNames[$name]; } else { $url = 'URL unknown!'; } return $url; }
[ "public", "function", "getUrlFromName", "(", "$", "name", ")", "{", "$", "searchEngineNames", "=", "$", "this", "->", "getNames", "(", ")", ";", "if", "(", "isset", "(", "$", "searchEngineNames", "[", "$", "name", "]", ")", ")", "{", "$", "url", "=",...
Return search engine URL by name @see core/DataFiles/SearchEnginges.php @param string $name @return string URL
[ "Return", "search", "engine", "URL", "by", "name" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/SearchEngine.php#L429-L438
209,642
matomo-org/matomo
plugins/Referrers/SearchEngine.php
SearchEngine.getHostFromUrl
private function getHostFromUrl($url) { if (strpos($url, '//')) { $url = substr($url, strpos($url, '//') + 2); } if (($p = strpos($url, '/')) !== false) { $url = substr($url, 0, $p); } return $url; }
php
private function getHostFromUrl($url) { if (strpos($url, '//')) { $url = substr($url, strpos($url, '//') + 2); } if (($p = strpos($url, '/')) !== false) { $url = substr($url, 0, $p); } return $url; }
[ "private", "function", "getHostFromUrl", "(", "$", "url", ")", "{", "if", "(", "strpos", "(", "$", "url", ",", "'//'", ")", ")", "{", "$", "url", "=", "substr", "(", "$", "url", ",", "strpos", "(", "$", "url", ",", "'//'", ")", "+", "2", ")", ...
Return search engine host in URL @param string $url @return string host
[ "Return", "search", "engine", "host", "in", "URL" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/SearchEngine.php#L446-L455
209,643
matomo-org/matomo
plugins/Referrers/SearchEngine.php
SearchEngine.getLogoFromUrl
public function getLogoFromUrl($url) { $pathInPiwik = 'plugins/Morpheus/icons/dist/searchEngines/%s.png'; $pathWithCode = sprintf($pathInPiwik, $this->getHostFromUrl($url)); $absolutePath = PIWIK_INCLUDE_PATH . '/' . $pathWithCode; if (file_exists($absolutePath)) { retur...
php
public function getLogoFromUrl($url) { $pathInPiwik = 'plugins/Morpheus/icons/dist/searchEngines/%s.png'; $pathWithCode = sprintf($pathInPiwik, $this->getHostFromUrl($url)); $absolutePath = PIWIK_INCLUDE_PATH . '/' . $pathWithCode; if (file_exists($absolutePath)) { retur...
[ "public", "function", "getLogoFromUrl", "(", "$", "url", ")", "{", "$", "pathInPiwik", "=", "'plugins/Morpheus/icons/dist/searchEngines/%s.png'", ";", "$", "pathWithCode", "=", "sprintf", "(", "$", "pathInPiwik", ",", "$", "this", "->", "getHostFromUrl", "(", "$",...
Return search engine logo path by URL @param string $url @return string path @see plugins/Morpheus/icons/dist/searchEnginges/
[ "Return", "search", "engine", "logo", "path", "by", "URL" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/SearchEngine.php#L465-L474
209,644
matomo-org/matomo
plugins/Referrers/SearchEngine.php
SearchEngine.getBackLinkFromUrlAndKeyword
public function getBackLinkFromUrlAndKeyword($url, $keyword) { if ($keyword === API::LABEL_KEYWORD_NOT_DEFINED) { return 'https://matomo.org/faq/general/#faq_144'; } $keyword = urlencode($keyword); $keyword = str_replace(urlencode('+'), urlencode(' '), $keyword); ...
php
public function getBackLinkFromUrlAndKeyword($url, $keyword) { if ($keyword === API::LABEL_KEYWORD_NOT_DEFINED) { return 'https://matomo.org/faq/general/#faq_144'; } $keyword = urlencode($keyword); $keyword = str_replace(urlencode('+'), urlencode(' '), $keyword); ...
[ "public", "function", "getBackLinkFromUrlAndKeyword", "(", "$", "url", ",", "$", "keyword", ")", "{", "if", "(", "$", "keyword", "===", "API", "::", "LABEL_KEYWORD_NOT_DEFINED", ")", "{", "return", "'https://matomo.org/faq/general/#faq_144'", ";", "}", "$", "keywo...
Return search engine URL for URL and keyword @see core/DataFiles/SearchEnginges.php @param string $url Domain name, e.g., search.piwik.org @param string $keyword Keyword, e.g., web+analytics @return string URL, e.g., http://search.piwik.org/q=web+analytics
[ "Return", "search", "engine", "URL", "for", "URL", "and", "keyword" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/SearchEngine.php#L485-L499
209,645
matomo-org/matomo
libs/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php
Zend_Mail_Protocol_Smtp_Auth_Crammd5._hmacMd5
protected function _hmacMd5($key, $data, $block = 64) { if (strlen($key) > 64) { $key = pack('H32', md5($key)); } elseif (strlen($key) < 64) { $key = str_pad($key, $block, "\0"); } $k_ipad = substr($key, 0, 64) ^ str_repeat(chr(0x36), 64); $k_opad = s...
php
protected function _hmacMd5($key, $data, $block = 64) { if (strlen($key) > 64) { $key = pack('H32', md5($key)); } elseif (strlen($key) < 64) { $key = str_pad($key, $block, "\0"); } $k_ipad = substr($key, 0, 64) ^ str_repeat(chr(0x36), 64); $k_opad = s...
[ "protected", "function", "_hmacMd5", "(", "$", "key", ",", "$", "data", ",", "$", "block", "=", "64", ")", "{", "if", "(", "strlen", "(", "$", "key", ")", ">", "64", ")", "{", "$", "key", "=", "pack", "(", "'H32'", ",", "md5", "(", "$", "key"...
Prepare CRAM-MD5 response to server's ticket @param string $key Challenge key (usually password) @param string $data Challenge data @param string $block Length of blocks @return string
[ "Prepare", "CRAM", "-", "MD5", "response", "to", "server", "s", "ticket" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php#L92-L107
209,646
matomo-org/matomo
plugins/Login/Login.php
Login.noAccess
public function noAccess(Exception $exception) { $frontController = FrontController::getInstance(); if (Common::isXmlHttpRequest()) { echo $frontController->dispatch(Piwik::getLoginPluginName(), 'ajaxNoAccess', array($exception->getMessage())); return; } ech...
php
public function noAccess(Exception $exception) { $frontController = FrontController::getInstance(); if (Common::isXmlHttpRequest()) { echo $frontController->dispatch(Piwik::getLoginPluginName(), 'ajaxNoAccess', array($exception->getMessage())); return; } ech...
[ "public", "function", "noAccess", "(", "Exception", "$", "exception", ")", "{", "$", "frontController", "=", "FrontController", "::", "getInstance", "(", ")", ";", "if", "(", "Common", "::", "isXmlHttpRequest", "(", ")", ")", "{", "echo", "$", "frontControll...
Redirects to Login form with error message. Listens to User.isNotAuthorized hook.
[ "Redirects", "to", "Login", "form", "with", "error", "message", ".", "Listens", "to", "User", ".", "isNotAuthorized", "hook", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Login.php#L159-L169
209,647
matomo-org/matomo
plugins/Login/Login.php
Login.ApiRequestAuthenticate
public function ApiRequestAuthenticate($tokenAuth) { $this->beforeLoginCheckBruteForce(); /** @var \Piwik\Auth $auth */ $auth = StaticContainer::get('Piwik\Auth'); $auth->setLogin($login = null); $auth->setTokenAuth($tokenAuth); }
php
public function ApiRequestAuthenticate($tokenAuth) { $this->beforeLoginCheckBruteForce(); /** @var \Piwik\Auth $auth */ $auth = StaticContainer::get('Piwik\Auth'); $auth->setLogin($login = null); $auth->setTokenAuth($tokenAuth); }
[ "public", "function", "ApiRequestAuthenticate", "(", "$", "tokenAuth", ")", "{", "$", "this", "->", "beforeLoginCheckBruteForce", "(", ")", ";", "/** @var \\Piwik\\Auth $auth */", "$", "auth", "=", "StaticContainer", "::", "get", "(", "'Piwik\\Auth'", ")", ";", "$...
Set login name and authentication token for API request. Listens to API.Request.authenticate hook.
[ "Set", "login", "name", "and", "authentication", "token", "for", "API", "request", ".", "Listens", "to", "API", ".", "Request", ".", "authenticate", "hook", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Login.php#L175-L183
209,648
matomo-org/matomo
plugins/SegmentEditor/Model.php
Model.getAllSegmentsAndIgnoreVisibility
public function getAllSegmentsAndIgnoreVisibility() { $sql = "SELECT * FROM " . $this->getTable() . " WHERE deleted = 0"; $segments = $this->getDb()->fetchAll($sql); return $segments; }
php
public function getAllSegmentsAndIgnoreVisibility() { $sql = "SELECT * FROM " . $this->getTable() . " WHERE deleted = 0"; $segments = $this->getDb()->fetchAll($sql); return $segments; }
[ "public", "function", "getAllSegmentsAndIgnoreVisibility", "(", ")", "{", "$", "sql", "=", "\"SELECT * FROM \"", ".", "$", "this", "->", "getTable", "(", ")", ".", "\" WHERE deleted = 0\"", ";", "$", "segments", "=", "$", "this", "->", "getDb", "(", ")", "->...
Returns all stored segments that haven't been deleted. Ignores the site the segments are enabled for and whether to auto archive or not. @return array
[ "Returns", "all", "stored", "segments", "that", "haven", "t", "been", "deleted", ".", "Ignores", "the", "site", "the", "segments", "are", "enabled", "for", "and", "whether", "to", "auto", "archive", "or", "not", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SegmentEditor/Model.php#L33-L40
209,649
matomo-org/matomo
plugins/SegmentEditor/Model.php
Model.getAllSegments
public function getAllSegments($userLogin) { $bind = array($userLogin); $sql = $this->buildQuerySortedByName('deleted = 0 AND (enable_all_users = 1 OR login = ?)'); $segments = $this->getDb()->fetchAll($sql, $bind); return $segments; }
php
public function getAllSegments($userLogin) { $bind = array($userLogin); $sql = $this->buildQuerySortedByName('deleted = 0 AND (enable_all_users = 1 OR login = ?)'); $segments = $this->getDb()->fetchAll($sql, $bind); return $segments; }
[ "public", "function", "getAllSegments", "(", "$", "userLogin", ")", "{", "$", "bind", "=", "array", "(", "$", "userLogin", ")", ";", "$", "sql", "=", "$", "this", "->", "buildQuerySortedByName", "(", "'deleted = 0 AND (enable_all_users = 1 OR login = ?)'", ")", ...
Returns all stored segments that are available to the given login. @param string $userLogin @return array
[ "Returns", "all", "stored", "segments", "that", "are", "available", "to", "the", "given", "login", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SegmentEditor/Model.php#L73-L81
209,650
matomo-org/matomo
plugins/SegmentEditor/Model.php
Model.getAllSegmentsForSite
public function getAllSegmentsForSite($idSite, $userLogin) { $bind = array($idSite, $userLogin); $sql = $this->buildQuerySortedByName('(enable_only_idsite = ? OR enable_only_idsite = 0) AND deleted = 0 AND...
php
public function getAllSegmentsForSite($idSite, $userLogin) { $bind = array($idSite, $userLogin); $sql = $this->buildQuerySortedByName('(enable_only_idsite = ? OR enable_only_idsite = 0) AND deleted = 0 AND...
[ "public", "function", "getAllSegmentsForSite", "(", "$", "idSite", ",", "$", "userLogin", ")", "{", "$", "bind", "=", "array", "(", "$", "idSite", ",", "$", "userLogin", ")", ";", "$", "sql", "=", "$", "this", "->", "buildQuerySortedByName", "(", "'(enab...
Returns all stored segments that are available for the given site and login. @param string $userLogin @param int $idSite Whether to return stored segments for a specific idSite, or all of them. If supplied, must be a valid site ID. @return array
[ "Returns", "all", "stored", "segments", "that", "are", "available", "for", "the", "given", "site", "and", "login", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SegmentEditor/Model.php#L90-L99
209,651
matomo-org/matomo
plugins/SegmentEditor/Model.php
Model.getAllSegmentsForAllUsers
public function getAllSegmentsForAllUsers($idSite = false) { $bind = array(); $sqlWhereCondition = ''; if(!empty($idSite)) { $bind = array($idSite); $sqlWhereCondition = '(enable_only_idsite = ? OR enable_only_idsite = 0) AND'; } $sqlWhereCondition ...
php
public function getAllSegmentsForAllUsers($idSite = false) { $bind = array(); $sqlWhereCondition = ''; if(!empty($idSite)) { $bind = array($idSite); $sqlWhereCondition = '(enable_only_idsite = ? OR enable_only_idsite = 0) AND'; } $sqlWhereCondition ...
[ "public", "function", "getAllSegmentsForAllUsers", "(", "$", "idSite", "=", "false", ")", "{", "$", "bind", "=", "array", "(", ")", ";", "$", "sqlWhereCondition", "=", "''", ";", "if", "(", "!", "empty", "(", "$", "idSite", ")", ")", "{", "$", "bind"...
This should be used _only_ by Super Users @param $idSite @return array
[ "This", "should", "be", "used", "_only_", "by", "Super", "Users" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SegmentEditor/Model.php#L106-L120
209,652
matomo-org/matomo
plugins/CustomPiwikJs/API.php
API.doesIncludePluginTrackersAutomatically
public function doesIncludePluginTrackersAutomatically() { Piwik::checkUserHasSomeAdminAccess(); try { $updater = StaticContainer::get('Piwik\Plugins\CustomPiwikJs\TrackerUpdater'); $updater->checkWillSucceed(); return true; } catch (AccessDeniedException...
php
public function doesIncludePluginTrackersAutomatically() { Piwik::checkUserHasSomeAdminAccess(); try { $updater = StaticContainer::get('Piwik\Plugins\CustomPiwikJs\TrackerUpdater'); $updater->checkWillSucceed(); return true; } catch (AccessDeniedException...
[ "public", "function", "doesIncludePluginTrackersAutomatically", "(", ")", "{", "Piwik", "::", "checkUserHasSomeAdminAccess", "(", ")", ";", "try", "{", "$", "updater", "=", "StaticContainer", "::", "get", "(", "'Piwik\\Plugins\\CustomPiwikJs\\TrackerUpdater'", ")", ";",...
Detects whether plugin trackers will be automatically added to piwik.js or not. If not, the plugin tracker files need to be loaded manually. @return bool
[ "Detects", "whether", "plugin", "trackers", "will", "be", "automatically", "added", "to", "piwik", ".", "js", "or", "not", ".", "If", "not", "the", "plugin", "tracker", "files", "need", "to", "be", "loaded", "manually", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CustomPiwikJs/API.php#L27-L40
209,653
matomo-org/matomo
core/Piwik.php
Piwik.exitWithErrorMessage
public static function exitWithErrorMessage($message) { Common::sendHeader('Content-Type: text/html; charset=utf-8'); $message = str_replace("\n", "<br/>", $message); $output = "<html><body>". "<style>a{color:red;}</style>\n" . "<div style='color:red;font-size:120%;...
php
public static function exitWithErrorMessage($message) { Common::sendHeader('Content-Type: text/html; charset=utf-8'); $message = str_replace("\n", "<br/>", $message); $output = "<html><body>". "<style>a{color:red;}</style>\n" . "<div style='color:red;font-size:120%;...
[ "public", "static", "function", "exitWithErrorMessage", "(", "$", "message", ")", "{", "Common", "::", "sendHeader", "(", "'Content-Type: text/html; charset=utf-8'", ")", ";", "$", "message", "=", "str_replace", "(", "\"\\n\"", ",", "\"<br/>\"", ",", "$", "message...
Display the message in a nice red font with a nice icon ... and dies @param string $message
[ "Display", "the", "message", "in", "a", "nice", "red", "font", "with", "a", "nice", "icon", "...", "and", "dies" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L76-L94
209,654
matomo-org/matomo
core/Piwik.php
Piwik.secureDiv
public static function secureDiv($i1, $i2) { if (is_numeric($i1) && is_numeric($i2) && floatval($i2) != 0) { return $i1 / $i2; } return 0; }
php
public static function secureDiv($i1, $i2) { if (is_numeric($i1) && is_numeric($i2) && floatval($i2) != 0) { return $i1 / $i2; } return 0; }
[ "public", "static", "function", "secureDiv", "(", "$", "i1", ",", "$", "i2", ")", "{", "if", "(", "is_numeric", "(", "$", "i1", ")", "&&", "is_numeric", "(", "$", "i2", ")", "&&", "floatval", "(", "$", "i2", ")", "!=", "0", ")", "{", "return", ...
Computes the division of i1 by i2. If either i1 or i2 are not number, or if i2 has a value of zero we return 0 to avoid the division by zero. @param number $i1 @param number $i2 @return number The result of the division or zero
[ "Computes", "the", "division", "of", "i1", "by", "i2", ".", "If", "either", "i1", "or", "i2", "are", "not", "number", "or", "if", "i2", "has", "a", "value", "of", "zero", "we", "return", "0", "to", "avoid", "the", "division", "by", "zero", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L104-L110
209,655
matomo-org/matomo
core/Piwik.php
Piwik.getRandomTitle
public static function getRandomTitle() { static $titles = array( 'Web analytics', 'Open analytics platform', 'Real Time Web Analytics', 'Analytics', 'Real Time Analytics', 'Analytics in Real time', 'Analytics Platform', ...
php
public static function getRandomTitle() { static $titles = array( 'Web analytics', 'Open analytics platform', 'Real Time Web Analytics', 'Analytics', 'Real Time Analytics', 'Analytics in Real time', 'Analytics Platform', ...
[ "public", "static", "function", "getRandomTitle", "(", ")", "{", "static", "$", "titles", "=", "array", "(", "'Web analytics'", ",", "'Open analytics platform'", ",", "'Real Time Web Analytics'", ",", "'Analytics'", ",", "'Real Time Analytics'", ",", "'Analytics in Real...
Generate a title for image tags @return string
[ "Generate", "a", "title", "for", "image", "tags" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L146-L161
209,656
matomo-org/matomo
core/Piwik.php
Piwik.getAllSuperUserAccessEmailAddresses
public static function getAllSuperUserAccessEmailAddresses() { $emails = array(); try { $superUsers = APIUsersManager::getInstance()->getUsersHavingSuperUserAccess(); } catch (\Exception $e) { return $emails; } foreach ($superUsers as $superUser) { ...
php
public static function getAllSuperUserAccessEmailAddresses() { $emails = array(); try { $superUsers = APIUsersManager::getInstance()->getUsersHavingSuperUserAccess(); } catch (\Exception $e) { return $emails; } foreach ($superUsers as $superUser) { ...
[ "public", "static", "function", "getAllSuperUserAccessEmailAddresses", "(", ")", "{", "$", "emails", "=", "array", "(", ")", ";", "try", "{", "$", "superUsers", "=", "APIUsersManager", "::", "getInstance", "(", ")", "->", "getUsersHavingSuperUserAccess", "(", ")...
Get a list of all email addresses having Super User access. @return array
[ "Get", "a", "list", "of", "all", "email", "addresses", "having", "Super", "User", "access", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L184-L199
209,657
matomo-org/matomo
core/Piwik.php
Piwik.checkUserHasSuperUserAccessOrIsTheUser
public static function checkUserHasSuperUserAccessOrIsTheUser($theUser) { try { if (Piwik::getCurrentUserLogin() !== $theUser) { // or to the Super User Piwik::checkUserHasSuperUserAccess(); } } catch (NoAccessException $e) { throw ...
php
public static function checkUserHasSuperUserAccessOrIsTheUser($theUser) { try { if (Piwik::getCurrentUserLogin() !== $theUser) { // or to the Super User Piwik::checkUserHasSuperUserAccess(); } } catch (NoAccessException $e) { throw ...
[ "public", "static", "function", "checkUserHasSuperUserAccessOrIsTheUser", "(", "$", "theUser", ")", "{", "try", "{", "if", "(", "Piwik", "::", "getCurrentUserLogin", "(", ")", "!==", "$", "theUser", ")", "{", "// or to the Super User", "Piwik", "::", "checkUserHas...
Check that the current user is either the specified user or the superuser. @param string $theUser A username. @throws NoAccessException If the user is neither the Super User nor the user `$theUser`. @api
[ "Check", "that", "the", "current", "user", "is", "either", "the", "specified", "user", "or", "the", "superuser", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L253-L263
209,658
matomo-org/matomo
core/Piwik.php
Piwik.hasTheUserSuperUserAccess
public static function hasTheUserSuperUserAccess($theUser) { if (empty($theUser)) { return false; } if (Piwik::getCurrentUserLogin() === $theUser && Piwik::hasUserSuperUserAccess()) { return true; } try { $superUsers = APIUsersManager::ge...
php
public static function hasTheUserSuperUserAccess($theUser) { if (empty($theUser)) { return false; } if (Piwik::getCurrentUserLogin() === $theUser && Piwik::hasUserSuperUserAccess()) { return true; } try { $superUsers = APIUsersManager::ge...
[ "public", "static", "function", "hasTheUserSuperUserAccess", "(", "$", "theUser", ")", "{", "if", "(", "empty", "(", "$", "theUser", ")", ")", "{", "return", "false", ";", "}", "if", "(", "Piwik", "::", "getCurrentUserLogin", "(", ")", "===", "$", "theUs...
Check whether the given user has superuser access. @param string $theUser A username. @return bool @api
[ "Check", "whether", "the", "given", "user", "has", "superuser", "access", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L272-L295
209,659
matomo-org/matomo
core/Piwik.php
Piwik.isUserHasCapability
public static function isUserHasCapability($idSites, $capability) { try { self::checkUserHasCapability($idSites, $capability); return true; } catch (Exception $e) { return false; } }
php
public static function isUserHasCapability($idSites, $capability) { try { self::checkUserHasCapability($idSites, $capability); return true; } catch (Exception $e) { return false; } }
[ "public", "static", "function", "isUserHasCapability", "(", "$", "idSites", ",", "$", "capability", ")", "{", "try", "{", "self", "::", "checkUserHasCapability", "(", "$", "idSites", ",", "$", "capability", ")", ";", "return", "true", ";", "}", "catch", "(...
Returns `true` if the current user has the given capability for the given sites. @return bool @api
[ "Returns", "true", "if", "the", "current", "user", "has", "the", "given", "capability", "for", "the", "given", "sites", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L447-L455
209,660
matomo-org/matomo
core/Piwik.php
Piwik.redirectToModule
public static function redirectToModule($newModule, $newAction = '', $parameters = array()) { $newUrl = 'index.php' . Url::getCurrentQueryStringWithParametersModified( array('module' => $newModule, 'action' => $newAction) + $parameters ); Url::redirectToUr...
php
public static function redirectToModule($newModule, $newAction = '', $parameters = array()) { $newUrl = 'index.php' . Url::getCurrentQueryStringWithParametersModified( array('module' => $newModule, 'action' => $newAction) + $parameters ); Url::redirectToUr...
[ "public", "static", "function", "redirectToModule", "(", "$", "newModule", ",", "$", "newAction", "=", "''", ",", "$", "parameters", "=", "array", "(", ")", ")", "{", "$", "newUrl", "=", "'index.php'", ".", "Url", "::", "getCurrentQueryStringWithParametersModi...
Redirects the current request to a new module and action. @param string $newModule The target module, eg, `'UserCountry'`. @param string $newAction The target controller action, eg, `'index'`. @param array $parameters The query parameter values to modify before redirecting. @api
[ "Redirects", "the", "current", "request", "to", "a", "new", "module", "and", "action", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L630-L637
209,661
matomo-org/matomo
core/Piwik.php
Piwik.checkObjectTypeIs
public static function checkObjectTypeIs($o, $types) { foreach ($types as $type) { if ($o instanceof $type) { return; } } $oType = is_object($o) ? get_class($o) : gettype($o); throw new Exception("Invalid variable type '$oType', expected one o...
php
public static function checkObjectTypeIs($o, $types) { foreach ($types as $type) { if ($o instanceof $type) { return; } } $oType = is_object($o) ? get_class($o) : gettype($o); throw new Exception("Invalid variable type '$oType', expected one o...
[ "public", "static", "function", "checkObjectTypeIs", "(", "$", "o", ",", "$", "types", ")", "{", "foreach", "(", "$", "types", "as", "$", "type", ")", "{", "if", "(", "$", "o", "instanceof", "$", "type", ")", "{", "return", ";", "}", "}", "$", "o...
Utility function that checks if an object type is in a set of types. @param mixed $o @param array $types List of class names that $o is expected to be one of. @throws Exception if $o is not an instance of the types contained in $types.
[ "Utility", "function", "that", "checks", "if", "an", "object", "type", "is", "in", "a", "set", "of", "types", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L691-L701
209,662
matomo-org/matomo
core/Piwik.php
Piwik.isAssociativeArray
public static function isAssociativeArray($array) { reset($array); if (!is_numeric(key($array)) || key($array) != 0 ) { // first key must be 0 return true; } // check that each key is == next key - 1 w/o actually indexing the array ...
php
public static function isAssociativeArray($array) { reset($array); if (!is_numeric(key($array)) || key($array) != 0 ) { // first key must be 0 return true; } // check that each key is == next key - 1 w/o actually indexing the array ...
[ "public", "static", "function", "isAssociativeArray", "(", "$", "array", ")", "{", "reset", "(", "$", "array", ")", ";", "if", "(", "!", "is_numeric", "(", "key", "(", "$", "array", ")", ")", "||", "key", "(", "$", "array", ")", "!=", "0", ")", "...
Returns true if an array is an associative array, false if otherwise. This method determines if an array is associative by checking that the first element's key is 0, and that each successive element's key is one greater than the last. @param array $array @return bool
[ "Returns", "true", "if", "an", "array", "is", "an", "associative", "array", "false", "if", "otherwise", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L713-L739
209,663
matomo-org/matomo
core/Piwik.php
Piwik.getUnnamespacedClassName
public static function getUnnamespacedClassName($object) { $className = is_string($object) ? $object : get_class($object); $parts = explode('\\', $className); return end($parts); }
php
public static function getUnnamespacedClassName($object) { $className = is_string($object) ? $object : get_class($object); $parts = explode('\\', $className); return end($parts); }
[ "public", "static", "function", "getUnnamespacedClassName", "(", "$", "object", ")", "{", "$", "className", "=", "is_string", "(", "$", "object", ")", "?", "$", "object", ":", "get_class", "(", "$", "object", ")", ";", "$", "parts", "=", "explode", "(", ...
Returns the class name of an object without its namespace. @param mixed|string $object @return string
[ "Returns", "the", "class", "name", "of", "an", "object", "without", "its", "namespace", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L760-L765
209,664
matomo-org/matomo
core/Piwik.php
Piwik.postEvent
public static function postEvent($eventName, $params = array(), $pending = false, $plugins = null) { EventDispatcher::getInstance()->postEvent($eventName, $params, $pending, $plugins); }
php
public static function postEvent($eventName, $params = array(), $pending = false, $plugins = null) { EventDispatcher::getInstance()->postEvent($eventName, $params, $pending, $plugins); }
[ "public", "static", "function", "postEvent", "(", "$", "eventName", ",", "$", "params", "=", "array", "(", ")", ",", "$", "pending", "=", "false", ",", "$", "plugins", "=", "null", ")", "{", "EventDispatcher", "::", "getInstance", "(", ")", "->", "post...
Post an event to Piwik's event dispatcher which will execute the event's observers. @param string $eventName The event name. @param array $params The parameter array to forward to observer callbacks. @param bool $pending If true, plugins that are loaded after this event is fired will have their observers for this even...
[ "Post", "an", "event", "to", "Piwik", "s", "event", "dispatcher", "which", "will", "execute", "the", "event", "s", "observers", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L778-L781
209,665
matomo-org/matomo
core/Piwik.php
Piwik.translate
public static function translate($translationId, $args = array(), $language = null) { /** @var Translator $translator */ $translator = StaticContainer::get('Piwik\Translation\Translator'); return $translator->translate($translationId, $args, $language); }
php
public static function translate($translationId, $args = array(), $language = null) { /** @var Translator $translator */ $translator = StaticContainer::get('Piwik\Translation\Translator'); return $translator->translate($translationId, $args, $language); }
[ "public", "static", "function", "translate", "(", "$", "translationId", ",", "$", "args", "=", "array", "(", ")", ",", "$", "language", "=", "null", ")", "{", "/** @var Translator $translator */", "$", "translator", "=", "StaticContainer", "::", "get", "(", ...
Returns an internationalized string using a translation token. If a translation cannot be found for the token, the token is returned. @param string $translationId Translation ID, eg, `'General_Date'`. @param array|string|int $args `sprintf` arguments to be applied to the internationalized string. @param string|null $l...
[ "Returns", "an", "internationalized", "string", "using", "a", "translation", "token", ".", "If", "a", "translation", "cannot", "be", "found", "for", "the", "token", "the", "token", "is", "returned", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L820-L826
209,666
matomo-org/matomo
core/Tracker/VisitExcluded.php
VisitExcluded.isExcluded
public function isExcluded() { $excluded = false; if ($this->isNonHumanBot()) { Common::printDebug('Search bot detected, visit excluded'); $excluded = true; } /* * Requests built with piwik.js will contain a rec=1 parameter. This is used as ...
php
public function isExcluded() { $excluded = false; if ($this->isNonHumanBot()) { Common::printDebug('Search bot detected, visit excluded'); $excluded = true; } /* * Requests built with piwik.js will contain a rec=1 parameter. This is used as ...
[ "public", "function", "isExcluded", "(", ")", "{", "$", "excluded", "=", "false", ";", "if", "(", "$", "this", "->", "isNonHumanBot", "(", ")", ")", "{", "Common", "::", "printDebug", "(", "'Search bot detected, visit excluded'", ")", ";", "$", "excluded", ...
Test if the current visitor is excluded from the statistics. Plugins can for example exclude visitors based on the - IP - If a given cookie is found @return bool True if the visit must not be saved, false otherwise
[ "Test", "if", "the", "current", "visitor", "is", "excluded", "from", "the", "statistics", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/VisitExcluded.php#L61-L155
209,667
matomo-org/matomo
core/Tracker/VisitExcluded.php
VisitExcluded.isVisitorIpExcluded
protected function isVisitorIpExcluded() { $excludedIps = $this->getAttributes('excluded_ips', 'global_excluded_ips'); if (!empty($excludedIps)) { $ip = IP::fromBinaryIP($this->ip); if ($ip->isInRanges($excludedIps)) { Common::printDebug('Visitor IP ' . $ip->...
php
protected function isVisitorIpExcluded() { $excludedIps = $this->getAttributes('excluded_ips', 'global_excluded_ips'); if (!empty($excludedIps)) { $ip = IP::fromBinaryIP($this->ip); if ($ip->isInRanges($excludedIps)) { Common::printDebug('Visitor IP ' . $ip->...
[ "protected", "function", "isVisitorIpExcluded", "(", ")", "{", "$", "excludedIps", "=", "$", "this", "->", "getAttributes", "(", "'excluded_ips'", ",", "'global_excluded_ips'", ")", ";", "if", "(", "!", "empty", "(", "$", "excludedIps", ")", ")", "{", "$", ...
Checks if the visitor ip is in the excluded list @return bool
[ "Checks", "if", "the", "visitor", "ip", "is", "in", "the", "excluded", "list" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/VisitExcluded.php#L273-L286
209,668
matomo-org/matomo
core/Tracker/VisitExcluded.php
VisitExcluded.isUrlExcluded
protected function isUrlExcluded() { $excludedUrls = $this->getAttributes('exclude_unknown_urls', null); $siteUrls = $this->getAttributes('urls', null); if (!empty($excludedUrls) && !empty($siteUrls)) { $url = $this->request->getParam('url'); $parsedUrl = parse_url($...
php
protected function isUrlExcluded() { $excludedUrls = $this->getAttributes('exclude_unknown_urls', null); $siteUrls = $this->getAttributes('urls', null); if (!empty($excludedUrls) && !empty($siteUrls)) { $url = $this->request->getParam('url'); $parsedUrl = parse_url($...
[ "protected", "function", "isUrlExcluded", "(", ")", "{", "$", "excludedUrls", "=", "$", "this", "->", "getAttributes", "(", "'exclude_unknown_urls'", ",", "null", ")", ";", "$", "siteUrls", "=", "$", "this", "->", "getAttributes", "(", "'urls'", ",", "null",...
Checks if request URL is excluded @return bool
[ "Checks", "if", "request", "URL", "is", "excluded" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/VisitExcluded.php#L312-L331
209,669
matomo-org/matomo
core/Tracker/VisitExcluded.php
VisitExcluded.isUserAgentExcluded
protected function isUserAgentExcluded() { $excludedAgents = $this->getAttributes('excluded_user_agents', 'global_excluded_user_agents'); if (!empty($excludedAgents)) { foreach ($excludedAgents as $excludedUserAgent) { // if the excluded user agent string part is in this...
php
protected function isUserAgentExcluded() { $excludedAgents = $this->getAttributes('excluded_user_agents', 'global_excluded_user_agents'); if (!empty($excludedAgents)) { foreach ($excludedAgents as $excludedUserAgent) { // if the excluded user agent string part is in this...
[ "protected", "function", "isUserAgentExcluded", "(", ")", "{", "$", "excludedAgents", "=", "$", "this", "->", "getAttributes", "(", "'excluded_user_agents'", ",", "'global_excluded_user_agents'", ")", ";", "if", "(", "!", "empty", "(", "$", "excludedAgents", ")", ...
Returns true if the specified user agent should be excluded for the current site or not. Visits whose user agent string contains one of the excluded_user_agents strings for the site being tracked (or one of the global strings) will be excluded. @internal param string $this ->userAgent The user agent string. @return b...
[ "Returns", "true", "if", "the", "specified", "user", "agent", "should", "be", "excluded", "for", "the", "current", "site", "or", "not", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/VisitExcluded.php#L342-L356
209,670
matomo-org/matomo
plugins/Goals/Model.php
Model.deleteGoalConversions
public function deleteGoalConversions($idSite, $idGoal) { $table = Common::prefixTable("log_conversion"); Db::deleteAllRows($table, "WHERE idgoal = ? AND idsite = ?", "idvisit", 100000, array($idGoal, $idSite)); }
php
public function deleteGoalConversions($idSite, $idGoal) { $table = Common::prefixTable("log_conversion"); Db::deleteAllRows($table, "WHERE idgoal = ? AND idsite = ?", "idvisit", 100000, array($idGoal, $idSite)); }
[ "public", "function", "deleteGoalConversions", "(", "$", "idSite", ",", "$", "idGoal", ")", "{", "$", "table", "=", "Common", "::", "prefixTable", "(", "\"log_conversion\"", ")", ";", "Db", "::", "deleteAllRows", "(", "$", "table", ",", "\"WHERE idgoal = ? AND...
actually this should be in a log_conversion model
[ "actually", "this", "should", "be", "in", "a", "log_conversion", "model" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/Model.php#L60-L65
209,671
matomo-org/matomo
core/Db/Adapter.php
Adapter.getAdapterClassName
private static function getAdapterClassName($adapterName) { $className = 'Piwik\Db\Adapter\\' . str_replace(' ', '\\', ucwords(str_replace(array('_', '\\'), ' ', strtolower($adapterName)))); if (!class_exists($className)) { throw new \Exception(sprintf("Adapter '%s' is not valid. Maybe c...
php
private static function getAdapterClassName($adapterName) { $className = 'Piwik\Db\Adapter\\' . str_replace(' ', '\\', ucwords(str_replace(array('_', '\\'), ' ', strtolower($adapterName)))); if (!class_exists($className)) { throw new \Exception(sprintf("Adapter '%s' is not valid. Maybe c...
[ "private", "static", "function", "getAdapterClassName", "(", "$", "adapterName", ")", "{", "$", "className", "=", "'Piwik\\Db\\Adapter\\\\'", ".", "str_replace", "(", "' '", ",", "'\\\\'", ",", "ucwords", "(", "str_replace", "(", "array", "(", "'_'", ",", "'\\...
Get adapter class name @param string $adapterName @return string @throws \Exception
[ "Get", "adapter", "class", "name" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter.php#L68-L75
209,672
matomo-org/matomo
core/Db/Adapter.php
Adapter.getAdapters
public static function getAdapters() { static $adapterNames = array( // currently supported by Piwik 'Pdo\Mysql', 'Mysqli', // other adapters supported by Zend_Db // 'Pdo_Pgsql', // 'Pdo_Mssql', // 'Sqlsrv', // 'Pdo_Ibm', // 'Db2', // 'Pdo_Oci', /...
php
public static function getAdapters() { static $adapterNames = array( // currently supported by Piwik 'Pdo\Mysql', 'Mysqli', // other adapters supported by Zend_Db // 'Pdo_Pgsql', // 'Pdo_Mssql', // 'Sqlsrv', // 'Pdo_Ibm', // 'Db2', // 'Pdo_Oci', /...
[ "public", "static", "function", "getAdapters", "(", ")", "{", "static", "$", "adapterNames", "=", "array", "(", "// currently supported by Piwik", "'Pdo\\Mysql'", ",", "'Mysqli'", ",", "// other adapters supported by Zend_Db", "//\t\t\t'Pdo_Pgsql',", "//\t\t\t'Pdo_Mssql',", ...
Get list of adapters @return array
[ "Get", "list", "of", "adapters" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter.php#L94-L121
209,673
matomo-org/matomo
core/Settings/Storage/Storage.php
Storage.getValue
public function getValue($key, $defaultValue, $type) { $this->loadSettingsIfNotDoneYet(); if (array_key_exists($key, $this->settingsValues)) { settype($this->settingsValues[$key], $type); return $this->settingsValues[$key]; } return $defaultValue; }
php
public function getValue($key, $defaultValue, $type) { $this->loadSettingsIfNotDoneYet(); if (array_key_exists($key, $this->settingsValues)) { settype($this->settingsValues[$key], $type); return $this->settingsValues[$key]; } return $defaultValue; }
[ "public", "function", "getValue", "(", "$", "key", ",", "$", "defaultValue", ",", "$", "type", ")", "{", "$", "this", "->", "loadSettingsIfNotDoneYet", "(", ")", ";", "if", "(", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "settingsValues...
Returns the current value for a setting. If no value is stored, the default value is be returned. @param string $key The name / key of a setting @param mixed $defaultValue Default value that will be used in case no value for this setting exists yet @param string $type The PHP internal type the value of the setting sh...
[ "Returns", "the", "current", "value", "for", "a", "setting", ".", "If", "no", "value", "is", "stored", "the", "default", "value", "is", "be", "returned", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Settings/Storage/Storage.php#L81-L91
209,674
matomo-org/matomo
libs/HTML/QuickForm2/Container/Group.php
HTML_QuickForm2_Container_Group.render
public function render(HTML_QuickForm2_Renderer $renderer) { $renderer->startGroup($this); foreach ($this as $element) { $element->render($renderer); } $renderer->finishGroup($this); return $renderer; }
php
public function render(HTML_QuickForm2_Renderer $renderer) { $renderer->startGroup($this); foreach ($this as $element) { $element->render($renderer); } $renderer->finishGroup($this); return $renderer; }
[ "public", "function", "render", "(", "HTML_QuickForm2_Renderer", "$", "renderer", ")", "{", "$", "renderer", "->", "startGroup", "(", "$", "this", ")", ";", "foreach", "(", "$", "this", "as", "$", "element", ")", "{", "$", "element", "->", "render", "(",...
Renders the group using the given renderer @param HTML_QuickForm2_Renderer Renderer instance @return HTML_QuickForm2_Renderer
[ "Renders", "the", "group", "using", "the", "given", "renderer" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Container/Group.php#L308-L316
209,675
matomo-org/matomo
core/Plugin/Menu.php
Menu.urlForDefaultUserParams
public function urlForDefaultUserParams($websiteId = false, $defaultPeriod = false, $defaultDate = false) { $userPreferences = new UserPreferences(); if (empty($websiteId)) { $websiteId = $userPreferences->getDefaultWebsiteId(); } if (empty($websiteId)) { thro...
php
public function urlForDefaultUserParams($websiteId = false, $defaultPeriod = false, $defaultDate = false) { $userPreferences = new UserPreferences(); if (empty($websiteId)) { $websiteId = $userPreferences->getDefaultWebsiteId(); } if (empty($websiteId)) { thro...
[ "public", "function", "urlForDefaultUserParams", "(", "$", "websiteId", "=", "false", ",", "$", "defaultPeriod", "=", "false", ",", "$", "defaultDate", "=", "false", ")", "{", "$", "userPreferences", "=", "new", "UserPreferences", "(", ")", ";", "if", "(", ...
Returns the &idSite=X&period=Y&date=Z query string fragment, fetched from current logged-in user's preferences. @param bool $websiteId @param bool $defaultPeriod @param bool $defaultDate @return string eg '&idSite=1&period=week&date=today' @throws \Exception in case a website was not specified and a default website id...
[ "Returns", "the", "&idSite", "=", "X&period", "=", "Y&date", "=", "Z", "query", "string", "fragment", "fetched", "from", "current", "logged", "-", "in", "user", "s", "preferences", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Menu.php#L188-L208
209,676
matomo-org/matomo
core/Plugin/ComponentFactory.php
ComponentFactory.factory
public static function factory($pluginName, $componentClassSimpleName, $componentTypeClass) { if (empty($pluginName) || empty($componentClassSimpleName)) { Log::debug("ComponentFactory::%s: empty plugin name or component simple name requested (%s, %s)", __FUNCTION__, $pluginName,...
php
public static function factory($pluginName, $componentClassSimpleName, $componentTypeClass) { if (empty($pluginName) || empty($componentClassSimpleName)) { Log::debug("ComponentFactory::%s: empty plugin name or component simple name requested (%s, %s)", __FUNCTION__, $pluginName,...
[ "public", "static", "function", "factory", "(", "$", "pluginName", ",", "$", "componentClassSimpleName", ",", "$", "componentTypeClass", ")", "{", "if", "(", "empty", "(", "$", "pluginName", ")", "||", "empty", "(", "$", "componentClassSimpleName", ")", ")", ...
Create a component instance that exists within a specific plugin. Uses the component's unqualified class name and expected base type. This method will only create a class if it is located within the component type's associated subdirectory. @param string $pluginName The name of the plugin the component is expected to...
[ "Create", "a", "component", "instance", "that", "exists", "within", "a", "specific", "plugin", ".", "Uses", "the", "component", "s", "unqualified", "class", "name", "and", "expected", "base", "type", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/ComponentFactory.php#L37-L65
209,677
matomo-org/matomo
core/Plugin/ComponentFactory.php
ComponentFactory.getComponentIf
public static function getComponentIf($componentTypeClass, $pluginName, $predicate) { $pluginManager = PluginManager::getInstance(); // get components to search through $subnamespace = $componentTypeClass::COMPONENT_SUBNAMESPACE; if (empty($pluginName)) { $components = $...
php
public static function getComponentIf($componentTypeClass, $pluginName, $predicate) { $pluginManager = PluginManager::getInstance(); // get components to search through $subnamespace = $componentTypeClass::COMPONENT_SUBNAMESPACE; if (empty($pluginName)) { $components = $...
[ "public", "static", "function", "getComponentIf", "(", "$", "componentTypeClass", ",", "$", "pluginName", ",", "$", "predicate", ")", "{", "$", "pluginManager", "=", "PluginManager", "::", "getInstance", "(", ")", ";", "// get components to search through", "$", "...
Finds a component instance that satisfies a given predicate. @param string $componentTypeClass The fully qualified class name of the component type, eg, `"Piwik\Plugin\Report"`. @param string $pluginName|false The name of the plugin the component is expected to belong to, eg, `'DevicesDetection'`. @param callback $pre...
[ "Finds", "a", "component", "instance", "that", "satisfies", "a", "given", "predicate", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/ComponentFactory.php#L77-L106
209,678
matomo-org/matomo
core/ArchiveProcessor/PluginsArchiver.php
PluginsArchiver.callAggregateAllPlugins
public function callAggregateAllPlugins($visits, $visitsConverted, $forceArchivingWithoutVisits = false) { Log::debug("PluginsArchiver::%s: Initializing archiving process for all plugins [visits = %s, visits converted = %s]", __FUNCTION__, $visits, $visitsConverted); /** @var Logger $pe...
php
public function callAggregateAllPlugins($visits, $visitsConverted, $forceArchivingWithoutVisits = false) { Log::debug("PluginsArchiver::%s: Initializing archiving process for all plugins [visits = %s, visits converted = %s]", __FUNCTION__, $visits, $visitsConverted); /** @var Logger $pe...
[ "public", "function", "callAggregateAllPlugins", "(", "$", "visits", ",", "$", "visitsConverted", ",", "$", "forceArchivingWithoutVisits", "=", "false", ")", "{", "Log", "::", "debug", "(", "\"PluginsArchiver::%s: Initializing archiving process for all plugins [visits = %s, v...
Instantiates the Archiver class in each plugin that defines it, and triggers Aggregation processing on these plugins.
[ "Instantiates", "the", "Archiver", "class", "in", "each", "plugin", "that", "defines", "it", "and", "triggers", "Aggregation", "processing", "on", "these", "plugins", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor/PluginsArchiver.php#L121-L187
209,679
matomo-org/matomo
core/ArchiveProcessor/PluginsArchiver.php
PluginsArchiver.doesAnyPluginArchiveWithoutVisits
public static function doesAnyPluginArchiveWithoutVisits() { $archivers = static::getPluginArchivers(); foreach ($archivers as $pluginName => $archiverClass) { if ($archiverClass::shouldRunEvenWhenNoVisits()) { return true; } } return false; ...
php
public static function doesAnyPluginArchiveWithoutVisits() { $archivers = static::getPluginArchivers(); foreach ($archivers as $pluginName => $archiverClass) { if ($archiverClass::shouldRunEvenWhenNoVisits()) { return true; } } return false; ...
[ "public", "static", "function", "doesAnyPluginArchiveWithoutVisits", "(", ")", "{", "$", "archivers", "=", "static", "::", "getPluginArchivers", "(", ")", ";", "foreach", "(", "$", "archivers", "as", "$", "pluginName", "=>", "$", "archiverClass", ")", "{", "if...
Returns if any plugin archiver archives without visits
[ "Returns", "if", "any", "plugin", "archiver", "archives", "without", "visits" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor/PluginsArchiver.php#L199-L210
209,680
matomo-org/matomo
core/ArchiveProcessor/PluginsArchiver.php
PluginsArchiver.getPluginArchivers
protected static function getPluginArchivers() { if (empty(static::$archivers)) { $pluginNames = \Piwik\Plugin\Manager::getInstance()->getActivatedPlugins(); $archivers = array(); foreach ($pluginNames as $pluginName) { $archivers[$pluginName] = self::getP...
php
protected static function getPluginArchivers() { if (empty(static::$archivers)) { $pluginNames = \Piwik\Plugin\Manager::getInstance()->getActivatedPlugins(); $archivers = array(); foreach ($pluginNames as $pluginName) { $archivers[$pluginName] = self::getP...
[ "protected", "static", "function", "getPluginArchivers", "(", ")", "{", "if", "(", "empty", "(", "static", "::", "$", "archivers", ")", ")", "{", "$", "pluginNames", "=", "\\", "Piwik", "\\", "Plugin", "\\", "Manager", "::", "getInstance", "(", ")", "->"...
Loads Archiver class from any plugin that defines one. @return \Piwik\Plugin\Archiver[]
[ "Loads", "Archiver", "class", "from", "any", "plugin", "that", "defines", "one", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor/PluginsArchiver.php#L217-L228
209,681
matomo-org/matomo
core/ArchiveProcessor/PluginsArchiver.php
PluginsArchiver.shouldProcessReportsForPlugin
protected function shouldProcessReportsForPlugin($pluginName) { if ($this->params->getRequestedPlugin() == $pluginName) { return true; } if ($this->params->shouldOnlyArchiveRequestedPlugin()) { return false; } if (Rules::shouldProcessReportsAllPlugin...
php
protected function shouldProcessReportsForPlugin($pluginName) { if ($this->params->getRequestedPlugin() == $pluginName) { return true; } if ($this->params->shouldOnlyArchiveRequestedPlugin()) { return false; } if (Rules::shouldProcessReportsAllPlugin...
[ "protected", "function", "shouldProcessReportsForPlugin", "(", "$", "pluginName", ")", "{", "if", "(", "$", "this", "->", "params", "->", "getRequestedPlugin", "(", ")", "==", "$", "pluginName", ")", "{", "return", "true", ";", "}", "if", "(", "$", "this",...
Whether the specified plugin's reports should be archived @param string $pluginName @return bool
[ "Whether", "the", "specified", "plugin", "s", "reports", "should", "be", "archived" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor/PluginsArchiver.php#L245-L266
209,682
matomo-org/matomo
libs/Zend/Validate.php
Zend_Validate.addValidator
public function addValidator(Zend_Validate_Interface $validator, $breakChainOnFailure = false) { $this->_validators[] = array( 'instance' => $validator, 'breakChainOnFailure' => (boolean) $breakChainOnFailure ); return $this; }
php
public function addValidator(Zend_Validate_Interface $validator, $breakChainOnFailure = false) { $this->_validators[] = array( 'instance' => $validator, 'breakChainOnFailure' => (boolean) $breakChainOnFailure ); return $this; }
[ "public", "function", "addValidator", "(", "Zend_Validate_Interface", "$", "validator", ",", "$", "breakChainOnFailure", "=", "false", ")", "{", "$", "this", "->", "_validators", "[", "]", "=", "array", "(", "'instance'", "=>", "$", "validator", ",", "'breakCh...
Adds a validator to the end of the chain If $breakChainOnFailure is true, then if the validator fails, the next validator in the chain, if one exists, will not be executed. @param Zend_Validate_Interface $validator @param boolean $breakChainOnFailure @return Zend_Validate Provides a fluent interface
[ "Adds", "a", "validator", "to", "the", "end", "of", "the", "chain" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate.php#L74-L81
209,683
matomo-org/matomo
core/Scheduler/Schedule/Monthly.php
Monthly.setDayOfWeek
public function setDayOfWeek($_day, $_week) { if (!($_day >= 0 && $_day < 7)) { throw new Exception("Invalid day of week parameter, must be >= 0 & < 7"); } if (!($_week >= 0 && $_week < 4)) { throw new Exception("Invalid week number, must be >= 1 & < 4"); } ...
php
public function setDayOfWeek($_day, $_week) { if (!($_day >= 0 && $_day < 7)) { throw new Exception("Invalid day of week parameter, must be >= 0 & < 7"); } if (!($_week >= 0 && $_week < 4)) { throw new Exception("Invalid week number, must be >= 1 & < 4"); } ...
[ "public", "function", "setDayOfWeek", "(", "$", "_day", ",", "$", "_week", ")", "{", "if", "(", "!", "(", "$", "_day", ">=", "0", "&&", "$", "_day", "<", "7", ")", ")", "{", "throw", "new", "Exception", "(", "\"Invalid day of week parameter, must be >= 0...
Makes this scheduled time execute on a particular day of the week on each month. @param int $_day the day of the week to use, between 0-6 (inclusive). 0 -> Sunday @param int $_week the week to use, between 0-3 (inclusive) @throws Exception if either parameter is invalid
[ "Makes", "this", "scheduled", "time", "execute", "on", "a", "particular", "day", "of", "the", "week", "on", "each", "month", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Scheduler/Schedule/Monthly.php#L131-L143
209,684
matomo-org/matomo
core/Metrics/Sorter.php
Sorter.getPrimaryColumnToSort
public function getPrimaryColumnToSort(DataTable $table, $columnToSort) { // we fallback to nb_visits in case columnToSort does not exist $columnsToCheck = array($columnToSort, 'nb_visits'); $row = $table->getFirstRow(); foreach ($columnsToCheck as $column) { $column = ...
php
public function getPrimaryColumnToSort(DataTable $table, $columnToSort) { // we fallback to nb_visits in case columnToSort does not exist $columnsToCheck = array($columnToSort, 'nb_visits'); $row = $table->getFirstRow(); foreach ($columnsToCheck as $column) { $column = ...
[ "public", "function", "getPrimaryColumnToSort", "(", "DataTable", "$", "table", ",", "$", "columnToSort", ")", "{", "// we fallback to nb_visits in case columnToSort does not exist", "$", "columnsToCheck", "=", "array", "(", "$", "columnToSort", ",", "'nb_visits'", ")", ...
Detect the column to be used for sorting @param DataTable $table @param string|int $columnToSort column name or column id @return int
[ "Detect", "the", "column", "to", "be", "used", "for", "sorting" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Metrics/Sorter.php#L141-L158
209,685
matomo-org/matomo
core/Metrics/Sorter.php
Sorter.getSecondaryColumnToSort
public function getSecondaryColumnToSort(Row $row, $primaryColumnToSort) { $defaultSecondaryColumn = array(Metrics::INDEX_NB_VISITS, 'nb_visits'); if (in_array($primaryColumnToSort, $defaultSecondaryColumn)) { // if sorted by visits, then sort by label as a secondary column ...
php
public function getSecondaryColumnToSort(Row $row, $primaryColumnToSort) { $defaultSecondaryColumn = array(Metrics::INDEX_NB_VISITS, 'nb_visits'); if (in_array($primaryColumnToSort, $defaultSecondaryColumn)) { // if sorted by visits, then sort by label as a secondary column ...
[ "public", "function", "getSecondaryColumnToSort", "(", "Row", "$", "row", ",", "$", "primaryColumnToSort", ")", "{", "$", "defaultSecondaryColumn", "=", "array", "(", "Metrics", "::", "INDEX_NB_VISITS", ",", "'nb_visits'", ")", ";", "if", "(", "in_array", "(", ...
Detect the secondary sort column to be used for sorting @param Row $row @param int|string $primaryColumnToSort @return int
[ "Detect", "the", "secondary", "sort", "column", "to", "be", "used", "for", "sorting" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Metrics/Sorter.php#L167-L193
209,686
matomo-org/matomo
plugins/CoreVisualizations/Visualizations/Cloud.php
Cloud.addWord
public function addWord($word, $value = 1) { if (isset($this->wordsArray[$word])) { $this->wordsArray[$word] += $value; } else { $this->wordsArray[$word] = $value; } }
php
public function addWord($word, $value = 1) { if (isset($this->wordsArray[$word])) { $this->wordsArray[$word] += $value; } else { $this->wordsArray[$word] = $value; } }
[ "public", "function", "addWord", "(", "$", "word", ",", "$", "value", "=", "1", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "wordsArray", "[", "$", "word", "]", ")", ")", "{", "$", "this", "->", "wordsArray", "[", "$", "word", "]", "+...
Assign word to array @param string $word @param int $value @return string
[ "Assign", "word", "to", "array" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/Visualizations/Cloud.php#L91-L98
209,687
matomo-org/matomo
plugins/CoreVisualizations/Visualizations/Cloud.php
Cloud.shuffleCloud
protected function shuffleCloud() { if (self::$debugDisableShuffle) { return; } $keys = array_keys($this->wordsArray); shuffle($keys); if (count($keys) && is_array($keys)) { $tmpArray = $this->wordsArray; $this->wordsArray = array(); ...
php
protected function shuffleCloud() { if (self::$debugDisableShuffle) { return; } $keys = array_keys($this->wordsArray); shuffle($keys); if (count($keys) && is_array($keys)) { $tmpArray = $this->wordsArray; $this->wordsArray = array(); ...
[ "protected", "function", "shuffleCloud", "(", ")", "{", "if", "(", "self", "::", "$", "debugDisableShuffle", ")", "{", "return", ";", "}", "$", "keys", "=", "array_keys", "(", "$", "this", "->", "wordsArray", ")", ";", "shuffle", "(", "$", "keys", ")",...
Shuffle associated names in array
[ "Shuffle", "associated", "names", "in", "array" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/Visualizations/Cloud.php#L132-L152
209,688
matomo-org/matomo
plugins/CoreVisualizations/Visualizations/Cloud.php
Cloud.getClassFromPercent
protected function getClassFromPercent($percent) { $mapping = array(95, 70, 50, 30, 15, 5, 0); foreach ($mapping as $key => $value) { if ($percent >= $value) { return $key; } } return 0; }
php
protected function getClassFromPercent($percent) { $mapping = array(95, 70, 50, 30, 15, 5, 0); foreach ($mapping as $key => $value) { if ($percent >= $value) { return $key; } } return 0; }
[ "protected", "function", "getClassFromPercent", "(", "$", "percent", ")", "{", "$", "mapping", "=", "array", "(", "95", ",", "70", ",", "50", ",", "30", ",", "15", ",", "5", ",", "0", ")", ";", "foreach", "(", "$", "mapping", "as", "$", "key", "=...
Get the class range using a percentage @param $percent @return int class
[ "Get", "the", "class", "range", "using", "a", "percentage" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/Visualizations/Cloud.php#L161-L170
209,689
matomo-org/matomo
libs/Zend/Mime/Message.php
Zend_Mime_Message.generateMessage
public function generateMessage($EOL = Zend_Mime::LINEEND) { if (! $this->isMultiPart()) { $body = array_shift($this->_parts); $body = $body->getContent($EOL); } else { $mime = $this->getMime(); $boundaryLine = $mime->boundaryLine($EOL); $...
php
public function generateMessage($EOL = Zend_Mime::LINEEND) { if (! $this->isMultiPart()) { $body = array_shift($this->_parts); $body = $body->getContent($EOL); } else { $mime = $this->getMime(); $boundaryLine = $mime->boundaryLine($EOL); $...
[ "public", "function", "generateMessage", "(", "$", "EOL", "=", "Zend_Mime", "::", "LINEEND", ")", "{", "if", "(", "!", "$", "this", "->", "isMultiPart", "(", ")", ")", "{", "$", "body", "=", "array_shift", "(", "$", "this", "->", "_parts", ")", ";", ...
Generate MIME-compliant message from the current configuration This can be a multipart message if more than one MIME part was added. If only one part is present, the content of this part is returned. If no part had been added, an empty string is returned. Parts are seperated by the mime boundary as defined in Zend_Mi...
[ "Generate", "MIME", "-", "compliant", "message", "from", "the", "current", "configuration" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Message.php#L135-L158
209,690
matomo-org/matomo
libs/Zend/Mime/Message.php
Zend_Mime_Message.getPartHeaders
public function getPartHeaders($partnum, $EOL = Zend_Mime::LINEEND) { return $this->_parts[$partnum]->getHeaders($EOL); }
php
public function getPartHeaders($partnum, $EOL = Zend_Mime::LINEEND) { return $this->_parts[$partnum]->getHeaders($EOL); }
[ "public", "function", "getPartHeaders", "(", "$", "partnum", ",", "$", "EOL", "=", "Zend_Mime", "::", "LINEEND", ")", "{", "return", "$", "this", "->", "_parts", "[", "$", "partnum", "]", "->", "getHeaders", "(", "$", "EOL", ")", ";", "}" ]
Get the headers of a given part as a string @param int $partnum @return string
[ "Get", "the", "headers", "of", "a", "given", "part", "as", "a", "string" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Message.php#L177-L180
209,691
matomo-org/matomo
libs/Zend/Mime/Message.php
Zend_Mime_Message.createFromMessage
public static function createFromMessage($message, $boundary, $EOL = Zend_Mime::LINEEND) { // require_once 'Zend/Mime/Decode.php'; $parts = Zend_Mime_Decode::splitMessageStruct($message, $boundary, $EOL); $res = new self(); foreach ($parts as $part) { // now we build a n...
php
public static function createFromMessage($message, $boundary, $EOL = Zend_Mime::LINEEND) { // require_once 'Zend/Mime/Decode.php'; $parts = Zend_Mime_Decode::splitMessageStruct($message, $boundary, $EOL); $res = new self(); foreach ($parts as $part) { // now we build a n...
[ "public", "static", "function", "createFromMessage", "(", "$", "message", ",", "$", "boundary", ",", "$", "EOL", "=", "Zend_Mime", "::", "LINEEND", ")", "{", "// require_once 'Zend/Mime/Decode.php';", "$", "parts", "=", "Zend_Mime_Decode", "::", "splitMessageStruct"...
Decodes a MIME encoded string and returns a Zend_Mime_Message object with all the MIME parts set according to the given string @param string $message @param string $boundary @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND} @return Zend_Mime_Message
[ "Decodes", "a", "MIME", "encoded", "string", "and", "returns", "a", "Zend_Mime_Message", "object", "with", "all", "the", "MIME", "parts", "set", "according", "to", "the", "given", "string" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Message.php#L243-L285
209,692
matomo-org/matomo
core/ProfessionalServices/Advertising.php
Advertising.getPromoUrlForProfessionalServices
public function getPromoUrlForProfessionalServices($campaignMedium, $campaignContent = '') { $url = 'https://matomo.org/support/?'; $campaign = $this->getCampaignParametersForPromoUrl( $name = self::CAMPAIGN_NAME_PROFESSIONAL_SERVICES, $campaignMedium, $campaignC...
php
public function getPromoUrlForProfessionalServices($campaignMedium, $campaignContent = '') { $url = 'https://matomo.org/support/?'; $campaign = $this->getCampaignParametersForPromoUrl( $name = self::CAMPAIGN_NAME_PROFESSIONAL_SERVICES, $campaignMedium, $campaignC...
[ "public", "function", "getPromoUrlForProfessionalServices", "(", "$", "campaignMedium", ",", "$", "campaignContent", "=", "''", ")", "{", "$", "url", "=", "'https://matomo.org/support/?'", ";", "$", "campaign", "=", "$", "this", "->", "getCampaignParametersForPromoUrl...
Get URL for promoting Professional Services for Piwik @param string $campaignMedium @param string $campaignContent @return string
[ "Get", "URL", "for", "promoting", "Professional", "Services", "for", "Piwik" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ProfessionalServices/Advertising.php#L56-L67
209,693
matomo-org/matomo
core/ProfessionalServices/Advertising.php
Advertising.addPromoCampaignParametersToUrl
public function addPromoCampaignParametersToUrl($url, $campaignName, $campaignMedium, $campaignContent = '') { if (empty($url)) { return ''; } if (strpos($url, '?') === false) { $url .= '?'; } else { $url .= '&'; } $url .= $this->...
php
public function addPromoCampaignParametersToUrl($url, $campaignName, $campaignMedium, $campaignContent = '') { if (empty($url)) { return ''; } if (strpos($url, '?') === false) { $url .= '?'; } else { $url .= '&'; } $url .= $this->...
[ "public", "function", "addPromoCampaignParametersToUrl", "(", "$", "url", ",", "$", "campaignName", ",", "$", "campaignMedium", ",", "$", "campaignContent", "=", "''", ")", "{", "if", "(", "empty", "(", "$", "url", ")", ")", "{", "return", "''", ";", "}"...
Appends campaign parameters to the given URL for promoting any Professional Support for Piwik service. @param string $url @param string $campaignName @param string $campaignMedium @param string $campaignContent @return string
[ "Appends", "campaign", "parameters", "to", "the", "given", "URL", "for", "promoting", "any", "Professional", "Support", "for", "Piwik", "service", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ProfessionalServices/Advertising.php#L78-L93
209,694
matomo-org/matomo
core/ProfessionalServices/Advertising.php
Advertising.getCampaignParametersForPromoUrl
private function getCampaignParametersForPromoUrl($campaignName, $campaignMedium, $campaignContent = '') { $campaignName = sprintf('pk_campaign=%s&pk_medium=%s&pk_source=Piwik_App', $campaignName, $campaignMedium); if (!empty($campaignContent)) { $campaignName .= '&pk_content=' . $campa...
php
private function getCampaignParametersForPromoUrl($campaignName, $campaignMedium, $campaignContent = '') { $campaignName = sprintf('pk_campaign=%s&pk_medium=%s&pk_source=Piwik_App', $campaignName, $campaignMedium); if (!empty($campaignContent)) { $campaignName .= '&pk_content=' . $campa...
[ "private", "function", "getCampaignParametersForPromoUrl", "(", "$", "campaignName", ",", "$", "campaignMedium", ",", "$", "campaignContent", "=", "''", ")", "{", "$", "campaignName", "=", "sprintf", "(", "'pk_campaign=%s&pk_medium=%s&pk_source=Piwik_App'", ",", "$", ...
Generates campaign URL parameters that can be used with promoting Professional Support service. @param string $campaignName @param string $campaignMedium @param string $campaignContent Optional @return string URL parameters without a leading ? or &
[ "Generates", "campaign", "URL", "parameters", "that", "can", "be", "used", "with", "promoting", "Professional", "Support", "service", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ProfessionalServices/Advertising.php#L103-L112
209,695
matomo-org/matomo
libs/Zend/Mime/Part.php
Zend_Mime_Part.getEncodedStream
public function getEncodedStream() { if (!$this->_isStream) { // require_once 'Zend/Mime/Exception.php'; throw new Zend_Mime_Exception('Attempt to get a stream from a string part'); } //stream_filter_remove(); // ??? is that right? switch ($this->encoding) { ...
php
public function getEncodedStream() { if (!$this->_isStream) { // require_once 'Zend/Mime/Exception.php'; throw new Zend_Mime_Exception('Attempt to get a stream from a string part'); } //stream_filter_remove(); // ??? is that right? switch ($this->encoding) { ...
[ "public", "function", "getEncodedStream", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_isStream", ")", "{", "// require_once 'Zend/Mime/Exception.php';", "throw", "new", "Zend_Mime_Exception", "(", "'Attempt to get a stream from a string part'", ")", ";", "}", ...
if this was created with a stream, return a filtered stream for reading the content. very useful for large file attachments. @return stream @throws Zend_Mime_Exception if not a stream or unable to append filter
[ "if", "this", "was", "created", "with", "a", "stream", "return", "a", "filtered", "stream", "for", "reading", "the", "content", ".", "very", "useful", "for", "large", "file", "attachments", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Part.php#L92-L134
209,696
matomo-org/matomo
libs/Zend/Mime/Part.php
Zend_Mime_Part.getContent
public function getContent($EOL = Zend_Mime::LINEEND) { if ($this->_isStream) { return stream_get_contents($this->getEncodedStream()); } else { return Zend_Mime::encode($this->_content, $this->encoding, $EOL); } }
php
public function getContent($EOL = Zend_Mime::LINEEND) { if ($this->_isStream) { return stream_get_contents($this->getEncodedStream()); } else { return Zend_Mime::encode($this->_content, $this->encoding, $EOL); } }
[ "public", "function", "getContent", "(", "$", "EOL", "=", "Zend_Mime", "::", "LINEEND", ")", "{", "if", "(", "$", "this", "->", "_isStream", ")", "{", "return", "stream_get_contents", "(", "$", "this", "->", "getEncodedStream", "(", ")", ")", ";", "}", ...
Get the Content of the current Mime Part in the given encoding. @return String
[ "Get", "the", "Content", "of", "the", "current", "Mime", "Part", "in", "the", "given", "encoding", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Part.php#L141-L148
209,697
matomo-org/matomo
libs/Zend/Mime/Part.php
Zend_Mime_Part.getHeadersArray
public function getHeadersArray($EOL = Zend_Mime::LINEEND) { $headers = array(); $contentType = $this->type; if ($this->charset) { $contentType .= '; charset=' . $this->charset; } if ($this->boundary) { $contentType .= ';' . $EOL ...
php
public function getHeadersArray($EOL = Zend_Mime::LINEEND) { $headers = array(); $contentType = $this->type; if ($this->charset) { $contentType .= '; charset=' . $this->charset; } if ($this->boundary) { $contentType .= ';' . $EOL ...
[ "public", "function", "getHeadersArray", "(", "$", "EOL", "=", "Zend_Mime", "::", "LINEEND", ")", "{", "$", "headers", "=", "array", "(", ")", ";", "$", "contentType", "=", "$", "this", "->", "type", ";", "if", "(", "$", "this", "->", "charset", ")",...
Create and return the array of headers for this MIME part @access public @return array
[ "Create", "and", "return", "the", "array", "of", "headers", "for", "this", "MIME", "part" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Part.php#L169-L214
209,698
matomo-org/matomo
libs/Zend/Mime/Part.php
Zend_Mime_Part.getHeaders
public function getHeaders($EOL = Zend_Mime::LINEEND) { $res = ''; foreach ($this->getHeadersArray($EOL) as $header) { $res .= $header[0] . ': ' . $header[1] . $EOL; } return $res; }
php
public function getHeaders($EOL = Zend_Mime::LINEEND) { $res = ''; foreach ($this->getHeadersArray($EOL) as $header) { $res .= $header[0] . ': ' . $header[1] . $EOL; } return $res; }
[ "public", "function", "getHeaders", "(", "$", "EOL", "=", "Zend_Mime", "::", "LINEEND", ")", "{", "$", "res", "=", "''", ";", "foreach", "(", "$", "this", "->", "getHeadersArray", "(", "$", "EOL", ")", "as", "$", "header", ")", "{", "$", "res", ".=...
Return the headers for this part as a string @return String
[ "Return", "the", "headers", "for", "this", "part", "as", "a", "string" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Part.php#L221-L229
209,699
matomo-org/matomo
core/Filesystem.php
Filesystem.mkdir
public static function mkdir($path) { if (!is_dir($path)) { // the mode in mkdir is modified by the current umask @mkdir($path, self::getChmodForPath($path), $recursive = true); } // try to overcome restrictive umask (mis-)configuration if (!is_writable($path...
php
public static function mkdir($path) { if (!is_dir($path)) { // the mode in mkdir is modified by the current umask @mkdir($path, self::getChmodForPath($path), $recursive = true); } // try to overcome restrictive umask (mis-)configuration if (!is_writable($path...
[ "public", "static", "function", "mkdir", "(", "$", "path", ")", "{", "if", "(", "!", "is_dir", "(", "$", "path", ")", ")", "{", "// the mode in mkdir is modified by the current umask", "@", "mkdir", "(", "$", "path", ",", "self", "::", "getChmodForPath", "("...
Attempts to create a new directory. All errors are silenced. _Note: This function does **not** create directories recursively._ @param string $path The path of the directory to create. @api
[ "Attempts", "to", "create", "a", "new", "directory", ".", "All", "errors", "are", "silenced", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Filesystem.php#L97-L114